From 6d6b6a34f8a3c5f06239e9db0e5d5121a372810c Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Tue, 23 May 2023 09:25:52 +0200 Subject: [PATCH] commit build of 8.41.0 and update make 'buildupstream' make target to work again Signed-off-by: Dominik Csapak --- Makefile | 2 +- src/lib/eslint.js | 66432 +++++++++++++++----------------------------- 2 files changed, 22438 insertions(+), 43996 deletions(-) diff --git a/Makefile b/Makefile index 92414ca..57d52b3 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ ${BUILDSRC}: ${UPSTREAM} patches cd $@.tmp; rm -rf .pc ./patches mv $@.tmp $@ cd $@; npm install - cd $@; npm run webpack + cd $@; npm run build:webpack .PHONY: upload upload: ${DEB} diff --git a/src/lib/eslint.js b/src/lib/eslint.js index 72ac48d..1985d9c 100644 --- a/src/lib/eslint.js +++ b/src/lib/eslint.js @@ -14,500 +14,263 @@ return /******/ (() => { // webpackBootstrap /***/ ((module, __unused_webpack_exports, __webpack_require__) => { __webpack_require__(1); - -__webpack_require__(96); - -__webpack_require__(97); - -__webpack_require__(98); - -__webpack_require__(99); - __webpack_require__(100); - __webpack_require__(101); - __webpack_require__(102); - __webpack_require__(103); - __webpack_require__(104); - __webpack_require__(105); - __webpack_require__(106); - __webpack_require__(107); - __webpack_require__(108); - __webpack_require__(109); - __webpack_require__(110); - -__webpack_require__(120); - -__webpack_require__(122); - -__webpack_require__(132); - -__webpack_require__(133); - -__webpack_require__(135); - +__webpack_require__(111); +__webpack_require__(112); +__webpack_require__(113); +__webpack_require__(114); +__webpack_require__(126); +__webpack_require__(128); __webpack_require__(138); - +__webpack_require__(139); __webpack_require__(141); - -__webpack_require__(143); - -__webpack_require__(145); - -__webpack_require__(146); - +__webpack_require__(144); __webpack_require__(147); - -__webpack_require__(148); - -__webpack_require__(150); - +__webpack_require__(149); __webpack_require__(151); - +__webpack_require__(152); __webpack_require__(153); - __webpack_require__(154); - __webpack_require__(156); - +__webpack_require__(157); +__webpack_require__(159); __webpack_require__(160); - -__webpack_require__(161); - __webpack_require__(162); - -__webpack_require__(163); - +__webpack_require__(166); +__webpack_require__(167); __webpack_require__(168); - __webpack_require__(169); - -__webpack_require__(171); - -__webpack_require__(172); - -__webpack_require__(173); - +__webpack_require__(174); __webpack_require__(175); - +__webpack_require__(177); __webpack_require__(178); - __webpack_require__(179); - -__webpack_require__(180); - __webpack_require__(181); - -__webpack_require__(182); - +__webpack_require__(184); +__webpack_require__(185); +__webpack_require__(186); __webpack_require__(187); - -__webpack_require__(189); - -__webpack_require__(190); - -__webpack_require__(191); - -__webpack_require__(192); - +__webpack_require__(188); __webpack_require__(193); - -__webpack_require__(200); - +__webpack_require__(195); +__webpack_require__(196); +__webpack_require__(198); +__webpack_require__(201); __webpack_require__(202); - +__webpack_require__(203); +__webpack_require__(204); __webpack_require__(205); - __webpack_require__(207); - -__webpack_require__(208); - -__webpack_require__(209); - -__webpack_require__(210); - -__webpack_require__(211); - -__webpack_require__(215); - +__webpack_require__(214); __webpack_require__(216); - -__webpack_require__(218); - __webpack_require__(219); - -__webpack_require__(220); - +__webpack_require__(221); __webpack_require__(222); - __webpack_require__(223); - __webpack_require__(224); - -__webpack_require__(92); - __webpack_require__(225); - -__webpack_require__(226); - +__webpack_require__(229); +__webpack_require__(230); +__webpack_require__(232); +__webpack_require__(233); __webpack_require__(234); - __webpack_require__(236); - __webpack_require__(237); - __webpack_require__(238); - +__webpack_require__(95); +__webpack_require__(239); __webpack_require__(240); - -__webpack_require__(241); - -__webpack_require__(243); - -__webpack_require__(244); - -__webpack_require__(246); - -__webpack_require__(247); - __webpack_require__(248); - __webpack_require__(250); - __webpack_require__(251); - __webpack_require__(252); - -__webpack_require__(253); - __webpack_require__(254); - __webpack_require__(255); - -__webpack_require__(256); - __webpack_require__(257); - +__webpack_require__(258); +__webpack_require__(260); __webpack_require__(261); - __webpack_require__(262); - __webpack_require__(264); - +__webpack_require__(265); __webpack_require__(266); - __webpack_require__(267); - __webpack_require__(268); - __webpack_require__(269); - __webpack_require__(270); - -__webpack_require__(272); - -__webpack_require__(274); - +__webpack_require__(271); __webpack_require__(275); - __webpack_require__(276); - -__webpack_require__(277); - -__webpack_require__(279); - +__webpack_require__(278); __webpack_require__(280); - +__webpack_require__(281); __webpack_require__(282); - __webpack_require__(283); - __webpack_require__(284); - -__webpack_require__(285); - -__webpack_require__(287); - +__webpack_require__(286); __webpack_require__(288); - __webpack_require__(289); - __webpack_require__(290); - __webpack_require__(291); - -__webpack_require__(292); - __webpack_require__(293); - __webpack_require__(294); - __webpack_require__(296); - __webpack_require__(297); - __webpack_require__(298); - __webpack_require__(299); - -__webpack_require__(300); - __webpack_require__(301); - __webpack_require__(302); - __webpack_require__(303); - +__webpack_require__(304); __webpack_require__(305); - __webpack_require__(306); - __webpack_require__(307); - -__webpack_require__(309); - +__webpack_require__(308); __webpack_require__(310); - __webpack_require__(311); - __webpack_require__(312); - -__webpack_require__(335); - -__webpack_require__(336); - -__webpack_require__(337); - -__webpack_require__(338); - -__webpack_require__(339); - -__webpack_require__(340); - -__webpack_require__(341); - -__webpack_require__(342); - -__webpack_require__(344); - -__webpack_require__(345); - -__webpack_require__(346); - -__webpack_require__(347); - +__webpack_require__(313); +__webpack_require__(314); +__webpack_require__(315); +__webpack_require__(316); +__webpack_require__(317); +__webpack_require__(318); +__webpack_require__(319); +__webpack_require__(320); +__webpack_require__(322); +__webpack_require__(323); +__webpack_require__(324); +__webpack_require__(325); __webpack_require__(348); - __webpack_require__(349); - __webpack_require__(350); - __webpack_require__(351); - __webpack_require__(352); - __webpack_require__(353); - +__webpack_require__(354); +__webpack_require__(355); +__webpack_require__(357); +__webpack_require__(358); +__webpack_require__(359); __webpack_require__(360); - __webpack_require__(361); - +__webpack_require__(362); __webpack_require__(363); - __webpack_require__(364); - __webpack_require__(365); - __webpack_require__(366); - -__webpack_require__(367); - -__webpack_require__(369); - -__webpack_require__(370); - -__webpack_require__(372); - -__webpack_require__(375); - +__webpack_require__(373); +__webpack_require__(374); __webpack_require__(376); - __webpack_require__(377); - __webpack_require__(378); - +__webpack_require__(379); +__webpack_require__(380); __webpack_require__(382); - __webpack_require__(383); - __webpack_require__(385); - -__webpack_require__(386); - -__webpack_require__(387); - __webpack_require__(388); - +__webpack_require__(389); __webpack_require__(390); - __webpack_require__(391); - -__webpack_require__(392); - -__webpack_require__(393); - -__webpack_require__(394); - __webpack_require__(395); - -__webpack_require__(397); - +__webpack_require__(396); +__webpack_require__(398); +__webpack_require__(399); __webpack_require__(400); - +__webpack_require__(401); __webpack_require__(403); - +__webpack_require__(404); +__webpack_require__(405); __webpack_require__(406); - __webpack_require__(407); - __webpack_require__(408); - -__webpack_require__(409); - __webpack_require__(410); - -__webpack_require__(411); - -__webpack_require__(412); - __webpack_require__(413); - -__webpack_require__(414); - -__webpack_require__(415); - __webpack_require__(416); - -__webpack_require__(417); - -__webpack_require__(418); - +__webpack_require__(419); +__webpack_require__(420); +__webpack_require__(421); +__webpack_require__(422); +__webpack_require__(423); +__webpack_require__(424); +__webpack_require__(425); __webpack_require__(426); - __webpack_require__(427); - __webpack_require__(428); - __webpack_require__(429); - __webpack_require__(430); - __webpack_require__(431); - -__webpack_require__(432); - -__webpack_require__(433); - -__webpack_require__(434); - -__webpack_require__(435); - -__webpack_require__(436); - -__webpack_require__(437); - -__webpack_require__(438); - +__webpack_require__(439); +__webpack_require__(440); +__webpack_require__(441); __webpack_require__(442); - __webpack_require__(443); - __webpack_require__(444); - __webpack_require__(445); - __webpack_require__(446); - __webpack_require__(447); - __webpack_require__(448); - __webpack_require__(449); - __webpack_require__(450); - __webpack_require__(451); - -__webpack_require__(452); - -__webpack_require__(453); - __webpack_require__(454); - __webpack_require__(455); - __webpack_require__(456); - __webpack_require__(457); - __webpack_require__(458); - __webpack_require__(459); - __webpack_require__(460); - __webpack_require__(461); - __webpack_require__(462); - __webpack_require__(463); - __webpack_require__(464); - __webpack_require__(465); - __webpack_require__(466); - +__webpack_require__(467); +__webpack_require__(468); __webpack_require__(469); - +__webpack_require__(470); __webpack_require__(471); - +__webpack_require__(472); __webpack_require__(473); - __webpack_require__(474); - +__webpack_require__(475); +__webpack_require__(476); __webpack_require__(477); - __webpack_require__(478); - +__webpack_require__(479); +__webpack_require__(480); __webpack_require__(481); - -__webpack_require__(482); - -__webpack_require__(483); - +__webpack_require__(484); __webpack_require__(486); - -__webpack_require__(487); - __webpack_require__(488); - +__webpack_require__(489); __webpack_require__(492); - +__webpack_require__(493); +__webpack_require__(496); __webpack_require__(497); - __webpack_require__(498); - -module.exports = __webpack_require__(80); +__webpack_require__(503); +__webpack_require__(504); +__webpack_require__(505); +__webpack_require__(509); +__webpack_require__(512); +__webpack_require__(517); +__webpack_require__(518); +__webpack_require__(519); +__webpack_require__(520); +module.exports = __webpack_require__(82); /***/ }), /* 1 */ @@ -515,14 +278,10 @@ module.exports = __webpack_require__(80); // TODO: Remove this module from `core-js@4` since it's split to modules listed below __webpack_require__(2); - -__webpack_require__(89); - -__webpack_require__(91); - __webpack_require__(92); - +__webpack_require__(94); __webpack_require__(95); +__webpack_require__(99); /***/ }), /* 2 */ @@ -532,77 +291,42 @@ __webpack_require__(95); var $ = __webpack_require__(3); - var global = __webpack_require__(4); - var call = __webpack_require__(8); - var uncurryThis = __webpack_require__(14); - -var IS_PURE = __webpack_require__(35); - +var IS_PURE = __webpack_require__(36); var DESCRIPTORS = __webpack_require__(6); - -var NATIVE_SYMBOL = __webpack_require__(26); - +var NATIVE_SYMBOL = __webpack_require__(27); var fails = __webpack_require__(7); - -var hasOwn = __webpack_require__(38); - -var isPrototypeOf = __webpack_require__(24); - -var anObject = __webpack_require__(46); - +var hasOwn = __webpack_require__(39); +var isPrototypeOf = __webpack_require__(25); +var anObject = __webpack_require__(47); var toIndexedObject = __webpack_require__(12); - var toPropertyKey = __webpack_require__(18); - -var $toString = __webpack_require__(68); - +var $toString = __webpack_require__(69); var createPropertyDescriptor = __webpack_require__(11); - -var nativeObjectCreate = __webpack_require__(71); - -var objectKeys = __webpack_require__(73); - -var getOwnPropertyNamesModule = __webpack_require__(57); - -var getOwnPropertyNamesExternal = __webpack_require__(75); - -var getOwnPropertySymbolsModule = __webpack_require__(66); - +var nativeObjectCreate = __webpack_require__(72); +var objectKeys = __webpack_require__(74); +var getOwnPropertyNamesModule = __webpack_require__(58); +var getOwnPropertyNamesExternal = __webpack_require__(76); +var getOwnPropertySymbolsModule = __webpack_require__(67); var getOwnPropertyDescriptorModule = __webpack_require__(5); - -var definePropertyModule = __webpack_require__(44); - -var definePropertiesModule = __webpack_require__(72); - +var definePropertyModule = __webpack_require__(45); +var definePropertiesModule = __webpack_require__(73); var propertyIsEnumerableModule = __webpack_require__(10); - -var defineBuiltIn = __webpack_require__(47); - -var shared = __webpack_require__(34); - -var sharedKey = __webpack_require__(53); - -var hiddenKeys = __webpack_require__(54); - -var uid = __webpack_require__(40); - -var wellKnownSymbol = __webpack_require__(33); - -var wrappedWellKnownSymbolModule = __webpack_require__(78); - -var defineWellKnownSymbol = __webpack_require__(79); - -var defineSymbolToPrimitive = __webpack_require__(81); - -var setToStringTag = __webpack_require__(82); - -var InternalStateModule = __webpack_require__(51); - -var $forEach = (__webpack_require__(83).forEach); - +var defineBuiltIn = __webpack_require__(48); +var defineBuiltInAccessor = __webpack_require__(79); +var shared = __webpack_require__(35); +var sharedKey = __webpack_require__(54); +var hiddenKeys = __webpack_require__(55); +var uid = __webpack_require__(41); +var wellKnownSymbol = __webpack_require__(34); +var wrappedWellKnownSymbolModule = __webpack_require__(80); +var defineWellKnownSymbol = __webpack_require__(81); +var defineSymbolToPrimitive = __webpack_require__(83); +var setToStringTag = __webpack_require__(84); +var InternalStateModule = __webpack_require__(52); +var $forEach = (__webpack_require__(85).forEach); var HIDDEN = sharedKey('hidden'); var SYMBOL = 'Symbol'; var PROTOTYPE = 'prototype'; @@ -620,10 +344,12 @@ var nativePropertyIsEnumerable = propertyIsEnumerableModule.f; var push = uncurryThis([].push); var AllSymbols = shared('symbols'); var ObjectPrototypeSymbols = shared('op-symbols'); -var WellKnownSymbolsStore = shared('wks'); // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 +var WellKnownSymbolsStore = shared('wks'); -var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 +// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 +var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; +// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 var setSymbolDescriptor = DESCRIPTORS && fails(function () { return nativeObjectCreate(nativeDefineProperty({}, 'a', { get: function () { @@ -636,12 +362,10 @@ var setSymbolDescriptor = DESCRIPTORS && fails(function () { var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P); if (ObjectPrototypeDescriptor) delete ObjectPrototype[P]; nativeDefineProperty(O, P, Attributes); - if (ObjectPrototypeDescriptor && O !== ObjectPrototype) { nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor); } } : nativeDefineProperty; - var wrap = function (tag, description) { var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype); setInternalState(symbol, { @@ -652,13 +376,11 @@ var wrap = function (tag, description) { if (!DESCRIPTORS) symbol.description = description; return symbol; }; - var $defineProperty = function defineProperty(O, P, Attributes) { if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes); anObject(O); var key = toPropertyKey(P); anObject(Attributes); - if (hasOwn(AllSymbols, key)) { if (!Attributes.enumerable) { if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {})); @@ -669,13 +391,10 @@ var $defineProperty = function defineProperty(O, P, Attributes) { enumerable: createPropertyDescriptor(0, false) }); } - return setSymbolDescriptor(O, key, Attributes); } - return nativeDefineProperty(O, key, Attributes); }; - var $defineProperties = function defineProperties(O, Properties) { anObject(O); var properties = toIndexedObject(Properties); @@ -685,31 +404,25 @@ var $defineProperties = function defineProperties(O, Properties) { }); return O; }; - var $create = function create(O, Properties) { return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties); }; - var $propertyIsEnumerable = function propertyIsEnumerable(V) { var P = toPropertyKey(V); var enumerable = call(nativePropertyIsEnumerable, this, P); if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false; return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true; }; - var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) { var it = toIndexedObject(O); var key = toPropertyKey(P); if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return; var descriptor = nativeGetOwnPropertyDescriptor(it, key); - if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) { descriptor.enumerable = true; } - return descriptor; }; - var $getOwnPropertyNames = function getOwnPropertyNames(O) { var names = nativeGetOwnPropertyNames(toIndexedObject(O)); var result = []; @@ -718,7 +431,6 @@ var $getOwnPropertyNames = function getOwnPropertyNames(O) { }); return result; }; - var $getOwnPropertySymbols = function (O) { var IS_OBJECT_PROTOTYPE = O === ObjectPrototype; var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O)); @@ -729,29 +441,26 @@ var $getOwnPropertySymbols = function (O) { } }); return result; -}; // `Symbol` constructor +}; + +// `Symbol` constructor // https://tc39.es/ecma262/#sec-symbol-constructor - - if (!NATIVE_SYMBOL) { $Symbol = function Symbol() { if (isPrototypeOf(SymbolPrototype, this)) throw TypeError('Symbol is not a constructor'); var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]); var tag = uid(description); - var setter = function (value) { if (this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value); if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag)) this[HIDDEN][tag] = false; setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value)); }; - if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter }); return wrap(tag, description); }; - SymbolPrototype = $Symbol[PROTOTYPE]; defineBuiltIn(SymbolPrototype, 'toString', function toString() { return getInternalState(this).tag; @@ -765,20 +474,17 @@ if (!NATIVE_SYMBOL) { getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor; getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames; getOwnPropertySymbolsModule.f = $getOwnPropertySymbols; - wrappedWellKnownSymbolModule.f = function (name) { return wrap(wellKnownSymbol(name), name); }; - if (DESCRIPTORS) { // https://github.com/tc39/proposal-Symbol-description - nativeDefineProperty(SymbolPrototype, 'description', { + defineBuiltInAccessor(SymbolPrototype, 'description', { configurable: true, get: function description() { return getInternalState(this).description; } }); - if (!IS_PURE) { defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true @@ -786,7 +492,6 @@ if (!NATIVE_SYMBOL) { } } } - $({ global: true, constructor: true, @@ -838,12 +543,14 @@ $({ // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames getOwnPropertyNames: $getOwnPropertyNames -}); // `Symbol.prototype[@@toPrimitive]` method +}); + +// `Symbol.prototype[@@toPrimitive]` method // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive +defineSymbolToPrimitive(); -defineSymbolToPrimitive(); // `Symbol.prototype[@@toStringTag]` property +// `Symbol.prototype[@@toStringTag]` property // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag - setToStringTag($Symbol, SYMBOL); hiddenKeys[HIDDEN] = true; @@ -852,18 +559,13 @@ hiddenKeys[HIDDEN] = true; /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4); - var getOwnPropertyDescriptor = (__webpack_require__(5).f); +var createNonEnumerableProperty = __webpack_require__(44); +var defineBuiltIn = __webpack_require__(48); +var defineGlobalProperty = __webpack_require__(38); +var copyConstructorProperties = __webpack_require__(56); +var isForced = __webpack_require__(68); -var createNonEnumerableProperty = __webpack_require__(43); - -var defineBuiltIn = __webpack_require__(47); - -var defineGlobalProperty = __webpack_require__(37); - -var copyConstructorProperties = __webpack_require__(55); - -var isForced = __webpack_require__(67); /* options.target - name of the target object options.global - target is the global object @@ -879,14 +581,11 @@ var isForced = __webpack_require__(67); options.dontCallGetSet - prevent calling a getter on target options.name - the .name of the function if it does not match the key */ - - module.exports = function (options, source) { var TARGET = options.target; var GLOBAL = options.global; var STATIC = options.stat; var FORCED, target, key, targetProperty, sourceProperty, descriptor; - if (GLOBAL) { target = global; } else if (STATIC) { @@ -894,79 +593,69 @@ module.exports = function (options, source) { } else { target = (global[TARGET] || {}).prototype; } - if (target) for (key in source) { sourceProperty = source[key]; - if (options.dontCallGetSet) { descriptor = getOwnPropertyDescriptor(target, key); targetProperty = descriptor && descriptor.value; } else targetProperty = target[key]; - - FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target - + FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); + // contained in target if (!FORCED && targetProperty !== undefined) { if (typeof sourceProperty == typeof targetProperty) continue; copyConstructorProperties(sourceProperty, targetProperty); - } // add a flag to not completely full polyfills - - + } + // add a flag to not completely full polyfills if (options.sham || targetProperty && targetProperty.sham) { createNonEnumerableProperty(sourceProperty, 'sham', true); } - defineBuiltIn(target, key, sourceProperty, options); } }; /***/ }), /* 4 */ -/***/ ((module) => { +/***/ (function(module) { var check = function (it) { return it && it.Math == Math && it; -}; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +}; - -module.exports = // eslint-disable-next-line es-x/no-global-this -- safe -check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || // eslint-disable-next-line no-restricted-globals -- safe -check(typeof self == 'object' && self) || check(typeof global == 'object' && global) || // eslint-disable-next-line no-new-func -- fallback +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +module.exports = +// eslint-disable-next-line es/no-global-this -- safe +check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || +// eslint-disable-next-line no-restricted-globals -- safe +check(typeof self == 'object' && self) || check(typeof global == 'object' && global) || +// eslint-disable-next-line no-new-func -- fallback function () { return this; -}() || Function('return this')(); +}() || this || Function('return this')(); /***/ }), /* 5 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(6); - var call = __webpack_require__(8); - var propertyIsEnumerableModule = __webpack_require__(10); - var createPropertyDescriptor = __webpack_require__(11); - var toIndexedObject = __webpack_require__(12); - var toPropertyKey = __webpack_require__(18); +var hasOwn = __webpack_require__(39); +var IE8_DOM_DEFINE = __webpack_require__(42); -var hasOwn = __webpack_require__(38); +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe +var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; -var IE8_DOM_DEFINE = __webpack_require__(41); // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe - - -var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method +// `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor - exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject(O); P = toPropertyKey(P); if (IE8_DOM_DEFINE) try { return $getOwnPropertyDescriptor(O, P); - } catch (error) { - /* empty */ - } + } catch (error) {/* empty */} if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]); }; @@ -974,11 +663,11 @@ exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDes /* 6 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var fails = __webpack_require__(7); // Detect IE8's incomplete defineProperty implementation - +var fails = __webpack_require__(7); +// Detect IE8's incomplete defineProperty implementation module.exports = !fails(function () { - // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing + // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty({}, 1, { get: function () { return 7; @@ -1003,7 +692,6 @@ module.exports = function (exec) { /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var NATIVE_BIND = __webpack_require__(9); - var call = Function.prototype.call; module.exports = NATIVE_BIND ? call.bind(call) : function () { return call.apply(call, arguments); @@ -1014,14 +702,10 @@ module.exports = NATIVE_BIND ? call.bind(call) : function () { /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fails = __webpack_require__(7); - module.exports = !fails(function () { - // eslint-disable-next-line es-x/no-function-prototype-bind -- safe - var test = function () { - /* empty */ - }.bind(); // eslint-disable-next-line no-prototype-builtins -- safe - - + // eslint-disable-next-line es/no-function-prototype-bind -- safe + var test = function () {/* empty */}.bind(); + // eslint-disable-next-line no-prototype-builtins -- safe return typeof test != 'function' || test.hasOwnProperty('prototype'); }); @@ -1032,15 +716,17 @@ module.exports = !fails(function () { "use strict"; -var $propertyIsEnumerable = {}.propertyIsEnumerable; // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe - -var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug +var $propertyIsEnumerable = {}.propertyIsEnumerable; +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; +// Nashorn ~ JDK8 bug var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 -}, 1); // `Object.prototype.propertyIsEnumerable` method implementation -// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable +}, 1); +// `Object.prototype.propertyIsEnumerable` method implementation +// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor(this, V); return !!descriptor && descriptor.enumerable; @@ -1065,9 +751,7 @@ module.exports = function (bitmap, value) { // toObject with fallback for non-array-like ES3 strings var IndexedObject = __webpack_require__(13); - var requireObjectCoercible = __webpack_require__(16); - module.exports = function (it) { return IndexedObject(requireObjectCoercible(it)); }; @@ -1077,14 +761,12 @@ module.exports = function (it) { /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(14); - var fails = __webpack_require__(7); - var classof = __webpack_require__(15); - var $Object = Object; -var split = uncurryThis(''.split); // fallback for non-array-like ES3 and non-enumerable old V8 strings +var split = uncurryThis(''.split); +// fallback for non-array-like ES3 and non-enumerable old V8 strings module.exports = fails(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins -- safe @@ -1098,15 +780,11 @@ module.exports = fails(function () { /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var NATIVE_BIND = __webpack_require__(9); - var FunctionPrototype = Function.prototype; -var bind = FunctionPrototype.bind; var call = FunctionPrototype.call; -var uncurryThis = NATIVE_BIND && bind.bind(call, call); -module.exports = NATIVE_BIND ? function (fn) { - return fn && uncurryThis(fn); -} : function (fn) { - return fn && function () { +var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call); +module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) { + return function () { return call.apply(fn, arguments); }; }; @@ -1116,10 +794,8 @@ module.exports = NATIVE_BIND ? function (fn) { /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(14); - var toString = uncurryThis({}.toString); var stringSlice = uncurryThis(''.slice); - module.exports = function (it) { return stringSlice(toString(it), 8, -1); }; @@ -1129,10 +805,10 @@ module.exports = function (it) { /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isNullOrUndefined = __webpack_require__(17); +var $TypeError = TypeError; -var $TypeError = TypeError; // `RequireObjectCoercible` abstract operation +// `RequireObjectCoercible` abstract operation // https://tc39.es/ecma262/#sec-requireobjectcoercible - module.exports = function (it) { if (isNullOrUndefined(it)) throw $TypeError("Can't call method on " + it); return it; @@ -1153,11 +829,10 @@ module.exports = function (it) { /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var toPrimitive = __webpack_require__(19); +var isSymbol = __webpack_require__(23); -var isSymbol = __webpack_require__(22); // `ToPropertyKey` abstract operation +// `ToPropertyKey` abstract operation // https://tc39.es/ecma262/#sec-topropertykey - - module.exports = function (argument) { var key = toPrimitive(argument, 'string'); return isSymbol(key) ? key : key + ''; @@ -1168,33 +843,26 @@ module.exports = function (argument) { /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var call = __webpack_require__(8); - var isObject = __webpack_require__(20); - -var isSymbol = __webpack_require__(22); - -var getMethod = __webpack_require__(29); - -var ordinaryToPrimitive = __webpack_require__(32); - -var wellKnownSymbol = __webpack_require__(33); - +var isSymbol = __webpack_require__(23); +var getMethod = __webpack_require__(30); +var ordinaryToPrimitive = __webpack_require__(33); +var wellKnownSymbol = __webpack_require__(34); var $TypeError = TypeError; -var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); // `ToPrimitive` abstract operation -// https://tc39.es/ecma262/#sec-toprimitive +var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); +// `ToPrimitive` abstract operation +// https://tc39.es/ecma262/#sec-toprimitive module.exports = function (input, pref) { if (!isObject(input) || isSymbol(input)) return input; var exoticToPrim = getMethod(input, TO_PRIMITIVE); var result; - if (exoticToPrim) { if (pref === undefined) pref = 'default'; result = call(exoticToPrim, input, pref); if (!isObject(result) || isSymbol(result)) return result; throw $TypeError("Can't convert object to primitive value"); } - if (pref === undefined) pref = 'number'; return ordinaryToPrimitive(input, pref); }; @@ -1204,11 +872,9 @@ module.exports = function (input, pref) { /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isCallable = __webpack_require__(21); - -var documentAll = typeof document == 'object' && document.all; // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot - -var SPECIAL_DOCUMENT_ALL = typeof documentAll == 'undefined' && documentAll !== undefined; -module.exports = SPECIAL_DOCUMENT_ALL ? function (it) { +var $documentAll = __webpack_require__(22); +var documentAll = $documentAll.all; +module.exports = $documentAll.IS_HTMLDDA ? function (it) { return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll; } : function (it) { return typeof it == 'object' ? it !== null : isCallable(it); @@ -1216,26 +882,41 @@ module.exports = SPECIAL_DOCUMENT_ALL ? function (it) { /***/ }), /* 21 */ -/***/ ((module) => { +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var $documentAll = __webpack_require__(22); +var documentAll = $documentAll.all; // `IsCallable` abstract operation // https://tc39.es/ecma262/#sec-iscallable -module.exports = function (argument) { +module.exports = $documentAll.IS_HTMLDDA ? function (argument) { + return typeof argument == 'function' || argument === documentAll; +} : function (argument) { return typeof argument == 'function'; }; /***/ }), /* 22 */ +/***/ ((module) => { + +var documentAll = typeof document == 'object' && document.all; + +// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot +// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing +var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined; +module.exports = { + all: documentAll, + IS_HTMLDDA: IS_HTMLDDA +}; + +/***/ }), +/* 23 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var getBuiltIn = __webpack_require__(23); - +var getBuiltIn = __webpack_require__(24); var isCallable = __webpack_require__(21); - -var isPrototypeOf = __webpack_require__(24); - -var USE_SYMBOL_AS_UID = __webpack_require__(25); - +var isPrototypeOf = __webpack_require__(25); +var USE_SYMBOL_AS_UID = __webpack_require__(26); var $Object = Object; module.exports = USE_SYMBOL_AS_UID ? function (it) { return typeof it == 'symbol'; @@ -1245,134 +926,123 @@ module.exports = USE_SYMBOL_AS_UID ? function (it) { }; /***/ }), -/* 23 */ +/* 24 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4); - var isCallable = __webpack_require__(21); - var aFunction = function (argument) { return isCallable(argument) ? argument : undefined; }; - module.exports = function (namespace, method) { return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method]; }; -/***/ }), -/* 24 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var uncurryThis = __webpack_require__(14); - -module.exports = uncurryThis({}.isPrototypeOf); - /***/ }), /* 25 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -/* eslint-disable es-x/no-symbol -- required for testing */ -var NATIVE_SYMBOL = __webpack_require__(26); - -module.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == 'symbol'; +var uncurryThis = __webpack_require__(14); +module.exports = uncurryThis({}.isPrototypeOf); /***/ }), /* 26 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -/* eslint-disable es-x/no-symbol -- required for testing */ -var V8_VERSION = __webpack_require__(27); - -var fails = __webpack_require__(7); // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing - - -module.exports = !!Object.getOwnPropertySymbols && !fails(function () { - var symbol = Symbol(); // Chrome 38 Symbol has incorrect toString conversion - // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances - - return !String(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances - !Symbol.sham && V8_VERSION && V8_VERSION < 41; -}); +/* eslint-disable es/no-symbol -- required for testing */ +var NATIVE_SYMBOL = __webpack_require__(27); +module.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == 'symbol'; /***/ }), /* 27 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { +/* eslint-disable es/no-symbol -- required for testing */ +var V8_VERSION = __webpack_require__(28); +var fails = __webpack_require__(7); var global = __webpack_require__(4); +var $String = global.String; -var userAgent = __webpack_require__(28); - -var process = global.process; -var Deno = global.Deno; -var versions = process && process.versions || Deno && Deno.version; -var v8 = versions && versions.v8; -var match, version; - -if (v8) { - match = v8.split('.'); // in old Chrome, versions of V8 isn't V8 = Chrome / 10 - // but their correct versions are not interesting for us - - version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]); -} // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0` -// so check `userAgent` even if `.v8` exists, but 0 - - -if (!version && userAgent) { - match = userAgent.match(/Edge\/(\d+)/); - - if (!match || match[1] >= 74) { - match = userAgent.match(/Chrome\/(\d+)/); - if (match) version = +match[1]; - } -} - -module.exports = version; +// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing +module.exports = !!Object.getOwnPropertySymbols && !fails(function () { + var symbol = Symbol(); + // Chrome 38 Symbol has incorrect toString conversion + // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances + // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will, + // of course, fail. + return !$String(symbol) || !(Object(symbol) instanceof Symbol) || + // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances + !Symbol.sham && V8_VERSION && V8_VERSION < 41; +}); /***/ }), /* 28 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var getBuiltIn = __webpack_require__(23); +var global = __webpack_require__(4); +var userAgent = __webpack_require__(29); +var process = global.process; +var Deno = global.Deno; +var versions = process && process.versions || Deno && Deno.version; +var v8 = versions && versions.v8; +var match, version; +if (v8) { + match = v8.split('.'); + // in old Chrome, versions of V8 isn't V8 = Chrome / 10 + // but their correct versions are not interesting for us + version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]); +} -module.exports = getBuiltIn('navigator', 'userAgent') || ''; +// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0` +// so check `userAgent` even if `.v8` exists, but 0 +if (!version && userAgent) { + match = userAgent.match(/Edge\/(\d+)/); + if (!match || match[1] >= 74) { + match = userAgent.match(/Chrome\/(\d+)/); + if (match) version = +match[1]; + } +} +module.exports = version; /***/ }), /* 29 */ +/***/ ((module) => { + +module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || ''; + +/***/ }), +/* 30 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var aCallable = __webpack_require__(30); +var aCallable = __webpack_require__(31); +var isNullOrUndefined = __webpack_require__(17); -var isNullOrUndefined = __webpack_require__(17); // `GetMethod` abstract operation +// `GetMethod` abstract operation // https://tc39.es/ecma262/#sec-getmethod - - module.exports = function (V, P) { var func = V[P]; return isNullOrUndefined(func) ? undefined : aCallable(func); }; /***/ }), -/* 30 */ +/* 31 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isCallable = __webpack_require__(21); +var tryToString = __webpack_require__(32); +var $TypeError = TypeError; -var tryToString = __webpack_require__(31); - -var $TypeError = TypeError; // `Assert: IsCallable(argument) is true` - +// `Assert: IsCallable(argument) is true` module.exports = function (argument) { if (isCallable(argument)) return argument; throw $TypeError(tryToString(argument) + ' is not a function'); }; /***/ }), -/* 31 */ +/* 32 */ /***/ ((module) => { var $String = String; - module.exports = function (argument) { try { return $String(argument); @@ -1382,18 +1052,16 @@ module.exports = function (argument) { }; /***/ }), -/* 32 */ +/* 33 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var call = __webpack_require__(8); - var isCallable = __webpack_require__(21); - var isObject = __webpack_require__(20); +var $TypeError = TypeError; -var $TypeError = TypeError; // `OrdinaryToPrimitive` abstract operation +// `OrdinaryToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-ordinarytoprimitive - module.exports = function (input, pref) { var fn, val; if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val; @@ -1403,87 +1071,65 @@ module.exports = function (input, pref) { }; /***/ }), -/* 33 */ +/* 34 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4); - -var shared = __webpack_require__(34); - -var hasOwn = __webpack_require__(38); - -var uid = __webpack_require__(40); - -var NATIVE_SYMBOL = __webpack_require__(26); - -var USE_SYMBOL_AS_UID = __webpack_require__(25); - -var WellKnownSymbolsStore = shared('wks'); +var shared = __webpack_require__(35); +var hasOwn = __webpack_require__(39); +var uid = __webpack_require__(41); +var NATIVE_SYMBOL = __webpack_require__(27); +var USE_SYMBOL_AS_UID = __webpack_require__(26); var Symbol = global.Symbol; -var symbolFor = Symbol && Symbol['for']; -var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid; - +var WellKnownSymbolsStore = shared('wks'); +var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid; module.exports = function (name) { - if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) { - var description = 'Symbol.' + name; - - if (NATIVE_SYMBOL && hasOwn(Symbol, name)) { - WellKnownSymbolsStore[name] = Symbol[name]; - } else if (USE_SYMBOL_AS_UID && symbolFor) { - WellKnownSymbolsStore[name] = symbolFor(description); - } else { - WellKnownSymbolsStore[name] = createWellKnownSymbol(description); - } + if (!hasOwn(WellKnownSymbolsStore, name)) { + WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name) ? Symbol[name] : createWellKnownSymbol('Symbol.' + name); } - return WellKnownSymbolsStore[name]; }; /***/ }), -/* 34 */ +/* 35 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var IS_PURE = __webpack_require__(35); - -var store = __webpack_require__(36); - +var IS_PURE = __webpack_require__(36); +var store = __webpack_require__(37); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ - version: '3.25.1', + version: '3.30.2', mode: IS_PURE ? 'pure' : 'global', - copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)', - license: 'https://github.com/zloirock/core-js/blob/v3.25.1/LICENSE', + copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)', + license: 'https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE', source: 'https://github.com/zloirock/core-js' }); /***/ }), -/* 35 */ +/* 36 */ /***/ ((module) => { module.exports = false; /***/ }), -/* 36 */ +/* 37 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4); - -var defineGlobalProperty = __webpack_require__(37); - +var defineGlobalProperty = __webpack_require__(38); var SHARED = '__core-js_shared__'; var store = global[SHARED] || defineGlobalProperty(SHARED, {}); module.exports = store; /***/ }), -/* 37 */ +/* 38 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var global = __webpack_require__(4); // eslint-disable-next-line es-x/no-object-defineproperty -- safe - +var global = __webpack_require__(4); +// eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty = Object.defineProperty; - module.exports = function (key, value) { try { defineProperty(global, key, { @@ -1494,66 +1140,60 @@ module.exports = function (key, value) { } catch (error) { global[key] = value; } - return value; }; -/***/ }), -/* 38 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var uncurryThis = __webpack_require__(14); - -var toObject = __webpack_require__(39); - -var hasOwnProperty = uncurryThis({}.hasOwnProperty); // `HasOwnProperty` abstract operation -// https://tc39.es/ecma262/#sec-hasownproperty -// eslint-disable-next-line es-x/no-object-hasown -- safe - -module.exports = Object.hasOwn || function hasOwn(it, key) { - return hasOwnProperty(toObject(it), key); -}; - /***/ }), /* 39 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var requireObjectCoercible = __webpack_require__(16); +var uncurryThis = __webpack_require__(14); +var toObject = __webpack_require__(40); +var hasOwnProperty = uncurryThis({}.hasOwnProperty); -var $Object = Object; // `ToObject` abstract operation -// https://tc39.es/ecma262/#sec-toobject - -module.exports = function (argument) { - return $Object(requireObjectCoercible(argument)); +// `HasOwnProperty` abstract operation +// https://tc39.es/ecma262/#sec-hasownproperty +// eslint-disable-next-line es/no-object-hasown -- safe +module.exports = Object.hasOwn || function hasOwn(it, key) { + return hasOwnProperty(toObject(it), key); }; /***/ }), /* 40 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var uncurryThis = __webpack_require__(14); +var requireObjectCoercible = __webpack_require__(16); +var $Object = Object; -var id = 0; -var postfix = Math.random(); -var toString = uncurryThis(1.0.toString); - -module.exports = function (key) { - return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36); +// `ToObject` abstract operation +// https://tc39.es/ecma262/#sec-toobject +module.exports = function (argument) { + return $Object(requireObjectCoercible(argument)); }; /***/ }), /* 41 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { +var uncurryThis = __webpack_require__(14); +var id = 0; +var postfix = Math.random(); +var toString = uncurryThis(1.0.toString); +module.exports = function (key) { + return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36); +}; + +/***/ }), +/* 42 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + var DESCRIPTORS = __webpack_require__(6); - var fails = __webpack_require__(7); +var createElement = __webpack_require__(43); -var createElement = __webpack_require__(42); // Thanks to IE8 for its funny defineProperty - - +// Thanks to IE8 for its funny defineProperty module.exports = !DESCRIPTORS && !fails(function () { - // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing + // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; @@ -1562,31 +1202,25 @@ module.exports = !DESCRIPTORS && !fails(function () { }); /***/ }), -/* 42 */ +/* 43 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4); - var isObject = __webpack_require__(20); - -var document = global.document; // typeof document.createElement is 'object' in old IE - +var document = global.document; +// typeof document.createElement is 'object' in old IE var EXISTS = isObject(document) && isObject(document.createElement); - module.exports = function (it) { return EXISTS ? document.createElement(it) : {}; }; /***/ }), -/* 43 */ +/* 44 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(6); - -var definePropertyModule = __webpack_require__(44); - +var definePropertyModule = __webpack_require__(45); var createPropertyDescriptor = __webpack_require__(11); - module.exports = DESCRIPTORS ? function (object, key, value) { return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); } : function (object, key, value) { @@ -1595,37 +1229,31 @@ module.exports = DESCRIPTORS ? function (object, key, value) { }; /***/ }), -/* 44 */ +/* 45 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(6); - -var IE8_DOM_DEFINE = __webpack_require__(41); - -var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(45); - -var anObject = __webpack_require__(46); - +var IE8_DOM_DEFINE = __webpack_require__(42); +var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(46); +var anObject = __webpack_require__(47); var toPropertyKey = __webpack_require__(18); - -var $TypeError = TypeError; // eslint-disable-next-line es-x/no-object-defineproperty -- safe - -var $defineProperty = Object.defineProperty; // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe - +var $TypeError = TypeError; +// eslint-disable-next-line es/no-object-defineproperty -- safe +var $defineProperty = Object.defineProperty; +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var ENUMERABLE = 'enumerable'; var CONFIGURABLE = 'configurable'; -var WRITABLE = 'writable'; // `Object.defineProperty` method -// https://tc39.es/ecma262/#sec-object.defineproperty +var WRITABLE = 'writable'; +// `Object.defineProperty` method +// https://tc39.es/ecma262/#sec-object.defineproperty exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) { anObject(O); P = toPropertyKey(P); anObject(Attributes); - if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) { var current = $getOwnPropertyDescriptor(O, P); - if (current && current[WRITABLE]) { O[P] = Attributes.value; Attributes = { @@ -1635,7 +1263,6 @@ exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P }; } } - return $defineProperty(O, P, Attributes); } : $defineProperty : function defineProperty(O, P, Attributes) { anObject(O); @@ -1643,75 +1270,62 @@ exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P anObject(Attributes); if (IE8_DOM_DEFINE) try { return $defineProperty(O, P, Attributes); - } catch (error) { - /* empty */ - } + } catch (error) {/* empty */} if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; /***/ }), -/* 45 */ +/* 46 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(6); +var fails = __webpack_require__(7); -var fails = __webpack_require__(7); // V8 ~ Chrome 36- +// V8 ~ Chrome 36- // https://bugs.chromium.org/p/v8/issues/detail?id=3334 - - module.exports = DESCRIPTORS && fails(function () { - // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing - return Object.defineProperty(function () { - /* empty */ - }, 'prototype', { + // eslint-disable-next-line es/no-object-defineproperty -- required for testing + return Object.defineProperty(function () {/* empty */}, 'prototype', { value: 42, writable: false }).prototype != 42; }); /***/ }), -/* 46 */ +/* 47 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isObject = __webpack_require__(20); - var $String = String; -var $TypeError = TypeError; // `Assert: Type(argument) is Object` +var $TypeError = TypeError; +// `Assert: Type(argument) is Object` module.exports = function (argument) { if (isObject(argument)) return argument; throw $TypeError($String(argument) + ' is not an object'); }; /***/ }), -/* 47 */ +/* 48 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isCallable = __webpack_require__(21); - -var definePropertyModule = __webpack_require__(44); - -var makeBuiltIn = __webpack_require__(48); - -var defineGlobalProperty = __webpack_require__(37); - +var definePropertyModule = __webpack_require__(45); +var makeBuiltIn = __webpack_require__(49); +var defineGlobalProperty = __webpack_require__(38); module.exports = function (O, key, value, options) { if (!options) options = {}; var simple = options.enumerable; var name = options.name !== undefined ? options.name : key; if (isCallable(value)) makeBuiltIn(value, name, options); - if (options.global) { if (simple) O[key] = value;else defineGlobalProperty(key, value); } else { try { if (!options.unsafe) delete O[key];else if (O[key]) simple = true; - } catch (error) { - /* empty */ - } - + } catch (error) {/* empty */} if (simple) O[key] = value;else definePropertyModule.f(O, key, { value: value, enumerable: false, @@ -1719,104 +1333,85 @@ module.exports = function (O, key, value, options) { writable: !options.nonWritable }); } - return O; }; /***/ }), -/* 48 */ +/* 49 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { +var uncurryThis = __webpack_require__(14); var fails = __webpack_require__(7); - var isCallable = __webpack_require__(21); - -var hasOwn = __webpack_require__(38); - +var hasOwn = __webpack_require__(39); var DESCRIPTORS = __webpack_require__(6); - -var CONFIGURABLE_FUNCTION_NAME = (__webpack_require__(49).CONFIGURABLE); - -var inspectSource = __webpack_require__(50); - -var InternalStateModule = __webpack_require__(51); - +var CONFIGURABLE_FUNCTION_NAME = (__webpack_require__(50).CONFIGURABLE); +var inspectSource = __webpack_require__(51); +var InternalStateModule = __webpack_require__(52); var enforceInternalState = InternalStateModule.enforce; -var getInternalState = InternalStateModule.get; // eslint-disable-next-line es-x/no-object-defineproperty -- safe - +var getInternalState = InternalStateModule.get; +var $String = String; +// eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty = Object.defineProperty; +var stringSlice = uncurryThis(''.slice); +var replace = uncurryThis(''.replace); +var join = uncurryThis([].join); var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () { - return defineProperty(function () { - /* empty */ - }, 'length', { + return defineProperty(function () {/* empty */}, 'length', { value: 8 }).length !== 8; }); var TEMPLATE = String(String).split('String'); - var makeBuiltIn = module.exports = function (value, name, options) { - if (String(name).slice(0, 7) === 'Symbol(') { - name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']'; + if (stringSlice($String(name), 0, 7) === 'Symbol(') { + name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']'; } - if (options && options.getter) name = 'get ' + name; if (options && options.setter) name = 'set ' + name; - if (!hasOwn(value, 'name') || CONFIGURABLE_FUNCTION_NAME && value.name !== name) { if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });else value.name = name; } - if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) { defineProperty(value, 'length', { value: options.arity }); } - try { if (options && hasOwn(options, 'constructor') && options.constructor) { if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false - }); // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable + }); + // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable } else if (value.prototype) value.prototype = undefined; - } catch (error) { - /* empty */ - } - + } catch (error) {/* empty */} var state = enforceInternalState(value); - if (!hasOwn(state, 'source')) { - state.source = TEMPLATE.join(typeof name == 'string' ? name : ''); + state.source = join(TEMPLATE, typeof name == 'string' ? name : ''); } - return value; -}; // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative +}; + +// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative // eslint-disable-next-line no-extend-native -- required - - Function.prototype.toString = makeBuiltIn(function toString() { return isCallable(this) && getInternalState(this).source || inspectSource(this); }, 'toString'); /***/ }), -/* 49 */ +/* 50 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(6); - -var hasOwn = __webpack_require__(38); - -var FunctionPrototype = Function.prototype; // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe - +var hasOwn = __webpack_require__(39); +var FunctionPrototype = Function.prototype; +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor; -var EXISTS = hasOwn(FunctionPrototype, 'name'); // additional protection from minified / mangled / dropped function names - -var PROPER = EXISTS && function something() { - /* empty */ -}.name === 'something'; - +var EXISTS = hasOwn(FunctionPrototype, 'name'); +// additional protection from minified / mangled / dropped function names +var PROPER = EXISTS && function something() {/* empty */}.name === 'something'; var CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable); module.exports = { EXISTS: EXISTS, @@ -1825,108 +1420,85 @@ module.exports = { }; /***/ }), -/* 50 */ +/* 51 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(14); - var isCallable = __webpack_require__(21); +var store = __webpack_require__(37); +var functionToString = uncurryThis(Function.toString); -var store = __webpack_require__(36); - -var functionToString = uncurryThis(Function.toString); // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper - +// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper if (!isCallable(store.inspectSource)) { store.inspectSource = function (it) { return functionToString(it); }; } - module.exports = store.inspectSource; /***/ }), -/* 51 */ +/* 52 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var NATIVE_WEAK_MAP = __webpack_require__(52); - +var NATIVE_WEAK_MAP = __webpack_require__(53); var global = __webpack_require__(4); - -var uncurryThis = __webpack_require__(14); - var isObject = __webpack_require__(20); - -var createNonEnumerableProperty = __webpack_require__(43); - -var hasOwn = __webpack_require__(38); - -var shared = __webpack_require__(36); - -var sharedKey = __webpack_require__(53); - -var hiddenKeys = __webpack_require__(54); - +var createNonEnumerableProperty = __webpack_require__(44); +var hasOwn = __webpack_require__(39); +var shared = __webpack_require__(37); +var sharedKey = __webpack_require__(54); +var hiddenKeys = __webpack_require__(55); var OBJECT_ALREADY_INITIALIZED = 'Object already initialized'; var TypeError = global.TypeError; var WeakMap = global.WeakMap; var set, get, has; - var enforce = function (it) { return has(it) ? get(it) : set(it, {}); }; - var getterFor = function (TYPE) { return function (it) { var state; - if (!isObject(it) || (state = get(it)).type !== TYPE) { throw TypeError('Incompatible receiver, ' + TYPE + ' required'); } - return state; }; }; - if (NATIVE_WEAK_MAP || shared.state) { var store = shared.state || (shared.state = new WeakMap()); - var wmget = uncurryThis(store.get); - var wmhas = uncurryThis(store.has); - var wmset = uncurryThis(store.set); - + /* eslint-disable no-self-assign -- prototype methods protection */ + store.get = store.get; + store.has = store.has; + store.set = store.set; + /* eslint-enable no-self-assign -- prototype methods protection */ set = function (it, metadata) { - if (wmhas(store, it)) throw TypeError(OBJECT_ALREADY_INITIALIZED); + if (store.has(it)) throw TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; - wmset(store, it, metadata); + store.set(it, metadata); return metadata; }; - get = function (it) { - return wmget(store, it) || {}; + return store.get(it) || {}; }; - has = function (it) { - return wmhas(store, it); + return store.has(it); }; } else { var STATE = sharedKey('state'); hiddenKeys[STATE] = true; - set = function (it, metadata) { if (hasOwn(it, STATE)) throw TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; createNonEnumerableProperty(it, STATE, metadata); return metadata; }; - get = function (it) { return hasOwn(it, STATE) ? it[STATE] : {}; }; - has = function (it) { return hasOwn(it, STATE); }; } - module.exports = { set: set, get: get, @@ -1936,56 +1508,45 @@ module.exports = { }; /***/ }), -/* 52 */ +/* 53 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4); - var isCallable = __webpack_require__(21); - var WeakMap = global.WeakMap; module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap)); /***/ }), -/* 53 */ +/* 54 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var shared = __webpack_require__(34); - -var uid = __webpack_require__(40); - +var shared = __webpack_require__(35); +var uid = __webpack_require__(41); var keys = shared('keys'); - module.exports = function (key) { return keys[key] || (keys[key] = uid(key)); }; /***/ }), -/* 54 */ +/* 55 */ /***/ ((module) => { module.exports = {}; /***/ }), -/* 55 */ +/* 56 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var hasOwn = __webpack_require__(38); - -var ownKeys = __webpack_require__(56); - +var hasOwn = __webpack_require__(39); +var ownKeys = __webpack_require__(57); var getOwnPropertyDescriptorModule = __webpack_require__(5); - -var definePropertyModule = __webpack_require__(44); - +var definePropertyModule = __webpack_require__(45); module.exports = function (target, source, exceptions) { var keys = ownKeys(source); var defineProperty = definePropertyModule.f; var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; - for (var i = 0; i < keys.length; i++) { var key = keys[i]; - if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) { defineProperty(target, key, getOwnPropertyDescriptor(source, key)); } @@ -1993,21 +1554,17 @@ module.exports = function (target, source, exceptions) { }; /***/ }), -/* 56 */ +/* 57 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var getBuiltIn = __webpack_require__(23); - +var getBuiltIn = __webpack_require__(24); var uncurryThis = __webpack_require__(14); +var getOwnPropertyNamesModule = __webpack_require__(58); +var getOwnPropertySymbolsModule = __webpack_require__(67); +var anObject = __webpack_require__(47); +var concat = uncurryThis([].concat); -var getOwnPropertyNamesModule = __webpack_require__(57); - -var getOwnPropertySymbolsModule = __webpack_require__(66); - -var anObject = __webpack_require__(46); - -var concat = uncurryThis([].concat); // all object keys, includes non-enumerable and symbols - +// all object keys, includes non-enumerable and symbols module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { var keys = getOwnPropertyNamesModule.f(anObject(it)); var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; @@ -2015,83 +1572,71 @@ module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { }; /***/ }), -/* 57 */ +/* 58 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { -var internalObjectKeys = __webpack_require__(58); +var internalObjectKeys = __webpack_require__(59); +var enumBugKeys = __webpack_require__(66); +var hiddenKeys = enumBugKeys.concat('length', 'prototype'); -var enumBugKeys = __webpack_require__(65); - -var hiddenKeys = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method +// `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames -// eslint-disable-next-line es-x/no-object-getownpropertynames -- safe - +// eslint-disable-next-line es/no-object-getownpropertynames -- safe exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return internalObjectKeys(O, hiddenKeys); }; -/***/ }), -/* 58 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var uncurryThis = __webpack_require__(14); - -var hasOwn = __webpack_require__(38); - -var toIndexedObject = __webpack_require__(12); - -var indexOf = (__webpack_require__(59).indexOf); - -var hiddenKeys = __webpack_require__(54); - -var push = uncurryThis([].push); - -module.exports = function (object, names) { - var O = toIndexedObject(object); - var i = 0; - var result = []; - var key; - - for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key); // Don't enum bug & hidden keys - - - while (names.length > i) if (hasOwn(O, key = names[i++])) { - ~indexOf(result, key) || push(result, key); - } - - return result; -}; - /***/ }), /* 59 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { +var uncurryThis = __webpack_require__(14); +var hasOwn = __webpack_require__(39); var toIndexedObject = __webpack_require__(12); +var indexOf = (__webpack_require__(60).indexOf); +var hiddenKeys = __webpack_require__(55); +var push = uncurryThis([].push); +module.exports = function (object, names) { + var O = toIndexedObject(object); + var i = 0; + var result = []; + var key; + for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key); + // Don't enum bug & hidden keys + while (names.length > i) if (hasOwn(O, key = names[i++])) { + ~indexOf(result, key) || push(result, key); + } + return result; +}; -var toAbsoluteIndex = __webpack_require__(60); - -var lengthOfArrayLike = __webpack_require__(63); // `Array.prototype.{ indexOf, includes }` methods implementation +/***/ }), +/* 60 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +var toIndexedObject = __webpack_require__(12); +var toAbsoluteIndex = __webpack_require__(61); +var lengthOfArrayLike = __webpack_require__(64); +// `Array.prototype.{ indexOf, includes }` methods implementation var createMethod = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject($this); var length = lengthOfArrayLike(O); var index = toAbsoluteIndex(fromIndex, length); - var value; // Array#includes uses SameValueZero equality algorithm + var value; + // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare -- NaN check - if (IS_INCLUDES && el != el) while (length > index) { - value = O[index++]; // eslint-disable-next-line no-self-compare -- NaN check - - if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not + value = O[index++]; + // eslint-disable-next-line no-self-compare -- NaN check + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not } else for (; length > index; index++) { if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; - module.exports = { // `Array.prototype.includes` method // https://tc39.es/ecma262/#sec-array.prototype.includes @@ -2102,293 +1647,259 @@ module.exports = { }; /***/ }), -/* 60 */ +/* 61 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var toIntegerOrInfinity = __webpack_require__(61); - +var toIntegerOrInfinity = __webpack_require__(62); var max = Math.max; -var min = Math.min; // Helper for a popular repeating case of the spec: +var min = Math.min; + +// Helper for a popular repeating case of the spec: // Let integer be ? ToInteger(index). // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). - module.exports = function (index, length) { var integer = toIntegerOrInfinity(index); return integer < 0 ? max(integer + length, 0) : min(integer, length); }; /***/ }), -/* 61 */ +/* 62 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var trunc = __webpack_require__(62); // `ToIntegerOrInfinity` abstract operation +var trunc = __webpack_require__(63); + +// `ToIntegerOrInfinity` abstract operation // https://tc39.es/ecma262/#sec-tointegerorinfinity - - module.exports = function (argument) { - var number = +argument; // eslint-disable-next-line no-self-compare -- NaN check - + var number = +argument; + // eslint-disable-next-line no-self-compare -- NaN check return number !== number || number === 0 ? 0 : trunc(number); }; /***/ }), -/* 62 */ +/* 63 */ /***/ ((module) => { var ceil = Math.ceil; -var floor = Math.floor; // `Math.trunc` method -// https://tc39.es/ecma262/#sec-math.trunc -// eslint-disable-next-line es-x/no-math-trunc -- safe +var floor = Math.floor; +// `Math.trunc` method +// https://tc39.es/ecma262/#sec-math.trunc +// eslint-disable-next-line es/no-math-trunc -- safe module.exports = Math.trunc || function trunc(x) { var n = +x; return (n > 0 ? floor : ceil)(n); }; /***/ }), -/* 63 */ +/* 64 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var toLength = __webpack_require__(64); // `LengthOfArrayLike` abstract operation +var toLength = __webpack_require__(65); + +// `LengthOfArrayLike` abstract operation // https://tc39.es/ecma262/#sec-lengthofarraylike - - module.exports = function (obj) { return toLength(obj.length); }; /***/ }), -/* 64 */ +/* 65 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var toIntegerOrInfinity = __webpack_require__(61); +var toIntegerOrInfinity = __webpack_require__(62); +var min = Math.min; -var min = Math.min; // `ToLength` abstract operation +// `ToLength` abstract operation // https://tc39.es/ecma262/#sec-tolength - module.exports = function (argument) { return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; /***/ }), -/* 65 */ +/* 66 */ /***/ ((module) => { // IE8- don't enum bug keys module.exports = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf']; /***/ }), -/* 66 */ +/* 67 */ /***/ ((__unused_webpack_module, exports) => { -// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe +// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe exports.f = Object.getOwnPropertySymbols; /***/ }), -/* 67 */ +/* 68 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fails = __webpack_require__(7); - var isCallable = __webpack_require__(21); - var replacement = /#|\.prototype\./; - var isForced = function (feature, detection) { var value = data[normalize(feature)]; return value == POLYFILL ? true : value == NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection; }; - var normalize = isForced.normalize = function (string) { return String(string).replace(replacement, '.').toLowerCase(); }; - var data = isForced.data = {}; var NATIVE = isForced.NATIVE = 'N'; var POLYFILL = isForced.POLYFILL = 'P'; module.exports = isForced; /***/ }), -/* 68 */ +/* 69 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var classof = __webpack_require__(69); - +var classof = __webpack_require__(70); var $String = String; - module.exports = function (argument) { if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string'); return $String(argument); }; /***/ }), -/* 69 */ +/* 70 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var TO_STRING_TAG_SUPPORT = __webpack_require__(70); - +var TO_STRING_TAG_SUPPORT = __webpack_require__(71); var isCallable = __webpack_require__(21); - var classofRaw = __webpack_require__(15); - -var wellKnownSymbol = __webpack_require__(33); - +var wellKnownSymbol = __webpack_require__(34); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); -var $Object = Object; // ES3 wrong here +var $Object = Object; +// ES3 wrong here var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; -}()) == 'Arguments'; // fallback for IE11 Script Access Denied error +}()) == 'Arguments'; +// fallback for IE11 Script Access Denied error var tryGet = function (it, key) { try { return it[key]; - } catch (error) { - /* empty */ - } -}; // getting tag from ES6+ `Object.prototype.toString` - + } catch (error) {/* empty */} +}; +// getting tag from ES6+ `Object.prototype.toString` module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) { var O, tag, result; - return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case - : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag // builtinTag case - : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag + // builtinTag case + : CORRECT_ARGUMENTS ? classofRaw(O) + // ES3 arguments fallback : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result; }; /***/ }), -/* 70 */ +/* 71 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var wellKnownSymbol = __webpack_require__(33); - +var wellKnownSymbol = __webpack_require__(34); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var test = {}; test[TO_STRING_TAG] = 'z'; module.exports = String(test) === '[object z]'; /***/ }), -/* 71 */ +/* 72 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* global ActiveXObject -- old IE, WSH */ -var anObject = __webpack_require__(46); - -var definePropertiesModule = __webpack_require__(72); - -var enumBugKeys = __webpack_require__(65); - -var hiddenKeys = __webpack_require__(54); - -var html = __webpack_require__(74); - -var documentCreateElement = __webpack_require__(42); - -var sharedKey = __webpack_require__(53); - +var anObject = __webpack_require__(47); +var definePropertiesModule = __webpack_require__(73); +var enumBugKeys = __webpack_require__(66); +var hiddenKeys = __webpack_require__(55); +var html = __webpack_require__(75); +var documentCreateElement = __webpack_require__(43); +var sharedKey = __webpack_require__(54); var GT = '>'; var LT = '<'; var PROTOTYPE = 'prototype'; var SCRIPT = 'script'; var IE_PROTO = sharedKey('IE_PROTO'); - -var EmptyConstructor = function () { - /* empty */ -}; - +var EmptyConstructor = function () {/* empty */}; var scriptTag = function (content) { return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; -}; // Create object with fake `null` prototype: use ActiveX Object with cleared prototype - +}; +// Create object with fake `null` prototype: use ActiveX Object with cleared prototype var NullProtoObjectViaActiveX = function (activeXDocument) { activeXDocument.write(scriptTag('')); activeXDocument.close(); var temp = activeXDocument.parentWindow.Object; activeXDocument = null; // avoid memory leak - return temp; -}; // Create object with fake `null` prototype: use iframe Object with cleared prototype - +}; +// Create object with fake `null` prototype: use iframe Object with cleared prototype var NullProtoObjectViaIFrame = function () { // Thrash, waste and sodomy: IE GC bug var iframe = documentCreateElement('iframe'); var JS = 'java' + SCRIPT + ':'; var iframeDocument; iframe.style.display = 'none'; - html.appendChild(iframe); // https://github.com/zloirock/core-js/issues/475 - + html.appendChild(iframe); + // https://github.com/zloirock/core-js/issues/475 iframe.src = String(JS); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(scriptTag('document.F=Object')); iframeDocument.close(); return iframeDocument.F; -}; // Check for document.domain and active x support +}; + +// Check for document.domain and active x support // No need to use active x approach when document.domain is not set // see https://github.com/es-shims/es5-shim/issues/150 // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 // avoid IE GC bug - - var activeXDocument; - var NullProtoObject = function () { try { activeXDocument = new ActiveXObject('htmlfile'); - } catch (error) { - /* ignore */ - } - + } catch (error) {/* ignore */} NullProtoObject = typeof document != 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) // old IE : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument); // WSH - var length = enumBugKeys.length; - while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; - return NullProtoObject(); }; +hiddenKeys[IE_PROTO] = true; -hiddenKeys[IE_PROTO] = true; // `Object.create` method +// `Object.create` method // https://tc39.es/ecma262/#sec-object.create -// eslint-disable-next-line es-x/no-object-create -- safe - +// eslint-disable-next-line es/no-object-create -- safe module.exports = Object.create || function create(O, Properties) { var result; - if (O !== null) { EmptyConstructor[PROTOTYPE] = anObject(O); result = new EmptyConstructor(); - EmptyConstructor[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill - + EmptyConstructor[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else result = NullProtoObject(); - return Properties === undefined ? result : definePropertiesModule.f(result, Properties); }; /***/ }), -/* 72 */ +/* 73 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(6); - -var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(45); - -var definePropertyModule = __webpack_require__(44); - -var anObject = __webpack_require__(46); - +var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(46); +var definePropertyModule = __webpack_require__(45); +var anObject = __webpack_require__(47); var toIndexedObject = __webpack_require__(12); +var objectKeys = __webpack_require__(74); -var objectKeys = __webpack_require__(73); // `Object.defineProperties` method +// `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties -// eslint-disable-next-line es-x/no-object-defineproperties -- safe - - +// eslint-disable-next-line es/no-object-defineproperties -- safe exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var props = toIndexedObject(Properties); @@ -2396,126 +1907,119 @@ exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : var length = keys.length; var index = 0; var key; - while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]); - return O; }; -/***/ }), -/* 73 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var internalObjectKeys = __webpack_require__(58); - -var enumBugKeys = __webpack_require__(65); // `Object.keys` method -// https://tc39.es/ecma262/#sec-object.keys -// eslint-disable-next-line es-x/no-object-keys -- safe - - -module.exports = Object.keys || function keys(O) { - return internalObjectKeys(O, enumBugKeys); -}; - /***/ }), /* 74 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var getBuiltIn = __webpack_require__(23); +var internalObjectKeys = __webpack_require__(59); +var enumBugKeys = __webpack_require__(66); -module.exports = getBuiltIn('document', 'documentElement'); +// `Object.keys` method +// https://tc39.es/ecma262/#sec-object.keys +// eslint-disable-next-line es/no-object-keys -- safe +module.exports = Object.keys || function keys(O) { + return internalObjectKeys(O, enumBugKeys); +}; /***/ }), /* 75 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -/* eslint-disable es-x/no-object-getownpropertynames -- safe */ +var getBuiltIn = __webpack_require__(24); +module.exports = getBuiltIn('document', 'documentElement'); + +/***/ }), +/* 76 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/* eslint-disable es/no-object-getownpropertynames -- safe */ var classof = __webpack_require__(15); - var toIndexedObject = __webpack_require__(12); - -var $getOwnPropertyNames = (__webpack_require__(57).f); - -var arraySlice = __webpack_require__(76); - +var $getOwnPropertyNames = (__webpack_require__(58).f); +var arraySlice = __webpack_require__(77); var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; - var getWindowNames = function (it) { try { return $getOwnPropertyNames(it); } catch (error) { return arraySlice(windowNames); } -}; // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window - - -module.exports.f = function getOwnPropertyNames(it) { - return windowNames && classof(it) == 'Window' ? getWindowNames(it) : $getOwnPropertyNames(toIndexedObject(it)); }; -/***/ }), -/* 76 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var toAbsoluteIndex = __webpack_require__(60); - -var lengthOfArrayLike = __webpack_require__(63); - -var createProperty = __webpack_require__(77); - -var $Array = Array; -var max = Math.max; - -module.exports = function (O, start, end) { - var length = lengthOfArrayLike(O); - var k = toAbsoluteIndex(start, length); - var fin = toAbsoluteIndex(end === undefined ? length : end, length); - var result = $Array(max(fin - k, 0)); - - for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]); - - result.length = n; - return result; +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +module.exports.f = function getOwnPropertyNames(it) { + return windowNames && classof(it) == 'Window' ? getWindowNames(it) : $getOwnPropertyNames(toIndexedObject(it)); }; /***/ }), /* 77 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { +var toAbsoluteIndex = __webpack_require__(61); +var lengthOfArrayLike = __webpack_require__(64); +var createProperty = __webpack_require__(78); +var $Array = Array; +var max = Math.max; +module.exports = function (O, start, end) { + var length = lengthOfArrayLike(O); + var k = toAbsoluteIndex(start, length); + var fin = toAbsoluteIndex(end === undefined ? length : end, length); + var result = $Array(max(fin - k, 0)); + for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]); + result.length = n; + return result; +}; + +/***/ }), +/* 78 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + "use strict"; var toPropertyKey = __webpack_require__(18); - -var definePropertyModule = __webpack_require__(44); - +var definePropertyModule = __webpack_require__(45); var createPropertyDescriptor = __webpack_require__(11); - module.exports = function (object, key, value) { var propertyKey = toPropertyKey(key); if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));else object[propertyKey] = value; }; -/***/ }), -/* 78 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -var wellKnownSymbol = __webpack_require__(33); - -exports.f = wellKnownSymbol; - /***/ }), /* 79 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var path = __webpack_require__(80); +var makeBuiltIn = __webpack_require__(49); +var defineProperty = __webpack_require__(45); +module.exports = function (target, name, descriptor) { + if (descriptor.get) makeBuiltIn(descriptor.get, name, { + getter: true + }); + if (descriptor.set) makeBuiltIn(descriptor.set, name, { + setter: true + }); + return defineProperty.f(target, name, descriptor); +}; -var hasOwn = __webpack_require__(38); +/***/ }), +/* 80 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { -var wrappedWellKnownSymbolModule = __webpack_require__(78); +var wellKnownSymbol = __webpack_require__(34); +exports.f = wellKnownSymbol; -var defineProperty = (__webpack_require__(44).f); +/***/ }), +/* 81 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { +var path = __webpack_require__(82); +var hasOwn = __webpack_require__(39); +var wrappedWellKnownSymbolModule = __webpack_require__(80); +var defineProperty = (__webpack_require__(45).f); module.exports = function (NAME) { var Symbol = path.Symbol || (path.Symbol = {}); if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, { @@ -2524,31 +2028,25 @@ module.exports = function (NAME) { }; /***/ }), -/* 80 */ +/* 82 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4); - module.exports = global; /***/ }), -/* 81 */ +/* 83 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var call = __webpack_require__(8); - -var getBuiltIn = __webpack_require__(23); - -var wellKnownSymbol = __webpack_require__(33); - -var defineBuiltIn = __webpack_require__(47); - +var getBuiltIn = __webpack_require__(24); +var wellKnownSymbol = __webpack_require__(34); +var defineBuiltIn = __webpack_require__(48); module.exports = function () { var Symbol = getBuiltIn('Symbol'); var SymbolPrototype = Symbol && Symbol.prototype; var valueOf = SymbolPrototype && SymbolPrototype.valueOf; var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); - if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) { // `Symbol.prototype[@@toPrimitive]` method // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive @@ -2562,20 +2060,15 @@ module.exports = function () { }; /***/ }), -/* 82 */ +/* 84 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var defineProperty = (__webpack_require__(44).f); - -var hasOwn = __webpack_require__(38); - -var wellKnownSymbol = __webpack_require__(33); - +var defineProperty = (__webpack_require__(45).f); +var hasOwn = __webpack_require__(39); +var wellKnownSymbol = __webpack_require__(34); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); - module.exports = function (target, TAG, STATIC) { if (target && !STATIC) target = target.prototype; - if (target && !hasOwn(target, TO_STRING_TAG)) { defineProperty(target, TO_STRING_TAG, { configurable: true, @@ -2585,23 +2078,18 @@ module.exports = function (target, TAG, STATIC) { }; /***/ }), -/* 83 */ +/* 85 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var bind = __webpack_require__(84); - +var bind = __webpack_require__(86); var uncurryThis = __webpack_require__(14); - var IndexedObject = __webpack_require__(13); +var toObject = __webpack_require__(40); +var lengthOfArrayLike = __webpack_require__(64); +var arraySpeciesCreate = __webpack_require__(88); +var push = uncurryThis([].push); -var toObject = __webpack_require__(39); - -var lengthOfArrayLike = __webpack_require__(63); - -var arraySpeciesCreate = __webpack_require__(85); - -var push = uncurryThis([].push); // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation - +// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation var createMethod = function (TYPE) { var IS_MAP = TYPE == 1; var IS_FILTER = TYPE == 2; @@ -2619,26 +2107,21 @@ var createMethod = function (TYPE) { var create = specificCreate || arraySpeciesCreate; var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined; var value, result; - for (; length > index; index++) if (NO_HOLES || index in self) { value = self[index]; result = boundFunction(value, index, O); - if (TYPE) { if (IS_MAP) target[index] = result; // map else if (result) switch (TYPE) { case 3: return true; // some - case 5: return value; // find - case 6: return index; // findIndex - case 2: push(target, value); // filter @@ -2646,7 +2129,6 @@ var createMethod = function (TYPE) { case 4: return false; // every - case 7: push(target, value); // filterReject @@ -2657,7 +2139,6 @@ var createMethod = function (TYPE) { return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; }; }; - module.exports = { // `Array.prototype.forEach` method // https://tc39.es/ecma262/#sec-array.prototype.foreach @@ -2686,111 +2167,105 @@ module.exports = { }; /***/ }), -/* 84 */ +/* 86 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var uncurryThis = __webpack_require__(14); - -var aCallable = __webpack_require__(30); - +var uncurryThis = __webpack_require__(87); +var aCallable = __webpack_require__(31); var NATIVE_BIND = __webpack_require__(9); +var bind = uncurryThis(uncurryThis.bind); -var bind = uncurryThis(uncurryThis.bind); // optional / simple context binding - +// optional / simple context binding module.exports = function (fn, that) { aCallable(fn); - return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function - /* ...args */ + return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function /* ...args */ () { return fn.apply(that, arguments); }; }; -/***/ }), -/* 85 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var arraySpeciesConstructor = __webpack_require__(86); // `ArraySpeciesCreate` abstract operation -// https://tc39.es/ecma262/#sec-arrayspeciescreate - - -module.exports = function (originalArray, length) { - return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length); -}; - -/***/ }), -/* 86 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var isArray = __webpack_require__(87); - -var isConstructor = __webpack_require__(88); - -var isObject = __webpack_require__(20); - -var wellKnownSymbol = __webpack_require__(33); - -var SPECIES = wellKnownSymbol('species'); -var $Array = Array; // a part of `ArraySpeciesCreate` abstract operation -// https://tc39.es/ecma262/#sec-arrayspeciescreate - -module.exports = function (originalArray) { - var C; - - if (isArray(originalArray)) { - C = originalArray.constructor; // cross-realm fallback - - if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;else if (isObject(C)) { - C = C[SPECIES]; - if (C === null) C = undefined; - } - } - - return C === undefined ? $Array : C; -}; - /***/ }), /* 87 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var classof = __webpack_require__(15); // `IsArray` abstract operation -// https://tc39.es/ecma262/#sec-isarray -// eslint-disable-next-line es-x/no-array-isarray -- safe - - -module.exports = Array.isArray || function isArray(argument) { - return classof(argument) == 'Array'; +var classofRaw = __webpack_require__(15); +var uncurryThis = __webpack_require__(14); +module.exports = function (fn) { + // Nashorn bug: + // https://github.com/zloirock/core-js/issues/1128 + // https://github.com/zloirock/core-js/issues/1130 + if (classofRaw(fn) === 'Function') return uncurryThis(fn); }; /***/ }), /* 88 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var uncurryThis = __webpack_require__(14); +var arraySpeciesConstructor = __webpack_require__(89); -var fails = __webpack_require__(7); - -var isCallable = __webpack_require__(21); - -var classof = __webpack_require__(69); - -var getBuiltIn = __webpack_require__(23); - -var inspectSource = __webpack_require__(50); - -var noop = function () { - /* empty */ +// `ArraySpeciesCreate` abstract operation +// https://tc39.es/ecma262/#sec-arrayspeciescreate +module.exports = function (originalArray, length) { + return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length); }; +/***/ }), +/* 89 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var isArray = __webpack_require__(90); +var isConstructor = __webpack_require__(91); +var isObject = __webpack_require__(20); +var wellKnownSymbol = __webpack_require__(34); +var SPECIES = wellKnownSymbol('species'); +var $Array = Array; + +// a part of `ArraySpeciesCreate` abstract operation +// https://tc39.es/ecma262/#sec-arrayspeciescreate +module.exports = function (originalArray) { + var C; + if (isArray(originalArray)) { + C = originalArray.constructor; + // cross-realm fallback + if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;else if (isObject(C)) { + C = C[SPECIES]; + if (C === null) C = undefined; + } + } + return C === undefined ? $Array : C; +}; + +/***/ }), +/* 90 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var classof = __webpack_require__(15); + +// `IsArray` abstract operation +// https://tc39.es/ecma262/#sec-isarray +// eslint-disable-next-line es/no-array-isarray -- safe +module.exports = Array.isArray || function isArray(argument) { + return classof(argument) == 'Array'; +}; + +/***/ }), +/* 91 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var uncurryThis = __webpack_require__(14); +var fails = __webpack_require__(7); +var isCallable = __webpack_require__(21); +var classof = __webpack_require__(70); +var getBuiltIn = __webpack_require__(24); +var inspectSource = __webpack_require__(51); +var noop = function () {/* empty */}; var empty = []; var construct = getBuiltIn('Reflect', 'construct'); var constructorRegExp = /^\s*(?:class|function)\b/; var exec = uncurryThis(constructorRegExp.exec); var INCORRECT_TO_STRING = !constructorRegExp.exec(noop); - var isConstructorModern = function isConstructor(argument) { if (!isCallable(argument)) return false; - try { construct(noop, empty, argument); return true; @@ -2798,17 +2273,14 @@ var isConstructorModern = function isConstructor(argument) { return false; } }; - var isConstructorLegacy = function isConstructor(argument) { if (!isCallable(argument)) return false; - switch (classof(argument)) { case 'AsyncFunction': case 'GeneratorFunction': case 'AsyncGeneratorFunction': return false; } - try { // we can't check .prototype since constructors produced by .bind haven't it // `Function#toString` throws on some built-it function in some legacy engines @@ -2818,10 +2290,10 @@ var isConstructorLegacy = function isConstructor(argument) { return true; } }; +isConstructorLegacy.sham = true; -isConstructorLegacy.sham = true; // `IsConstructor` abstract operation +// `IsConstructor` abstract operation // https://tc39.es/ecma262/#sec-isconstructor - module.exports = !construct || fails(function () { var called; return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function () { @@ -2830,25 +2302,20 @@ module.exports = !construct || fails(function () { }) ? isConstructorLegacy : isConstructorModern; /***/ }), -/* 89 */ +/* 92 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - -var getBuiltIn = __webpack_require__(23); - -var hasOwn = __webpack_require__(38); - -var toString = __webpack_require__(68); - -var shared = __webpack_require__(34); - -var NATIVE_SYMBOL_REGISTRY = __webpack_require__(90); - +var getBuiltIn = __webpack_require__(24); +var hasOwn = __webpack_require__(39); +var toString = __webpack_require__(69); +var shared = __webpack_require__(35); +var NATIVE_SYMBOL_REGISTRY = __webpack_require__(93); var StringToSymbolRegistry = shared('string-to-symbol-registry'); -var SymbolToStringRegistry = shared('symbol-to-string-registry'); // `Symbol.for` method -// https://tc39.es/ecma262/#sec-symbol.for +var SymbolToStringRegistry = shared('symbol-to-string-registry'); +// `Symbol.for` method +// https://tc39.es/ecma262/#sec-symbol.for $({ target: 'Symbol', stat: true, @@ -2865,34 +2332,28 @@ $({ }); /***/ }), -/* 90 */ +/* 93 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var NATIVE_SYMBOL = __webpack_require__(26); -/* eslint-disable es-x/no-symbol -- safe */ - +var NATIVE_SYMBOL = __webpack_require__(27); +/* eslint-disable es/no-symbol -- safe */ module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor; /***/ }), -/* 91 */ +/* 94 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var hasOwn = __webpack_require__(39); +var isSymbol = __webpack_require__(23); +var tryToString = __webpack_require__(32); +var shared = __webpack_require__(35); +var NATIVE_SYMBOL_REGISTRY = __webpack_require__(93); +var SymbolToStringRegistry = shared('symbol-to-string-registry'); -var hasOwn = __webpack_require__(38); - -var isSymbol = __webpack_require__(22); - -var tryToString = __webpack_require__(31); - -var shared = __webpack_require__(34); - -var NATIVE_SYMBOL_REGISTRY = __webpack_require__(90); - -var SymbolToStringRegistry = shared('symbol-to-string-registry'); // `Symbol.keyFor` method +// `Symbol.keyFor` method // https://tc39.es/ecma262/#sec-symbol.keyfor - $({ target: 'Symbol', stat: true, @@ -2905,33 +2366,21 @@ $({ }); /***/ }), -/* 92 */ +/* 95 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - -var getBuiltIn = __webpack_require__(23); - -var apply = __webpack_require__(93); - +var getBuiltIn = __webpack_require__(24); +var apply = __webpack_require__(96); var call = __webpack_require__(8); - var uncurryThis = __webpack_require__(14); - var fails = __webpack_require__(7); - -var isArray = __webpack_require__(87); - var isCallable = __webpack_require__(21); - -var isObject = __webpack_require__(20); - -var isSymbol = __webpack_require__(22); - -var arraySlice = __webpack_require__(94); - -var NATIVE_SYMBOL = __webpack_require__(26); - +var isSymbol = __webpack_require__(23); +var arraySlice = __webpack_require__(97); +var getReplacerFunction = __webpack_require__(98); +var NATIVE_SYMBOL = __webpack_require__(27); +var $String = String; var $stringify = getBuiltIn('JSON', 'stringify'); var exec = uncurryThis(/./.exec); var charAt = uncurryThis(''.charAt); @@ -2942,43 +2391,40 @@ var tester = /[\uD800-\uDFFF]/g; var low = /^[\uD800-\uDBFF]$/; var hi = /^[\uDC00-\uDFFF]$/; var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () { - var symbol = getBuiltIn('Symbol')(); // MS Edge converts symbol values to JSON as {} - - return $stringify([symbol]) != '[null]' // WebKit converts symbol values to JSON as null + var symbol = getBuiltIn('Symbol')(); + // MS Edge converts symbol values to JSON as {} + return $stringify([symbol]) != '[null]' + // WebKit converts symbol values to JSON as null || $stringify({ a: symbol - }) != '{}' // V8 throws on boxed symbols + }) != '{}' + // V8 throws on boxed symbols || $stringify(Object(symbol)) != '{}'; -}); // https://github.com/tc39/proposal-well-formed-stringify +}); +// https://github.com/tc39/proposal-well-formed-stringify var ILL_FORMED_UNICODE = fails(function () { return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"' || $stringify('\uDEAD') !== '"\\udead"'; }); - var stringifyWithSymbolsFix = function (it, replacer) { var args = arraySlice(arguments); - var $replacer = replacer; - if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined - - if (!isArray(replacer)) replacer = function (key, value) { - if (isCallable($replacer)) value = call($replacer, this, key, value); + var $replacer = getReplacerFunction(replacer); + if (!isCallable($replacer) && (it === undefined || isSymbol(it))) return; // IE8 returns string on undefined + args[1] = function (key, value) { + // some old implementations (like WebKit) could pass numbers as keys + if (isCallable($replacer)) value = call($replacer, this, $String(key), value); if (!isSymbol(value)) return value; }; - args[1] = replacer; return apply($stringify, null, args); }; - var fixIllFormed = function (match, offset, string) { var prev = charAt(string, offset - 1); var next = charAt(string, offset + 1); - if (exec(low, match) && !exec(hi, next) || exec(hi, match) && !exec(low, prev)) { return '\\u' + numberToString(charCodeAt(match, 0), 16); } - return match; }; - if ($stringify) { // `JSON.stringify` method // https://tc39.es/ecma262/#sec-json.stringify @@ -2998,48 +2444,75 @@ if ($stringify) { } /***/ }), -/* 93 */ +/* 96 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var NATIVE_BIND = __webpack_require__(9); - var FunctionPrototype = Function.prototype; var apply = FunctionPrototype.apply; -var call = FunctionPrototype.call; // eslint-disable-next-line es-x/no-reflect -- safe +var call = FunctionPrototype.call; +// eslint-disable-next-line es/no-reflect -- safe module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () { return call.apply(apply, arguments); }); /***/ }), -/* 94 */ +/* 97 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(14); - module.exports = uncurryThis([].slice); /***/ }), -/* 95 */ +/* 98 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var uncurryThis = __webpack_require__(14); +var isArray = __webpack_require__(90); +var isCallable = __webpack_require__(21); +var classof = __webpack_require__(15); +var toString = __webpack_require__(69); +var push = uncurryThis([].push); +module.exports = function (replacer) { + if (isCallable(replacer)) return replacer; + if (!isArray(replacer)) return; + var rawLength = replacer.length; + var keys = []; + for (var i = 0; i < rawLength; i++) { + var element = replacer[i]; + if (typeof element == 'string') push(keys, element);else if (typeof element == 'number' || classof(element) == 'Number' || classof(element) == 'String') push(keys, toString(element)); + } + var keysLength = keys.length; + var root = true; + return function (key, value) { + if (root) { + root = false; + return value; + } + if (isArray(this)) return value; + for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value; + }; +}; + +/***/ }), +/* 99 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - -var NATIVE_SYMBOL = __webpack_require__(26); - +var NATIVE_SYMBOL = __webpack_require__(27); var fails = __webpack_require__(7); +var getOwnPropertySymbolsModule = __webpack_require__(67); +var toObject = __webpack_require__(40); -var getOwnPropertySymbolsModule = __webpack_require__(66); - -var toObject = __webpack_require__(39); // V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives +// V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives // https://bugs.chromium.org/p/v8/issues/detail?id=3443 - - var FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); -}); // `Object.getOwnPropertySymbols` method -// https://tc39.es/ecma262/#sec-object.getownpropertysymbols +}); +// `Object.getOwnPropertySymbols` method +// https://tc39.es/ecma262/#sec-object.getownpropertysymbols $({ target: 'Object', stat: true, @@ -3052,7 +2525,7 @@ $({ }); /***/ }), -/* 96 */ +/* 100 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -3061,40 +2534,30 @@ $({ var $ = __webpack_require__(3); - var DESCRIPTORS = __webpack_require__(6); - var global = __webpack_require__(4); - var uncurryThis = __webpack_require__(14); - -var hasOwn = __webpack_require__(38); - +var hasOwn = __webpack_require__(39); var isCallable = __webpack_require__(21); - -var isPrototypeOf = __webpack_require__(24); - -var toString = __webpack_require__(68); - -var defineProperty = (__webpack_require__(44).f); - -var copyConstructorProperties = __webpack_require__(55); - +var isPrototypeOf = __webpack_require__(25); +var toString = __webpack_require__(69); +var defineBuiltInAccessor = __webpack_require__(79); +var copyConstructorProperties = __webpack_require__(56); var NativeSymbol = global.Symbol; var SymbolPrototype = NativeSymbol && NativeSymbol.prototype; - -if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) || // Safari 12 bug +if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) || +// Safari 12 bug NativeSymbol().description !== undefined)) { - var EmptyStringDescriptionStore = {}; // wrap Symbol constructor for correct work with undefined description - + var EmptyStringDescriptionStore = {}; + // wrap Symbol constructor for correct work with undefined description var SymbolWrapper = function Symbol() { var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]); - var result = isPrototypeOf(SymbolPrototype, this) ? new NativeSymbol(description) // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)' + var result = isPrototypeOf(SymbolPrototype, this) ? new NativeSymbol(description) + // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)' : description === undefined ? NativeSymbol() : NativeSymbol(description); if (description === '') EmptyStringDescriptionStore[result] = true; return result; }; - copyConstructorProperties(SymbolWrapper, NativeSymbol); SymbolWrapper.prototype = SymbolPrototype; SymbolPrototype.constructor = SymbolWrapper; @@ -3104,7 +2567,7 @@ NativeSymbol().description !== undefined)) { var regexp = /^Symbol\((.*)\)[^)]+$/; var replace = uncurryThis(''.replace); var stringSlice = uncurryThis(''.slice); - defineProperty(SymbolPrototype, 'description', { + defineBuiltInAccessor(SymbolPrototype, 'description', { configurable: true, get: function description() { var symbol = thisSymbolValue(this); @@ -3123,167 +2586,161 @@ NativeSymbol().description !== undefined)) { }); } -/***/ }), -/* 97 */ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -var defineWellKnownSymbol = __webpack_require__(79); // `Symbol.asyncIterator` well-known symbol -// https://tc39.es/ecma262/#sec-symbol.asynciterator - - -defineWellKnownSymbol('asyncIterator'); - -/***/ }), -/* 98 */ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -var defineWellKnownSymbol = __webpack_require__(79); // `Symbol.hasInstance` well-known symbol -// https://tc39.es/ecma262/#sec-symbol.hasinstance - - -defineWellKnownSymbol('hasInstance'); - -/***/ }), -/* 99 */ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -var defineWellKnownSymbol = __webpack_require__(79); // `Symbol.isConcatSpreadable` well-known symbol -// https://tc39.es/ecma262/#sec-symbol.isconcatspreadable - - -defineWellKnownSymbol('isConcatSpreadable'); - -/***/ }), -/* 100 */ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -var defineWellKnownSymbol = __webpack_require__(79); // `Symbol.iterator` well-known symbol -// https://tc39.es/ecma262/#sec-symbol.iterator - - -defineWellKnownSymbol('iterator'); - /***/ }), /* 101 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var defineWellKnownSymbol = __webpack_require__(79); // `Symbol.match` well-known symbol -// https://tc39.es/ecma262/#sec-symbol.match +var defineWellKnownSymbol = __webpack_require__(81); - -defineWellKnownSymbol('match'); +// `Symbol.asyncIterator` well-known symbol +// https://tc39.es/ecma262/#sec-symbol.asynciterator +defineWellKnownSymbol('asyncIterator'); /***/ }), /* 102 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var defineWellKnownSymbol = __webpack_require__(79); // `Symbol.matchAll` well-known symbol -// https://tc39.es/ecma262/#sec-symbol.matchall +var defineWellKnownSymbol = __webpack_require__(81); - -defineWellKnownSymbol('matchAll'); +// `Symbol.hasInstance` well-known symbol +// https://tc39.es/ecma262/#sec-symbol.hasinstance +defineWellKnownSymbol('hasInstance'); /***/ }), /* 103 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var defineWellKnownSymbol = __webpack_require__(79); // `Symbol.replace` well-known symbol -// https://tc39.es/ecma262/#sec-symbol.replace +var defineWellKnownSymbol = __webpack_require__(81); - -defineWellKnownSymbol('replace'); +// `Symbol.isConcatSpreadable` well-known symbol +// https://tc39.es/ecma262/#sec-symbol.isconcatspreadable +defineWellKnownSymbol('isConcatSpreadable'); /***/ }), /* 104 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var defineWellKnownSymbol = __webpack_require__(79); // `Symbol.search` well-known symbol -// https://tc39.es/ecma262/#sec-symbol.search +var defineWellKnownSymbol = __webpack_require__(81); - -defineWellKnownSymbol('search'); +// `Symbol.iterator` well-known symbol +// https://tc39.es/ecma262/#sec-symbol.iterator +defineWellKnownSymbol('iterator'); /***/ }), /* 105 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var defineWellKnownSymbol = __webpack_require__(79); // `Symbol.species` well-known symbol -// https://tc39.es/ecma262/#sec-symbol.species +var defineWellKnownSymbol = __webpack_require__(81); - -defineWellKnownSymbol('species'); +// `Symbol.match` well-known symbol +// https://tc39.es/ecma262/#sec-symbol.match +defineWellKnownSymbol('match'); /***/ }), /* 106 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var defineWellKnownSymbol = __webpack_require__(79); // `Symbol.split` well-known symbol -// https://tc39.es/ecma262/#sec-symbol.split +var defineWellKnownSymbol = __webpack_require__(81); - -defineWellKnownSymbol('split'); +// `Symbol.matchAll` well-known symbol +// https://tc39.es/ecma262/#sec-symbol.matchall +defineWellKnownSymbol('matchAll'); /***/ }), /* 107 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var defineWellKnownSymbol = __webpack_require__(79); +var defineWellKnownSymbol = __webpack_require__(81); -var defineSymbolToPrimitive = __webpack_require__(81); // `Symbol.toPrimitive` well-known symbol -// https://tc39.es/ecma262/#sec-symbol.toprimitive - - -defineWellKnownSymbol('toPrimitive'); // `Symbol.prototype[@@toPrimitive]` method -// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive - -defineSymbolToPrimitive(); +// `Symbol.replace` well-known symbol +// https://tc39.es/ecma262/#sec-symbol.replace +defineWellKnownSymbol('replace'); /***/ }), /* 108 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var getBuiltIn = __webpack_require__(23); +var defineWellKnownSymbol = __webpack_require__(81); -var defineWellKnownSymbol = __webpack_require__(79); - -var setToStringTag = __webpack_require__(82); // `Symbol.toStringTag` well-known symbol -// https://tc39.es/ecma262/#sec-symbol.tostringtag - - -defineWellKnownSymbol('toStringTag'); // `Symbol.prototype[@@toStringTag]` property -// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag - -setToStringTag(getBuiltIn('Symbol'), 'Symbol'); +// `Symbol.search` well-known symbol +// https://tc39.es/ecma262/#sec-symbol.search +defineWellKnownSymbol('search'); /***/ }), /* 109 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var defineWellKnownSymbol = __webpack_require__(79); // `Symbol.unscopables` well-known symbol -// https://tc39.es/ecma262/#sec-symbol.unscopables +var defineWellKnownSymbol = __webpack_require__(81); - -defineWellKnownSymbol('unscopables'); +// `Symbol.species` well-known symbol +// https://tc39.es/ecma262/#sec-symbol.species +defineWellKnownSymbol('species'); /***/ }), /* 110 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { +var defineWellKnownSymbol = __webpack_require__(81); + +// `Symbol.split` well-known symbol +// https://tc39.es/ecma262/#sec-symbol.split +defineWellKnownSymbol('split'); + +/***/ }), +/* 111 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var defineWellKnownSymbol = __webpack_require__(81); +var defineSymbolToPrimitive = __webpack_require__(83); + +// `Symbol.toPrimitive` well-known symbol +// https://tc39.es/ecma262/#sec-symbol.toprimitive +defineWellKnownSymbol('toPrimitive'); + +// `Symbol.prototype[@@toPrimitive]` method +// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive +defineSymbolToPrimitive(); + +/***/ }), +/* 112 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var getBuiltIn = __webpack_require__(24); +var defineWellKnownSymbol = __webpack_require__(81); +var setToStringTag = __webpack_require__(84); + +// `Symbol.toStringTag` well-known symbol +// https://tc39.es/ecma262/#sec-symbol.tostringtag +defineWellKnownSymbol('toStringTag'); + +// `Symbol.prototype[@@toStringTag]` property +// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag +setToStringTag(getBuiltIn('Symbol'), 'Symbol'); + +/***/ }), +/* 113 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var defineWellKnownSymbol = __webpack_require__(81); + +// `Symbol.unscopables` well-known symbol +// https://tc39.es/ecma262/#sec-symbol.unscopables +defineWellKnownSymbol('unscopables'); + +/***/ }), +/* 114 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + /* eslint-disable no-unused-vars -- required for functions `.length` */ var $ = __webpack_require__(3); - var global = __webpack_require__(4); - -var apply = __webpack_require__(93); - -var wrapErrorConstructorWithCause = __webpack_require__(111); - +var apply = __webpack_require__(96); +var wrapErrorConstructorWithCause = __webpack_require__(115); var WEB_ASSEMBLY = 'WebAssembly'; var WebAssembly = global[WEB_ASSEMBLY]; var FORCED = Error('e', { cause: 7 }).cause !== 7; - var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) { var O = {}; O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED); @@ -3294,7 +2751,6 @@ var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) { forced: FORCED }, O); }; - var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) { if (WebAssembly && WebAssembly[ERROR_NAME]) { var O = {}; @@ -3307,9 +2763,10 @@ var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) { forced: FORCED }, O); } -}; // https://github.com/tc39/proposal-error-cause - +}; +// https://tc39.es/ecma262/#sec-nativeerror +// https://github.com/tc39/proposal-error-cause exportGlobalErrorCauseWrapper('Error', function (init) { return function Error(message) { return apply(init, this, arguments); @@ -3362,40 +2819,25 @@ exportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) { }); /***/ }), -/* 111 */ +/* 115 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var getBuiltIn = __webpack_require__(23); - -var hasOwn = __webpack_require__(38); - -var createNonEnumerableProperty = __webpack_require__(43); - -var isPrototypeOf = __webpack_require__(24); - -var setPrototypeOf = __webpack_require__(112); - -var copyConstructorProperties = __webpack_require__(55); - -var proxyAccessor = __webpack_require__(114); - -var inheritIfRequired = __webpack_require__(115); - -var normalizeStringArgument = __webpack_require__(116); - -var installErrorCause = __webpack_require__(117); - -var clearErrorStack = __webpack_require__(118); - -var ERROR_STACK_INSTALLABLE = __webpack_require__(119); - +var getBuiltIn = __webpack_require__(24); +var hasOwn = __webpack_require__(39); +var createNonEnumerableProperty = __webpack_require__(44); +var isPrototypeOf = __webpack_require__(25); +var setPrototypeOf = __webpack_require__(116); +var copyConstructorProperties = __webpack_require__(56); +var proxyAccessor = __webpack_require__(119); +var inheritIfRequired = __webpack_require__(120); +var normalizeStringArgument = __webpack_require__(121); +var installErrorCause = __webpack_require__(122); +var installErrorStack = __webpack_require__(123); var DESCRIPTORS = __webpack_require__(6); - -var IS_PURE = __webpack_require__(35); - +var IS_PURE = __webpack_require__(36); module.exports = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) { var STACK_TRACE_LIMIT = 'stackTraceLimit'; var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1; @@ -3403,8 +2845,9 @@ module.exports = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) { var ERROR_NAME = path[path.length - 1]; var OriginalError = getBuiltIn.apply(null, path); if (!OriginalError) return; - var OriginalErrorPrototype = OriginalError.prototype; // V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006 + var OriginalErrorPrototype = OriginalError.prototype; + // V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006 if (!IS_PURE && hasOwn(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause; if (!FORCED) return OriginalError; var BaseError = getBuiltIn('Error'); @@ -3412,13 +2855,12 @@ module.exports = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) { var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined); var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError(); if (message !== undefined) createNonEnumerableProperty(result, 'message', message); - if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(result, 'stack', clearErrorStack(result.stack, 2)); + installErrorStack(result, WrappedError, result.stack, 2); if (this && isPrototypeOf(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError); if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]); return result; }); WrappedError.prototype = OriginalErrorPrototype; - if (ERROR_NAME !== 'Error') { if (setPrototypeOf) setPrototypeOf(WrappedError, BaseError);else copyConstructorProperties(WrappedError, BaseError, { name: true @@ -3427,50 +2869,39 @@ module.exports = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) { proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT); proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace'); } - copyConstructorProperties(WrappedError, OriginalError); if (!IS_PURE) try { // Safari 13- bug: WebAssembly errors does not have a proper `.name` if (OriginalErrorPrototype.name !== ERROR_NAME) { createNonEnumerableProperty(OriginalErrorPrototype, 'name', ERROR_NAME); } - OriginalErrorPrototype.constructor = WrappedError; - } catch (error) { - /* empty */ - } + } catch (error) {/* empty */} return WrappedError; }; /***/ }), -/* 112 */ +/* 116 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint-disable no-proto -- safe */ -var uncurryThis = __webpack_require__(14); +var uncurryThisAccessor = __webpack_require__(117); +var anObject = __webpack_require__(47); +var aPossiblePrototype = __webpack_require__(118); -var anObject = __webpack_require__(46); - -var aPossiblePrototype = __webpack_require__(113); // `Object.setPrototypeOf` method +// `Object.setPrototypeOf` method // https://tc39.es/ecma262/#sec-object.setprototypeof // Works with __proto__ only. Old v8 can't work with null proto objects. -// eslint-disable-next-line es-x/no-object-setprototypeof -- safe - - +// eslint-disable-next-line es/no-object-setprototypeof -- safe module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { var CORRECT_SETTER = false; var test = {}; var setter; - try { - // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe - setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set); + setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set'); setter(test, []); CORRECT_SETTER = test instanceof Array; - } catch (error) { - /* empty */ - } - + } catch (error) {/* empty */} return function setPrototypeOf(O, proto) { anObject(O); aPossiblePrototype(proto); @@ -3480,25 +2911,35 @@ module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { }() : undefined); /***/ }), -/* 113 */ +/* 117 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var uncurryThis = __webpack_require__(14); +var aCallable = __webpack_require__(31); +module.exports = function (object, key, method) { + try { + // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe + return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method])); + } catch (error) {/* empty */} +}; + +/***/ }), +/* 118 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isCallable = __webpack_require__(21); - var $String = String; var $TypeError = TypeError; - module.exports = function (argument) { if (typeof argument == 'object' || isCallable(argument)) return argument; throw $TypeError("Can't set " + $String(argument) + ' as a prototype'); }; /***/ }), -/* 114 */ +/* 119 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var defineProperty = (__webpack_require__(44).f); - +var defineProperty = (__webpack_require__(45).f); module.exports = function (Target, Source, key) { key in Target || defineProperty(Target, key, { configurable: true, @@ -3512,44 +2953,42 @@ module.exports = function (Target, Source, key) { }; /***/ }), -/* 115 */ +/* 120 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isCallable = __webpack_require__(21); - var isObject = __webpack_require__(20); +var setPrototypeOf = __webpack_require__(116); -var setPrototypeOf = __webpack_require__(112); // makes subclassing work correct for wrapped built-ins - - +// makes subclassing work correct for wrapped built-ins module.exports = function ($this, dummy, Wrapper) { var NewTarget, NewTargetPrototype; - if ( // it can work only with native `setPrototypeOf` - setPrototypeOf && // we haven't completely correct pre-ES6 way for getting `new.target`, so use this + if ( + // it can work only with native `setPrototypeOf` + setPrototypeOf && + // we haven't completely correct pre-ES6 way for getting `new.target`, so use this isCallable(NewTarget = dummy.constructor) && NewTarget !== Wrapper && isObject(NewTargetPrototype = NewTarget.prototype) && NewTargetPrototype !== Wrapper.prototype) setPrototypeOf($this, NewTargetPrototype); return $this; }; /***/ }), -/* 116 */ +/* 121 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var toString = __webpack_require__(68); - +var toString = __webpack_require__(69); module.exports = function (argument, $default) { return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument); }; /***/ }), -/* 117 */ +/* 122 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isObject = __webpack_require__(20); +var createNonEnumerableProperty = __webpack_require__(44); -var createNonEnumerableProperty = __webpack_require__(43); // `InstallErrorCause` abstract operation +// `InstallErrorCause` abstract operation // https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause - - module.exports = function (O, options) { if (isObject(options) && 'cause' in options) { createNonEnumerableProperty(O, 'cause', options.cause); @@ -3557,95 +2996,99 @@ module.exports = function (O, options) { }; /***/ }), -/* 118 */ +/* 123 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var createNonEnumerableProperty = __webpack_require__(44); +var clearErrorStack = __webpack_require__(124); +var ERROR_STACK_INSTALLABLE = __webpack_require__(125); + +// non-standard V8 +var captureStackTrace = Error.captureStackTrace; +module.exports = function (error, C, stack, dropEntries) { + if (ERROR_STACK_INSTALLABLE) { + if (captureStackTrace) captureStackTrace(error, C);else createNonEnumerableProperty(error, 'stack', clearErrorStack(stack, dropEntries)); + } +}; + +/***/ }), +/* 124 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(14); - var $Error = Error; var replace = uncurryThis(''.replace); - var TEST = function (arg) { return String($Error(arg).stack); }('zxcasd'); - +// eslint-disable-next-line redos/no-vulnerable -- safe var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/; var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST); - module.exports = function (stack, dropEntries) { if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) { while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, ''); } - return stack; }; /***/ }), -/* 119 */ +/* 125 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fails = __webpack_require__(7); - var createPropertyDescriptor = __webpack_require__(11); - module.exports = !fails(function () { var error = Error('a'); - if (!('stack' in error)) return true; // eslint-disable-next-line es-x/no-object-defineproperty -- safe - + if (!('stack' in error)) return true; + // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7)); return error.stack !== 7; }); /***/ }), -/* 120 */ +/* 126 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var defineBuiltIn = __webpack_require__(47); +var defineBuiltIn = __webpack_require__(48); +var errorToString = __webpack_require__(127); +var ErrorPrototype = Error.prototype; -var errorToString = __webpack_require__(121); - -var ErrorPrototype = Error.prototype; // `Error.prototype.toString` method fix +// `Error.prototype.toString` method fix // https://tc39.es/ecma262/#sec-error.prototype.tostring - if (ErrorPrototype.toString !== errorToString) { defineBuiltIn(ErrorPrototype, 'toString', errorToString); } /***/ }), -/* 121 */ +/* 127 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var DESCRIPTORS = __webpack_require__(6); - var fails = __webpack_require__(7); - -var anObject = __webpack_require__(46); - -var create = __webpack_require__(71); - -var normalizeStringArgument = __webpack_require__(116); - +var anObject = __webpack_require__(47); +var create = __webpack_require__(72); +var normalizeStringArgument = __webpack_require__(121); var nativeErrorToString = Error.prototype.toString; var INCORRECT_TO_STRING = fails(function () { if (DESCRIPTORS) { // Chrome 32- incorrectly call accessor - // eslint-disable-next-line es-x/no-object-defineproperty -- safe + // eslint-disable-next-line es/no-object-defineproperty -- safe var object = create(Object.defineProperty({}, 'name', { get: function () { return this === object; } })); if (nativeErrorToString.call(object) !== 'true') return true; - } // FF10- does not properly handle non-strings - - + } + // FF10- does not properly handle non-strings return nativeErrorToString.call({ message: 1, name: 2 - }) !== '2: 1' // IE8 does not properly handle defaults + }) !== '2: 1' + // IE8 does not properly handle defaults || nativeErrorToString.call({}) !== 'Error'; }); module.exports = INCORRECT_TO_STRING ? function toString() { @@ -3656,68 +3099,47 @@ module.exports = INCORRECT_TO_STRING ? function toString() { } : nativeErrorToString; /***/ }), -/* 122 */ +/* 128 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove this module from `core-js@4` since it's replaced to module below -__webpack_require__(123); +__webpack_require__(129); /***/ }), -/* 123 */ +/* 129 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - -var isPrototypeOf = __webpack_require__(24); - -var getPrototypeOf = __webpack_require__(124); - -var setPrototypeOf = __webpack_require__(112); - -var copyConstructorProperties = __webpack_require__(55); - -var create = __webpack_require__(71); - -var createNonEnumerableProperty = __webpack_require__(43); - +var isPrototypeOf = __webpack_require__(25); +var getPrototypeOf = __webpack_require__(130); +var setPrototypeOf = __webpack_require__(116); +var copyConstructorProperties = __webpack_require__(56); +var create = __webpack_require__(72); +var createNonEnumerableProperty = __webpack_require__(44); var createPropertyDescriptor = __webpack_require__(11); - -var clearErrorStack = __webpack_require__(118); - -var installErrorCause = __webpack_require__(117); - -var iterate = __webpack_require__(126); - -var normalizeStringArgument = __webpack_require__(116); - -var wellKnownSymbol = __webpack_require__(33); - -var ERROR_STACK_INSTALLABLE = __webpack_require__(119); - +var installErrorCause = __webpack_require__(122); +var installErrorStack = __webpack_require__(123); +var iterate = __webpack_require__(132); +var normalizeStringArgument = __webpack_require__(121); +var wellKnownSymbol = __webpack_require__(34); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var $Error = Error; var push = [].push; - -var $AggregateError = function AggregateError(errors, message -/* , options */ -) { - var options = arguments.length > 2 ? arguments[2] : undefined; +var $AggregateError = function AggregateError(errors, message /* , options */) { var isInstance = isPrototypeOf(AggregateErrorPrototype, this); var that; - if (setPrototypeOf) { that = setPrototypeOf($Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype); } else { that = isInstance ? this : create(AggregateErrorPrototype); createNonEnumerableProperty(that, TO_STRING_TAG, 'Error'); } - if (message !== undefined) createNonEnumerableProperty(that, 'message', normalizeStringArgument(message)); - if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(that, 'stack', clearErrorStack(that.stack, 1)); - installErrorCause(that, options); + installErrorStack(that, $AggregateError, that.stack, 1); + if (arguments.length > 2) installErrorCause(that, arguments[2]); var errorsArray = []; iterate(errors, push, { that: errorsArray @@ -3725,7 +3147,6 @@ var $AggregateError = function AggregateError(errors, message createNonEnumerableProperty(that, 'errors', errorsArray); return that; }; - if (setPrototypeOf) setPrototypeOf($AggregateError, $Error);else copyConstructorProperties($AggregateError, $Error, { name: true }); @@ -3733,9 +3154,10 @@ var AggregateErrorPrototype = $AggregateError.prototype = create($Error.prototyp constructor: createPropertyDescriptor(1, $AggregateError), message: createPropertyDescriptor(1, ''), name: createPropertyDescriptor(1, 'AggregateError') -}); // `AggregateError` constructor -// https://tc39.es/ecma262/#sec-aggregate-error-constructor +}); +// `AggregateError` constructor +// https://tc39.es/ecma262/#sec-aggregate-error-constructor $({ global: true, constructor: true, @@ -3745,86 +3167,63 @@ $({ }); /***/ }), -/* 124 */ +/* 130 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var hasOwn = __webpack_require__(38); - +var hasOwn = __webpack_require__(39); var isCallable = __webpack_require__(21); - -var toObject = __webpack_require__(39); - -var sharedKey = __webpack_require__(53); - -var CORRECT_PROTOTYPE_GETTER = __webpack_require__(125); - +var toObject = __webpack_require__(40); +var sharedKey = __webpack_require__(54); +var CORRECT_PROTOTYPE_GETTER = __webpack_require__(131); var IE_PROTO = sharedKey('IE_PROTO'); var $Object = Object; -var ObjectPrototype = $Object.prototype; // `Object.getPrototypeOf` method -// https://tc39.es/ecma262/#sec-object.getprototypeof -// eslint-disable-next-line es-x/no-object-getprototypeof -- safe +var ObjectPrototype = $Object.prototype; +// `Object.getPrototypeOf` method +// https://tc39.es/ecma262/#sec-object.getprototypeof +// eslint-disable-next-line es/no-object-getprototypeof -- safe module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) { var object = toObject(O); if (hasOwn(object, IE_PROTO)) return object[IE_PROTO]; var constructor = object.constructor; - if (isCallable(constructor) && object instanceof constructor) { return constructor.prototype; } - return object instanceof $Object ? ObjectPrototype : null; }; /***/ }), -/* 125 */ +/* 131 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fails = __webpack_require__(7); - module.exports = !fails(function () { - function F() { - /* empty */ - } - - F.prototype.constructor = null; // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing - + function F() {/* empty */} + F.prototype.constructor = null; + // eslint-disable-next-line es/no-object-getprototypeof -- required for testing return Object.getPrototypeOf(new F()) !== F.prototype; }); /***/ }), -/* 126 */ +/* 132 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var bind = __webpack_require__(84); - +var bind = __webpack_require__(86); var call = __webpack_require__(8); - -var anObject = __webpack_require__(46); - -var tryToString = __webpack_require__(31); - -var isArrayIteratorMethod = __webpack_require__(127); - -var lengthOfArrayLike = __webpack_require__(63); - -var isPrototypeOf = __webpack_require__(24); - -var getIterator = __webpack_require__(129); - -var getIteratorMethod = __webpack_require__(130); - -var iteratorClose = __webpack_require__(131); - +var anObject = __webpack_require__(47); +var tryToString = __webpack_require__(32); +var isArrayIteratorMethod = __webpack_require__(133); +var lengthOfArrayLike = __webpack_require__(64); +var isPrototypeOf = __webpack_require__(25); +var getIterator = __webpack_require__(135); +var getIteratorMethod = __webpack_require__(136); +var iteratorClose = __webpack_require__(137); var $TypeError = TypeError; - var Result = function (stopped, result) { this.stopped = stopped; this.result = result; }; - var ResultPrototype = Result.prototype; - module.exports = function (iterable, unboundFunction, options) { var that = options && options.that; var AS_ENTRIES = !!(options && options.AS_ENTRIES); @@ -3833,93 +3232,76 @@ module.exports = function (iterable, unboundFunction, options) { var INTERRUPTED = !!(options && options.INTERRUPTED); var fn = bind(unboundFunction, that); var iterator, iterFn, index, length, result, next, step; - var stop = function (condition) { if (iterator) iteratorClose(iterator, 'normal', condition); return new Result(true, condition); }; - var callFn = function (value) { if (AS_ENTRIES) { anObject(value); return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]); } - return INTERRUPTED ? fn(value, stop) : fn(value); }; - if (IS_RECORD) { iterator = iterable.iterator; } else if (IS_ITERATOR) { iterator = iterable; } else { iterFn = getIteratorMethod(iterable); - if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable'); // optimisation for array iterators - + if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable'); + // optimisation for array iterators if (isArrayIteratorMethod(iterFn)) { for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) { result = callFn(iterable[index]); if (result && isPrototypeOf(ResultPrototype, result)) return result; } - return new Result(false); } - iterator = getIterator(iterable, iterFn); } - next = IS_RECORD ? iterable.next : iterator.next; - while (!(step = call(next, iterator)).done) { try { result = callFn(step.value); } catch (error) { iteratorClose(iterator, 'throw', error); } - if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result; } - return new Result(false); }; /***/ }), -/* 127 */ +/* 133 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var wellKnownSymbol = __webpack_require__(33); - -var Iterators = __webpack_require__(128); - +var wellKnownSymbol = __webpack_require__(34); +var Iterators = __webpack_require__(134); var ITERATOR = wellKnownSymbol('iterator'); -var ArrayPrototype = Array.prototype; // check on default Array iterator +var ArrayPrototype = Array.prototype; +// check on default Array iterator module.exports = function (it) { return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); }; /***/ }), -/* 128 */ +/* 134 */ /***/ ((module) => { module.exports = {}; /***/ }), -/* 129 */ +/* 135 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var call = __webpack_require__(8); - -var aCallable = __webpack_require__(30); - -var anObject = __webpack_require__(46); - -var tryToString = __webpack_require__(31); - -var getIteratorMethod = __webpack_require__(130); - +var aCallable = __webpack_require__(31); +var anObject = __webpack_require__(47); +var tryToString = __webpack_require__(32); +var getIteratorMethod = __webpack_require__(136); var $TypeError = TypeError; - module.exports = function (argument, usingIterator) { var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator; if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument)); @@ -3927,53 +3309,40 @@ module.exports = function (argument, usingIterator) { }; /***/ }), -/* 130 */ +/* 136 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var classof = __webpack_require__(69); - -var getMethod = __webpack_require__(29); - +var classof = __webpack_require__(70); +var getMethod = __webpack_require__(30); var isNullOrUndefined = __webpack_require__(17); - -var Iterators = __webpack_require__(128); - -var wellKnownSymbol = __webpack_require__(33); - +var Iterators = __webpack_require__(134); +var wellKnownSymbol = __webpack_require__(34); var ITERATOR = wellKnownSymbol('iterator'); - module.exports = function (it) { if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR) || getMethod(it, '@@iterator') || Iterators[classof(it)]; }; /***/ }), -/* 131 */ +/* 137 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var call = __webpack_require__(8); - -var anObject = __webpack_require__(46); - -var getMethod = __webpack_require__(29); - +var anObject = __webpack_require__(47); +var getMethod = __webpack_require__(30); module.exports = function (iterator, kind, value) { var innerResult, innerError; anObject(iterator); - try { innerResult = getMethod(iterator, 'return'); - if (!innerResult) { if (kind === 'throw') throw value; return value; } - innerResult = call(innerResult, iterator); } catch (error) { innerError = true; innerResult = error; } - if (kind === 'throw') throw value; if (innerError) throw innerResult; anObject(innerResult); @@ -3981,19 +3350,14 @@ module.exports = function (iterator, kind, value) { }; /***/ }), -/* 132 */ +/* 138 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - -var getBuiltIn = __webpack_require__(23); - -var apply = __webpack_require__(93); - +var getBuiltIn = __webpack_require__(24); +var apply = __webpack_require__(96); var fails = __webpack_require__(7); - -var wrapErrorConstructorWithCause = __webpack_require__(111); - +var wrapErrorConstructorWithCause = __webpack_require__(115); var AGGREGATE_ERROR = 'AggregateError'; var $AggregateError = getBuiltIn(AGGREGATE_ERROR); var FORCED = !fails(function () { @@ -4002,8 +3366,9 @@ var FORCED = !fails(function () { return $AggregateError([1], AGGREGATE_ERROR, { cause: 7 }).cause !== 7; -}); // https://github.com/tc39/proposal-error-cause +}); +// https://github.com/tc39/proposal-error-cause $({ global: true, constructor: true, @@ -4019,24 +3384,20 @@ $({ }); /***/ }), -/* 133 */ +/* 139 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var toObject = __webpack_require__(40); +var lengthOfArrayLike = __webpack_require__(64); +var toIntegerOrInfinity = __webpack_require__(62); +var addToUnscopables = __webpack_require__(140); -var toObject = __webpack_require__(39); - -var lengthOfArrayLike = __webpack_require__(63); - -var toIntegerOrInfinity = __webpack_require__(61); - -var addToUnscopables = __webpack_require__(134); // `Array.prototype.at` method +// `Array.prototype.at` method // https://github.com/tc39/proposal-relative-indexing-method - - $({ target: 'Array', proto: true @@ -4052,83 +3413,68 @@ $({ addToUnscopables('at'); /***/ }), -/* 134 */ +/* 140 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var wellKnownSymbol = __webpack_require__(33); - -var create = __webpack_require__(71); - -var defineProperty = (__webpack_require__(44).f); - +var wellKnownSymbol = __webpack_require__(34); +var create = __webpack_require__(72); +var defineProperty = (__webpack_require__(45).f); var UNSCOPABLES = wellKnownSymbol('unscopables'); -var ArrayPrototype = Array.prototype; // Array.prototype[@@unscopables] -// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +var ArrayPrototype = Array.prototype; +// Array.prototype[@@unscopables] +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables if (ArrayPrototype[UNSCOPABLES] == undefined) { defineProperty(ArrayPrototype, UNSCOPABLES, { configurable: true, value: create(null) }); -} // add a key to Array.prototype[@@unscopables] - +} +// add a key to Array.prototype[@@unscopables] module.exports = function (key) { ArrayPrototype[UNSCOPABLES][key] = true; }; /***/ }), -/* 135 */ +/* 141 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var fails = __webpack_require__(7); - -var isArray = __webpack_require__(87); - +var isArray = __webpack_require__(90); var isObject = __webpack_require__(20); +var toObject = __webpack_require__(40); +var lengthOfArrayLike = __webpack_require__(64); +var doesNotExceedSafeInteger = __webpack_require__(142); +var createProperty = __webpack_require__(78); +var arraySpeciesCreate = __webpack_require__(88); +var arrayMethodHasSpeciesSupport = __webpack_require__(143); +var wellKnownSymbol = __webpack_require__(34); +var V8_VERSION = __webpack_require__(28); +var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable'); -var toObject = __webpack_require__(39); - -var lengthOfArrayLike = __webpack_require__(63); - -var doesNotExceedSafeInteger = __webpack_require__(136); - -var createProperty = __webpack_require__(77); - -var arraySpeciesCreate = __webpack_require__(85); - -var arrayMethodHasSpeciesSupport = __webpack_require__(137); - -var wellKnownSymbol = __webpack_require__(33); - -var V8_VERSION = __webpack_require__(27); - -var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable'); // We can't use this feature detection in V8 since it causes +// We can't use this feature detection in V8 since it causes // deoptimization and serious performance degradation // https://github.com/zloirock/core-js/issues/679 - var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () { var array = []; array[IS_CONCAT_SPREADABLE] = false; return array.concat()[0] !== array; }); -var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat'); - var isConcatSpreadable = function (O) { if (!isObject(O)) return false; var spreadable = O[IS_CONCAT_SPREADABLE]; return spreadable !== undefined ? !!spreadable : isArray(O); }; +var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport('concat'); -var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT; // `Array.prototype.concat` method +// `Array.prototype.concat` method // https://tc39.es/ecma262/#sec-array.prototype.concat // with adding support of @@isConcatSpreadable and @@species - $({ target: 'Array', proto: true, @@ -4141,28 +3487,24 @@ $({ var A = arraySpeciesCreate(O, 0); var n = 0; var i, k, length, len, E; - for (i = -1, length = arguments.length; i < length; i++) { E = i === -1 ? O : arguments[i]; - if (isConcatSpreadable(E)) { len = lengthOfArrayLike(E); doesNotExceedSafeInteger(n + len); - for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]); } else { doesNotExceedSafeInteger(n + 1); createProperty(A, n++, E); } } - A.length = n; return A; } }); /***/ }), -/* 136 */ +/* 142 */ /***/ ((module) => { var $TypeError = TypeError; @@ -4174,17 +3516,13 @@ module.exports = function (it) { }; /***/ }), -/* 137 */ +/* 143 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fails = __webpack_require__(7); - -var wellKnownSymbol = __webpack_require__(33); - -var V8_VERSION = __webpack_require__(27); - +var wellKnownSymbol = __webpack_require__(34); +var V8_VERSION = __webpack_require__(28); var SPECIES = wellKnownSymbol('species'); - module.exports = function (METHOD_NAME) { // We can't use this feature detection in V8 since it causes // deoptimization and serious performance degradation @@ -4192,62 +3530,52 @@ module.exports = function (METHOD_NAME) { return V8_VERSION >= 51 || !fails(function () { var array = []; var constructor = array.constructor = {}; - constructor[SPECIES] = function () { return { foo: 1 }; }; - return array[METHOD_NAME](Boolean).foo !== 1; }); }; /***/ }), -/* 138 */ +/* 144 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var copyWithin = __webpack_require__(145); +var addToUnscopables = __webpack_require__(140); -var copyWithin = __webpack_require__(139); - -var addToUnscopables = __webpack_require__(134); // `Array.prototype.copyWithin` method +// `Array.prototype.copyWithin` method // https://tc39.es/ecma262/#sec-array.prototype.copywithin - - $({ target: 'Array', proto: true }, { copyWithin: copyWithin -}); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +}); +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('copyWithin'); /***/ }), -/* 139 */ +/* 145 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var toObject = __webpack_require__(39); +var toObject = __webpack_require__(40); +var toAbsoluteIndex = __webpack_require__(61); +var lengthOfArrayLike = __webpack_require__(64); +var deletePropertyOrThrow = __webpack_require__(146); +var min = Math.min; -var toAbsoluteIndex = __webpack_require__(60); - -var lengthOfArrayLike = __webpack_require__(63); - -var deletePropertyOrThrow = __webpack_require__(140); - -var min = Math.min; // `Array.prototype.copyWithin` method implementation +// `Array.prototype.copyWithin` method implementation // https://tc39.es/ecma262/#sec-array.prototype.copywithin -// eslint-disable-next-line es-x/no-array-prototype-copywithin -- safe - -module.exports = [].copyWithin || function copyWithin(target -/* = 0 */ -, start -/* = 0, end = @length */ -) { +// eslint-disable-next-line es/no-array-prototype-copywithin -- safe +module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { var O = toObject(this); var len = lengthOfArrayLike(O); var to = toAbsoluteIndex(target, len); @@ -4255,74 +3583,64 @@ module.exports = [].copyWithin || function copyWithin(target var end = arguments.length > 2 ? arguments[2] : undefined; var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); var inc = 1; - if (from < to && to < from + count) { inc = -1; from += count - 1; to += count - 1; } - while (count-- > 0) { if (from in O) O[to] = O[from];else deletePropertyOrThrow(O, to); to += inc; from += inc; } - return O; }; /***/ }), -/* 140 */ +/* 146 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var tryToString = __webpack_require__(31); - +var tryToString = __webpack_require__(32); var $TypeError = TypeError; - module.exports = function (O, P) { if (!delete O[P]) throw $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O)); }; /***/ }), -/* 141 */ +/* 147 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var $every = (__webpack_require__(85).every); +var arrayMethodIsStrict = __webpack_require__(148); +var STRICT_METHOD = arrayMethodIsStrict('every'); -var $every = (__webpack_require__(83).every); - -var arrayMethodIsStrict = __webpack_require__(142); - -var STRICT_METHOD = arrayMethodIsStrict('every'); // `Array.prototype.every` method +// `Array.prototype.every` method // https://tc39.es/ecma262/#sec-array.prototype.every - $({ target: 'Array', proto: true, forced: !STRICT_METHOD }, { - every: function every(callbackfn - /* , thisArg */ - ) { + every: function every(callbackfn /* , thisArg */) { return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); /***/ }), -/* 142 */ +/* 148 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var fails = __webpack_require__(7); - module.exports = function (METHOD_NAME, argument) { var method = [][METHOD_NAME]; return !!method && fails(function () { @@ -4334,195 +3652,175 @@ module.exports = function (METHOD_NAME, argument) { }; /***/ }), -/* 143 */ +/* 149 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var fill = __webpack_require__(150); +var addToUnscopables = __webpack_require__(140); -var fill = __webpack_require__(144); - -var addToUnscopables = __webpack_require__(134); // `Array.prototype.fill` method +// `Array.prototype.fill` method // https://tc39.es/ecma262/#sec-array.prototype.fill - - $({ target: 'Array', proto: true }, { fill: fill -}); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +}); +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('fill'); /***/ }), -/* 144 */ +/* 150 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var toObject = __webpack_require__(39); +var toObject = __webpack_require__(40); +var toAbsoluteIndex = __webpack_require__(61); +var lengthOfArrayLike = __webpack_require__(64); -var toAbsoluteIndex = __webpack_require__(60); - -var lengthOfArrayLike = __webpack_require__(63); // `Array.prototype.fill` method implementation +// `Array.prototype.fill` method implementation // https://tc39.es/ecma262/#sec-array.prototype.fill - - -module.exports = function fill(value -/* , start = 0, end = @length */ -) { +module.exports = function fill(value /* , start = 0, end = @length */) { var O = toObject(this); var length = lengthOfArrayLike(O); var argumentsLength = arguments.length; var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length); var end = argumentsLength > 2 ? arguments[2] : undefined; var endPos = end === undefined ? length : toAbsoluteIndex(end, length); - while (endPos > index) O[index++] = value; - return O; }; /***/ }), -/* 145 */ +/* 151 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var $filter = (__webpack_require__(85).filter); +var arrayMethodHasSpeciesSupport = __webpack_require__(143); +var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter'); -var $filter = (__webpack_require__(83).filter); - -var arrayMethodHasSpeciesSupport = __webpack_require__(137); - -var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter'); // `Array.prototype.filter` method +// `Array.prototype.filter` method // https://tc39.es/ecma262/#sec-array.prototype.filter // with adding support of @@species - $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { - filter: function filter(callbackfn - /* , thisArg */ - ) { + filter: function filter(callbackfn /* , thisArg */) { return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); /***/ }), -/* 146 */ +/* 152 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - -var $find = (__webpack_require__(83).find); - -var addToUnscopables = __webpack_require__(134); - +var $find = (__webpack_require__(85).find); +var addToUnscopables = __webpack_require__(140); var FIND = 'find'; -var SKIPS_HOLES = true; // Shouldn't skip holes +var SKIPS_HOLES = true; +// Shouldn't skip holes +// eslint-disable-next-line es/no-array-prototype-find -- testing if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; -}); // `Array.prototype.find` method -// https://tc39.es/ecma262/#sec-array.prototype.find +}); +// `Array.prototype.find` method +// https://tc39.es/ecma262/#sec-array.prototype.find $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { - find: function find(callbackfn - /* , that = undefined */ - ) { + find: function find(callbackfn /* , that = undefined */) { return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } -}); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +}); +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables(FIND); /***/ }), -/* 147 */ +/* 153 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - -var $findIndex = (__webpack_require__(83).findIndex); - -var addToUnscopables = __webpack_require__(134); - +var $findIndex = (__webpack_require__(85).findIndex); +var addToUnscopables = __webpack_require__(140); var FIND_INDEX = 'findIndex'; -var SKIPS_HOLES = true; // Shouldn't skip holes +var SKIPS_HOLES = true; +// Shouldn't skip holes +// eslint-disable-next-line es/no-array-prototype-findindex -- testing if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; -}); // `Array.prototype.findIndex` method -// https://tc39.es/ecma262/#sec-array.prototype.findindex +}); +// `Array.prototype.findIndex` method +// https://tc39.es/ecma262/#sec-array.prototype.findindex $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { - findIndex: function findIndex(callbackfn - /* , that = undefined */ - ) { + findIndex: function findIndex(callbackfn /* , that = undefined */) { return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } -}); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +}); +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables(FIND_INDEX); /***/ }), -/* 148 */ +/* 154 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var $findLast = (__webpack_require__(155).findLast); +var addToUnscopables = __webpack_require__(140); -var $findLast = (__webpack_require__(149).findLast); - -var addToUnscopables = __webpack_require__(134); // `Array.prototype.findLast` method +// `Array.prototype.findLast` method // https://github.com/tc39/proposal-array-find-from-last - - $({ target: 'Array', proto: true }, { - findLast: function findLast(callbackfn - /* , that = undefined */ - ) { + findLast: function findLast(callbackfn /* , that = undefined */) { return $findLast(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); addToUnscopables('findLast'); /***/ }), -/* 149 */ +/* 155 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var bind = __webpack_require__(84); - +var bind = __webpack_require__(86); var IndexedObject = __webpack_require__(13); +var toObject = __webpack_require__(40); +var lengthOfArrayLike = __webpack_require__(64); -var toObject = __webpack_require__(39); - -var lengthOfArrayLike = __webpack_require__(63); // `Array.prototype.{ findLast, findLastIndex }` methods implementation - - +// `Array.prototype.{ findLast, findLastIndex }` methods implementation var createMethod = function (TYPE) { var IS_FIND_LAST_INDEX = TYPE == 1; return function ($this, callbackfn, that) { @@ -4531,7 +3829,6 @@ var createMethod = function (TYPE) { var boundFunction = bind(callbackfn, that); var index = lengthOfArrayLike(self); var value, result; - while (index-- > 0) { value = self[index]; result = boundFunction(value, index, O); @@ -4539,7 +3836,6 @@ var createMethod = function (TYPE) { case 0: return value; // findLast - case 1: return index; // findLastIndex @@ -4549,7 +3845,6 @@ var createMethod = function (TYPE) { return IS_FIND_LAST_INDEX ? -1 : undefined; }; }; - module.exports = { // `Array.prototype.findLast` method // https://github.com/tc39/proposal-array-find-from-last @@ -4560,60 +3855,50 @@ module.exports = { }; /***/ }), -/* 150 */ +/* 156 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var $findLastIndex = (__webpack_require__(155).findLastIndex); +var addToUnscopables = __webpack_require__(140); -var $findLastIndex = (__webpack_require__(149).findLastIndex); - -var addToUnscopables = __webpack_require__(134); // `Array.prototype.findLastIndex` method +// `Array.prototype.findLastIndex` method // https://github.com/tc39/proposal-array-find-from-last - - $({ target: 'Array', proto: true }, { - findLastIndex: function findLastIndex(callbackfn - /* , that = undefined */ - ) { + findLastIndex: function findLastIndex(callbackfn /* , that = undefined */) { return $findLastIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); addToUnscopables('findLastIndex'); /***/ }), -/* 151 */ +/* 157 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var flattenIntoArray = __webpack_require__(158); +var toObject = __webpack_require__(40); +var lengthOfArrayLike = __webpack_require__(64); +var toIntegerOrInfinity = __webpack_require__(62); +var arraySpeciesCreate = __webpack_require__(88); -var flattenIntoArray = __webpack_require__(152); - -var toObject = __webpack_require__(39); - -var lengthOfArrayLike = __webpack_require__(63); - -var toIntegerOrInfinity = __webpack_require__(61); - -var arraySpeciesCreate = __webpack_require__(85); // `Array.prototype.flat` method +// `Array.prototype.flat` method // https://tc39.es/ecma262/#sec-array.prototype.flat - - $({ target: 'Array', proto: true }, { - flat: function - /* depthArg = 1 */ - flat() { + flat: function flat( /* depthArg = 1 */ + ) { var depthArg = arguments.length ? arguments[0] : undefined; var O = toObject(this); var sourceLen = lengthOfArrayLike(O); @@ -4624,32 +3909,27 @@ $({ }); /***/ }), -/* 152 */ +/* 158 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var isArray = __webpack_require__(87); +var isArray = __webpack_require__(90); +var lengthOfArrayLike = __webpack_require__(64); +var doesNotExceedSafeInteger = __webpack_require__(142); +var bind = __webpack_require__(86); -var lengthOfArrayLike = __webpack_require__(63); - -var doesNotExceedSafeInteger = __webpack_require__(136); - -var bind = __webpack_require__(84); // `FlattenIntoArray` abstract operation +// `FlattenIntoArray` abstract operation // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray - - var flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) { var targetIndex = start; var sourceIndex = 0; var mapFn = mapper ? bind(mapper, thisArg) : false; var element, elementLen; - while (sourceIndex < sourceLen) { if (sourceIndex in source) { element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; - if (depth > 0 && isArray(element)) { elementLen = lengthOfArrayLike(element); targetIndex = flattenIntoArray(target, original, element, elementLen, targetIndex, depth - 1) - 1; @@ -4657,46 +3937,35 @@ var flattenIntoArray = function (target, original, source, sourceLen, start, dep doesNotExceedSafeInteger(targetIndex + 1); target[targetIndex] = element; } - targetIndex++; } - sourceIndex++; } - return targetIndex; }; - module.exports = flattenIntoArray; /***/ }), -/* 153 */ +/* 159 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var flattenIntoArray = __webpack_require__(158); +var aCallable = __webpack_require__(31); +var toObject = __webpack_require__(40); +var lengthOfArrayLike = __webpack_require__(64); +var arraySpeciesCreate = __webpack_require__(88); -var flattenIntoArray = __webpack_require__(152); - -var aCallable = __webpack_require__(30); - -var toObject = __webpack_require__(39); - -var lengthOfArrayLike = __webpack_require__(63); - -var arraySpeciesCreate = __webpack_require__(85); // `Array.prototype.flatMap` method +// `Array.prototype.flatMap` method // https://tc39.es/ecma262/#sec-array.prototype.flatmap - - $({ target: 'Array', proto: true }, { - flatMap: function flatMap(callbackfn - /* , thisArg */ - ) { + flatMap: function flatMap(callbackfn /* , thisArg */) { var O = toObject(this); var sourceLen = lengthOfArrayLike(O); var A; @@ -4708,19 +3977,18 @@ $({ }); /***/ }), -/* 154 */ +/* 160 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var forEach = __webpack_require__(161); -var forEach = __webpack_require__(155); // `Array.prototype.forEach` method +// `Array.prototype.forEach` method // https://tc39.es/ecma262/#sec-array.prototype.foreach -// eslint-disable-next-line es-x/no-array-prototype-foreach -- safe - - +// eslint-disable-next-line es/no-array-prototype-foreach -- safe $({ target: 'Array', proto: true, @@ -4730,41 +3998,37 @@ $({ }); /***/ }), -/* 155 */ +/* 161 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var $forEach = (__webpack_require__(83).forEach); +var $forEach = (__webpack_require__(85).forEach); +var arrayMethodIsStrict = __webpack_require__(148); +var STRICT_METHOD = arrayMethodIsStrict('forEach'); -var arrayMethodIsStrict = __webpack_require__(142); - -var STRICT_METHOD = arrayMethodIsStrict('forEach'); // `Array.prototype.forEach` method implementation +// `Array.prototype.forEach` method implementation // https://tc39.es/ecma262/#sec-array.prototype.foreach - -module.exports = !STRICT_METHOD ? function forEach(callbackfn -/* , thisArg */ -) { - return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); // eslint-disable-next-line es-x/no-array-prototype-foreach -- safe +module.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) { + return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + // eslint-disable-next-line es/no-array-prototype-foreach -- safe } : [].forEach; /***/ }), -/* 156 */ +/* 162 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - -var from = __webpack_require__(157); - -var checkCorrectnessOfIteration = __webpack_require__(159); - +var from = __webpack_require__(163); +var checkCorrectnessOfIteration = __webpack_require__(165); var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) { - // eslint-disable-next-line es-x/no-array-from -- required for testing + // eslint-disable-next-line es/no-array-from -- required for testing Array.from(iterable); -}); // `Array.from` method -// https://tc39.es/ecma262/#sec-array.from +}); +// `Array.from` method +// https://tc39.es/ecma262/#sec-array.from $({ target: 'Array', stat: true, @@ -4774,38 +4038,27 @@ $({ }); /***/ }), -/* 157 */ +/* 163 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var bind = __webpack_require__(84); - +var bind = __webpack_require__(86); var call = __webpack_require__(8); +var toObject = __webpack_require__(40); +var callWithSafeIterationClosing = __webpack_require__(164); +var isArrayIteratorMethod = __webpack_require__(133); +var isConstructor = __webpack_require__(91); +var lengthOfArrayLike = __webpack_require__(64); +var createProperty = __webpack_require__(78); +var getIterator = __webpack_require__(135); +var getIteratorMethod = __webpack_require__(136); +var $Array = Array; -var toObject = __webpack_require__(39); - -var callWithSafeIterationClosing = __webpack_require__(158); - -var isArrayIteratorMethod = __webpack_require__(127); - -var isConstructor = __webpack_require__(88); - -var lengthOfArrayLike = __webpack_require__(63); - -var createProperty = __webpack_require__(77); - -var getIterator = __webpack_require__(129); - -var getIteratorMethod = __webpack_require__(130); - -var $Array = Array; // `Array.from` method implementation +// `Array.from` method implementation // https://tc39.es/ecma262/#sec-array.from - -module.exports = function from(arrayLike -/* , mapfn = undefined, thisArg = undefined */ -) { +module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { var O = toObject(arrayLike); var IS_CONSTRUCTOR = isConstructor(this); var argumentsLength = arguments.length; @@ -4814,13 +4067,12 @@ module.exports = function from(arrayLike if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined); var iteratorMethod = getIteratorMethod(O); var index = 0; - var length, result, step, iterator, next, value; // if the target is not iterable or it's an array with the default iterator - use a simple case - + var length, result, step, iterator, next, value; + // if the target is not iterable or it's an array with the default iterator - use a simple case if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) { iterator = getIterator(O, iteratorMethod); next = iterator.next; result = IS_CONSTRUCTOR ? new this() : []; - for (; !(step = call(next, iterator)).done; index++) { value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value; createProperty(result, index, value); @@ -4828,26 +4080,23 @@ module.exports = function from(arrayLike } else { length = lengthOfArrayLike(O); result = IS_CONSTRUCTOR ? new this(length) : $Array(length); - for (; length > index; index++) { value = mapping ? mapfn(O[index], index) : O[index]; createProperty(result, index, value); } } - result.length = index; return result; }; /***/ }), -/* 158 */ +/* 164 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var anObject = __webpack_require__(46); - -var iteratorClose = __webpack_require__(131); // call something on iterator step with safe closing on error - +var anObject = __webpack_require__(47); +var iteratorClose = __webpack_require__(137); +// call something on iterator step with safe closing on error module.exports = function (iterator, fn, value, ENTRIES) { try { return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); @@ -4857,14 +4106,12 @@ module.exports = function (iterator, fn, value, ENTRIES) { }; /***/ }), -/* 159 */ +/* 165 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var wellKnownSymbol = __webpack_require__(33); - +var wellKnownSymbol = __webpack_require__(34); var ITERATOR = wellKnownSymbol('iterator'); var SAFE_CLOSING = false; - try { var called = 0; var iteratorWithReturn = { @@ -4877,26 +4124,19 @@ try { SAFE_CLOSING = true; } }; - iteratorWithReturn[ITERATOR] = function () { return this; - }; // eslint-disable-next-line es-x/no-array-from, no-throw-literal -- required for testing - - + }; + // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing Array.from(iteratorWithReturn, function () { throw 2; }); -} catch (error) { - /* empty */ -} - +} catch (error) {/* empty */} module.exports = function (exec, SKIP_CLOSING) { if (!SKIP_CLOSING && !SAFE_CLOSING) return false; var ITERATION_SUPPORT = false; - try { var object = {}; - object[ITERATOR] = function () { return { next: function () { @@ -4906,95 +4146,84 @@ module.exports = function (exec, SKIP_CLOSING) { } }; }; - exec(object); - } catch (error) { - /* empty */ - } - + } catch (error) {/* empty */} return ITERATION_SUPPORT; }; /***/ }), -/* 160 */ +/* 166 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - -var $includes = (__webpack_require__(59).includes); - +var $includes = (__webpack_require__(60).includes); var fails = __webpack_require__(7); +var addToUnscopables = __webpack_require__(140); -var addToUnscopables = __webpack_require__(134); // FF99+ bug - - +// FF99+ bug var BROKEN_ON_SPARSE = fails(function () { + // eslint-disable-next-line es/no-array-prototype-includes -- detection return !Array(1).includes(); -}); // `Array.prototype.includes` method -// https://tc39.es/ecma262/#sec-array.prototype.includes +}); +// `Array.prototype.includes` method +// https://tc39.es/ecma262/#sec-array.prototype.includes $({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, { - includes: function includes(el - /* , fromIndex = 0 */ - ) { + includes: function includes(el /* , fromIndex = 0 */) { return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); } -}); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +}); +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('includes'); /***/ }), -/* 161 */ +/* 167 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -/* eslint-disable es-x/no-array-prototype-indexof -- required for testing */ +/* eslint-disable es/no-array-prototype-indexof -- required for testing */ var $ = __webpack_require__(3); - -var uncurryThis = __webpack_require__(14); - -var $indexOf = (__webpack_require__(59).indexOf); - -var arrayMethodIsStrict = __webpack_require__(142); - +var uncurryThis = __webpack_require__(87); +var $indexOf = (__webpack_require__(60).indexOf); +var arrayMethodIsStrict = __webpack_require__(148); var nativeIndexOf = uncurryThis([].indexOf); var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0; -var STRICT_METHOD = arrayMethodIsStrict('indexOf'); // `Array.prototype.indexOf` method -// https://tc39.es/ecma262/#sec-array.prototype.indexof +var FORCED = NEGATIVE_ZERO || !arrayMethodIsStrict('indexOf'); +// `Array.prototype.indexOf` method +// https://tc39.es/ecma262/#sec-array.prototype.indexof $({ target: 'Array', proto: true, - forced: NEGATIVE_ZERO || !STRICT_METHOD + forced: FORCED }, { - indexOf: function indexOf(searchElement - /* , fromIndex = 0 */ - ) { + indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { var fromIndex = arguments.length > 1 ? arguments[1] : undefined; - return NEGATIVE_ZERO // convert -0 to +0 + return NEGATIVE_ZERO + // convert -0 to +0 ? nativeIndexOf(this, searchElement, fromIndex) || 0 : $indexOf(this, searchElement, fromIndex); } }); /***/ }), -/* 162 */ +/* 168 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var isArray = __webpack_require__(90); -var isArray = __webpack_require__(87); // `Array.isArray` method +// `Array.isArray` method // https://tc39.es/ecma262/#sec-array.isarray - - $({ target: 'Array', stat: true @@ -5003,33 +4232,26 @@ $({ }); /***/ }), -/* 163 */ +/* 169 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var toIndexedObject = __webpack_require__(12); - -var addToUnscopables = __webpack_require__(134); - -var Iterators = __webpack_require__(128); - -var InternalStateModule = __webpack_require__(51); - -var defineProperty = (__webpack_require__(44).f); - -var defineIterator = __webpack_require__(164); - -var createIterResultObject = __webpack_require__(167); - -var IS_PURE = __webpack_require__(35); - +var addToUnscopables = __webpack_require__(140); +var Iterators = __webpack_require__(134); +var InternalStateModule = __webpack_require__(52); +var defineProperty = (__webpack_require__(45).f); +var defineIterator = __webpack_require__(170); +var createIterResultObject = __webpack_require__(173); +var IS_PURE = __webpack_require__(36); var DESCRIPTORS = __webpack_require__(6); - var ARRAY_ITERATOR = 'Array Iterator'; var setInternalState = InternalStateModule.set; -var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); // `Array.prototype.entries` method +var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); + +// `Array.prototype.entries` method // https://tc39.es/ecma262/#sec-array.prototype.entries // `Array.prototype.keys` method // https://tc39.es/ecma262/#sec-array.prototype.keys @@ -5039,7 +4261,6 @@ var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); // `Array. // https://tc39.es/ecma262/#sec-array.prototype-@@iterator // `CreateArrayIterator` internal method // https://tc39.es/ecma262/#sec-createarrayiterator - module.exports = defineIterator(Array, 'Array', function (iterated, kind) { setInternalState(this, { type: ARRAY_ITERATOR, @@ -5048,76 +4269,61 @@ module.exports = defineIterator(Array, 'Array', function (iterated, kind) { index: 0, // next index kind: kind // kind - - }); // `%ArrayIteratorPrototype%.next` method + }); + // `%ArrayIteratorPrototype%.next` method // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next }, function () { var state = getInternalState(this); var target = state.target; var kind = state.kind; var index = state.index++; - if (!target || index >= target.length) { state.target = undefined; return createIterResultObject(undefined, true); } - if (kind == 'keys') return createIterResultObject(index, false); if (kind == 'values') return createIterResultObject(target[index], false); return createIterResultObject([index, target[index]], false); -}, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% +}, 'values'); + +// argumentsList[@@iterator] is %ArrayProto_values% // https://tc39.es/ecma262/#sec-createunmappedargumentsobject // https://tc39.es/ecma262/#sec-createmappedargumentsobject +var values = Iterators.Arguments = Iterators.Array; -var values = Iterators.Arguments = Iterators.Array; // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables - +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('keys'); addToUnscopables('values'); -addToUnscopables('entries'); // V8 ~ Chrome 45- bug +addToUnscopables('entries'); +// V8 ~ Chrome 45- bug if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try { defineProperty(values, 'name', { value: 'values' }); -} catch (error) { - /* empty */ -} +} catch (error) {/* empty */} /***/ }), -/* 164 */ +/* 170 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var call = __webpack_require__(8); - -var IS_PURE = __webpack_require__(35); - -var FunctionName = __webpack_require__(49); - +var IS_PURE = __webpack_require__(36); +var FunctionName = __webpack_require__(50); var isCallable = __webpack_require__(21); - -var createIteratorConstructor = __webpack_require__(165); - -var getPrototypeOf = __webpack_require__(124); - -var setPrototypeOf = __webpack_require__(112); - -var setToStringTag = __webpack_require__(82); - -var createNonEnumerableProperty = __webpack_require__(43); - -var defineBuiltIn = __webpack_require__(47); - -var wellKnownSymbol = __webpack_require__(33); - -var Iterators = __webpack_require__(128); - -var IteratorsCore = __webpack_require__(166); - +var createIteratorConstructor = __webpack_require__(171); +var getPrototypeOf = __webpack_require__(130); +var setPrototypeOf = __webpack_require__(116); +var setToStringTag = __webpack_require__(84); +var createNonEnumerableProperty = __webpack_require__(44); +var defineBuiltIn = __webpack_require__(48); +var wellKnownSymbol = __webpack_require__(34); +var Iterators = __webpack_require__(134); +var IteratorsCore = __webpack_require__(172); var PROPER_FUNCTION_NAME = FunctionName.PROPER; var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE; var IteratorPrototype = IteratorsCore.IteratorPrototype; @@ -5126,51 +4332,43 @@ var ITERATOR = wellKnownSymbol('iterator'); var KEYS = 'keys'; var VALUES = 'values'; var ENTRIES = 'entries'; - var returnThis = function () { return this; }; - module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { createIteratorConstructor(IteratorConstructor, NAME, next); - var getIterationMethod = function (KIND) { if (KIND === DEFAULT && defaultIterator) return defaultIterator; if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND]; - switch (KIND) { case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; - case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; - case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; } - return function () { return new IteratorConstructor(this); }; }; - var TO_STRING_TAG = NAME + ' Iterator'; var INCORRECT_VALUES_NAME = false; var IterablePrototype = Iterable.prototype; var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT]; var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; - var CurrentIteratorPrototype, methods, KEY; // fix native + var CurrentIteratorPrototype, methods, KEY; + // fix native if (anyNativeIterator) { CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())); - if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { if (setPrototypeOf) { @@ -5178,28 +4376,26 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) { defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis); } - } // Set @@toStringTag to native iterators - - + } + // Set @@toStringTag to native iterators setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis; } - } // fix Array.prototype.{ values, @@iterator }.name in V8 / FF - + } + // fix Array.prototype.{ values, @@iterator }.name in V8 / FF if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) { createNonEnumerableProperty(IterablePrototype, 'name', VALUES); } else { INCORRECT_VALUES_NAME = true; - defaultIterator = function values() { return call(nativeIterator, this); }; } - } // export additional methods - + } + // export additional methods if (DEFAULT) { methods = { values: getIterationMethod(VALUES), @@ -5215,40 +4411,33 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); - } // define iterator - + } + // define iterator if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT }); } - Iterators[NAME] = defaultIterator; return methods; }; /***/ }), -/* 165 */ +/* 171 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var IteratorPrototype = (__webpack_require__(166).IteratorPrototype); - -var create = __webpack_require__(71); - +var IteratorPrototype = (__webpack_require__(172).IteratorPrototype); +var create = __webpack_require__(72); var createPropertyDescriptor = __webpack_require__(11); - -var setToStringTag = __webpack_require__(82); - -var Iterators = __webpack_require__(128); - +var setToStringTag = __webpack_require__(84); +var Iterators = __webpack_require__(134); var returnThis = function () { return this; }; - module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) { var TO_STRING_TAG = NAME + ' Iterator'; IteratorConstructor.prototype = create(IteratorPrototype, { @@ -5260,65 +4449,57 @@ module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) { }; /***/ }), -/* 166 */ +/* 172 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var fails = __webpack_require__(7); - var isCallable = __webpack_require__(21); - var isObject = __webpack_require__(20); - -var create = __webpack_require__(71); - -var getPrototypeOf = __webpack_require__(124); - -var defineBuiltIn = __webpack_require__(47); - -var wellKnownSymbol = __webpack_require__(33); - -var IS_PURE = __webpack_require__(35); - +var create = __webpack_require__(72); +var getPrototypeOf = __webpack_require__(130); +var defineBuiltIn = __webpack_require__(48); +var wellKnownSymbol = __webpack_require__(34); +var IS_PURE = __webpack_require__(36); var ITERATOR = wellKnownSymbol('iterator'); -var BUGGY_SAFARI_ITERATORS = false; // `%IteratorPrototype%` object +var BUGGY_SAFARI_ITERATORS = false; + +// `%IteratorPrototype%` object // https://tc39.es/ecma262/#sec-%iteratorprototype%-object - var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; -/* eslint-disable es-x/no-array-prototype-keys -- safe */ +/* eslint-disable es/no-array-prototype-keys -- safe */ if ([].keys) { - arrayIterator = [].keys(); // Safari 8 has buggy iterators w/o `next` - + arrayIterator = [].keys(); + // Safari 8 has buggy iterators w/o `next` if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;else { PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype; } } - var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () { - var test = {}; // FF44- legacy iterators case - + var test = {}; + // FF44- legacy iterators case return IteratorPrototype[ITERATOR].call(test) !== test; }); -if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};else if (IS_PURE) IteratorPrototype = create(IteratorPrototype); // `%IteratorPrototype%[@@iterator]()` method -// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator +if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};else if (IS_PURE) IteratorPrototype = create(IteratorPrototype); +// `%IteratorPrototype%[@@iterator]()` method +// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator if (!isCallable(IteratorPrototype[ITERATOR])) { defineBuiltIn(IteratorPrototype, ITERATOR, function () { return this; }); } - module.exports = { IteratorPrototype: IteratorPrototype, BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS }; /***/ }), -/* 167 */ +/* 173 */ /***/ ((module) => { // `CreateIterResultObject` abstract operation @@ -5331,31 +4512,27 @@ module.exports = function (value, done) { }; /***/ }), -/* 168 */ +/* 174 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var uncurryThis = __webpack_require__(14); - var IndexedObject = __webpack_require__(13); - var toIndexedObject = __webpack_require__(12); - -var arrayMethodIsStrict = __webpack_require__(142); - +var arrayMethodIsStrict = __webpack_require__(148); var nativeJoin = uncurryThis([].join); var ES3_STRINGS = IndexedObject != Object; -var STRICT_METHOD = arrayMethodIsStrict('join', ','); // `Array.prototype.join` method -// https://tc39.es/ecma262/#sec-array.prototype.join +var FORCED = ES3_STRINGS || !arrayMethodIsStrict('join', ','); +// `Array.prototype.join` method +// https://tc39.es/ecma262/#sec-array.prototype.join $({ target: 'Array', proto: true, - forced: ES3_STRINGS || !STRICT_METHOD + forced: FORCED }, { join: function join(separator) { return nativeJoin(toIndexedObject(this), separator === undefined ? ',' : separator); @@ -5363,16 +4540,15 @@ $({ }); /***/ }), -/* 169 */ +/* 175 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var lastIndexOf = __webpack_require__(176); -var lastIndexOf = __webpack_require__(170); // `Array.prototype.lastIndexOf` method +// `Array.prototype.lastIndexOf` method // https://tc39.es/ecma262/#sec-array.prototype.lastindexof -// eslint-disable-next-line es-x/no-array-prototype-lastindexof -- required for testing - - +// eslint-disable-next-line es/no-array-prototype-lastindexof -- required for testing $({ target: 'Array', proto: true, @@ -5382,33 +4558,27 @@ $({ }); /***/ }), -/* 170 */ +/* 176 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -/* eslint-disable es-x/no-array-prototype-lastindexof -- safe */ - -var apply = __webpack_require__(93); +/* eslint-disable es/no-array-prototype-lastindexof -- safe */ +var apply = __webpack_require__(96); var toIndexedObject = __webpack_require__(12); - -var toIntegerOrInfinity = __webpack_require__(61); - -var lengthOfArrayLike = __webpack_require__(63); - -var arrayMethodIsStrict = __webpack_require__(142); - +var toIntegerOrInfinity = __webpack_require__(62); +var lengthOfArrayLike = __webpack_require__(64); +var arrayMethodIsStrict = __webpack_require__(148); var min = Math.min; var $lastIndexOf = [].lastIndexOf; var NEGATIVE_ZERO = !!$lastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0; var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf'); -var FORCED = NEGATIVE_ZERO || !STRICT_METHOD; // `Array.prototype.lastIndexOf` method implementation -// https://tc39.es/ecma262/#sec-array.prototype.lastindexof +var FORCED = NEGATIVE_ZERO || !STRICT_METHOD; -module.exports = FORCED ? function lastIndexOf(searchElement -/* , fromIndex = @[*-1] */ -) { +// `Array.prototype.lastIndexOf` method implementation +// https://tc39.es/ecma262/#sec-array.prototype.lastindexof +module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { // convert -0 to +0 if (NEGATIVE_ZERO) return apply($lastIndexOf, this, arguments) || 0; var O = toIndexedObject(this); @@ -5416,130 +4586,112 @@ module.exports = FORCED ? function lastIndexOf(searchElement var index = length - 1; if (arguments.length > 1) index = min(index, toIntegerOrInfinity(arguments[1])); if (index < 0) index = length + index; - for (; index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0; - return -1; } : $lastIndexOf; /***/ }), -/* 171 */ +/* 177 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var $map = (__webpack_require__(85).map); +var arrayMethodHasSpeciesSupport = __webpack_require__(143); +var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map'); -var $map = (__webpack_require__(83).map); - -var arrayMethodHasSpeciesSupport = __webpack_require__(137); - -var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map'); // `Array.prototype.map` method +// `Array.prototype.map` method // https://tc39.es/ecma262/#sec-array.prototype.map // with adding support of @@species - $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { - map: function map(callbackfn - /* , thisArg */ - ) { + map: function map(callbackfn /* , thisArg */) { return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); /***/ }), -/* 172 */ +/* 178 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var fails = __webpack_require__(7); - -var isConstructor = __webpack_require__(88); - -var createProperty = __webpack_require__(77); - +var isConstructor = __webpack_require__(91); +var createProperty = __webpack_require__(78); var $Array = Array; var ISNT_GENERIC = fails(function () { - function F() { - /* empty */ - } // eslint-disable-next-line es-x/no-array-of -- safe - - + function F() {/* empty */} + // eslint-disable-next-line es/no-array-of -- safe return !($Array.of.call(F) instanceof F); -}); // `Array.of` method +}); + +// `Array.of` method // https://tc39.es/ecma262/#sec-array.of // WebKit Array.of isn't generic - $({ target: 'Array', stat: true, forced: ISNT_GENERIC }, { - of: function - /* ...args */ - of() { + of: function of( /* ...args */ + ) { var index = 0; var argumentsLength = arguments.length; var result = new (isConstructor(this) ? this : $Array)(argumentsLength); - while (argumentsLength > index) createProperty(result, index, arguments[index++]); - result.length = argumentsLength; return result; } }); /***/ }), -/* 173 */ +/* 179 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - -var toObject = __webpack_require__(39); - -var lengthOfArrayLike = __webpack_require__(63); - -var setArrayLength = __webpack_require__(174); - -var doesNotExceedSafeInteger = __webpack_require__(136); - +var toObject = __webpack_require__(40); +var lengthOfArrayLike = __webpack_require__(64); +var setArrayLength = __webpack_require__(180); +var doesNotExceedSafeInteger = __webpack_require__(142); var fails = __webpack_require__(7); - var INCORRECT_TO_LENGTH = fails(function () { return [].push.call({ length: 0x100000000 }, 1) !== 4294967297; -}); // V8 and Safari <= 15.4, FF < 23 throws InternalError -// https://bugs.chromium.org/p/v8/issues/detail?id=12681 +}); -var SILENT_ON_NON_WRITABLE_LENGTH = !function () { +// V8 and Safari <= 15.4, FF < 23 throws InternalError +// https://bugs.chromium.org/p/v8/issues/detail?id=12681 +var properErrorOnNonWritableLength = function () { try { - // eslint-disable-next-line es-x/no-object-defineproperty -- safe + // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty([], 'length', { writable: false }).push(); } catch (error) { return error instanceof TypeError; } -}(); // `Array.prototype.push` method -// https://tc39.es/ecma262/#sec-array.prototype.push +}; +var FORCED = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength(); +// `Array.prototype.push` method +// https://tc39.es/ecma262/#sec-array.prototype.push $({ target: 'Array', proto: true, arity: 1, - forced: INCORRECT_TO_LENGTH || SILENT_ON_NON_WRITABLE_LENGTH + forced: FORCED }, { // eslint-disable-next-line no-unused-vars -- required for `.length` push: function push(item) { @@ -5547,38 +4699,34 @@ $({ var len = lengthOfArrayLike(O); var argCount = arguments.length; doesNotExceedSafeInteger(len + argCount); - for (var i = 0; i < argCount; i++) { O[len] = arguments[i]; len++; } - setArrayLength(O, len); return len; } }); /***/ }), -/* 174 */ +/* 180 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var DESCRIPTORS = __webpack_require__(6); +var isArray = __webpack_require__(90); +var $TypeError = TypeError; +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; -var isArray = __webpack_require__(87); - -var $TypeError = TypeError; // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe - -var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Safari < 13 does not throw an error in this case - +// Safari < 13 does not throw an error in this case var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () { // makes no sense without proper strict mode support if (this !== undefined) return true; - try { - // eslint-disable-next-line es-x/no-object-defineproperty -- safe + // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty([], 'length', { writable: false }).length = 1; @@ -5590,62 +4738,53 @@ module.exports = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) { if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) { throw $TypeError('Cannot set read only .length'); } - return O.length = length; } : function (O, length) { return O.length = length; }; /***/ }), -/* 175 */ +/* 181 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var $reduce = (__webpack_require__(182).left); +var arrayMethodIsStrict = __webpack_require__(148); +var CHROME_VERSION = __webpack_require__(28); +var IS_NODE = __webpack_require__(183); -var $reduce = (__webpack_require__(176).left); - -var arrayMethodIsStrict = __webpack_require__(142); - -var CHROME_VERSION = __webpack_require__(27); - -var IS_NODE = __webpack_require__(177); - -var STRICT_METHOD = arrayMethodIsStrict('reduce'); // Chrome 80-82 has a critical bug +// Chrome 80-82 has a critical bug // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982 +var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83; +var FORCED = CHROME_BUG || !arrayMethodIsStrict('reduce'); -var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83; // `Array.prototype.reduce` method +// `Array.prototype.reduce` method // https://tc39.es/ecma262/#sec-array.prototype.reduce - $({ target: 'Array', proto: true, - forced: !STRICT_METHOD || CHROME_BUG + forced: FORCED }, { - reduce: function reduce(callbackfn - /* , initialValue */ - ) { + reduce: function reduce(callbackfn /* , initialValue */) { var length = arguments.length; return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined); } }); /***/ }), -/* 176 */ +/* 182 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var aCallable = __webpack_require__(30); - -var toObject = __webpack_require__(39); - +var aCallable = __webpack_require__(31); +var toObject = __webpack_require__(40); var IndexedObject = __webpack_require__(13); +var lengthOfArrayLike = __webpack_require__(64); +var $TypeError = TypeError; -var lengthOfArrayLike = __webpack_require__(63); - -var $TypeError = TypeError; // `Array.prototype.{ reduce, reduceRight }` methods implementation - +// `Array.prototype.{ reduce, reduceRight }` methods implementation var createMethod = function (IS_RIGHT) { return function (that, callbackfn, argumentsLength, memo) { aCallable(callbackfn); @@ -5660,22 +4799,17 @@ var createMethod = function (IS_RIGHT) { index += i; break; } - index += i; - if (IS_RIGHT ? index < 0 : length <= index) { throw $TypeError('Reduce of empty array with no initial value'); } } - for (; IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) { memo = callbackfn(memo, self[index], index, O); } - return memo; }; }; - module.exports = { // `Array.prototype.reduce` method // https://tc39.es/ecma262/#sec-array.prototype.reduce @@ -5686,69 +4820,59 @@ module.exports = { }; /***/ }), -/* 177 */ +/* 183 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var classof = __webpack_require__(15); - -var global = __webpack_require__(4); - -module.exports = classof(global.process) == 'process'; +module.exports = typeof process != 'undefined' && classof(process) == 'process'; /***/ }), -/* 178 */ +/* 184 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var $reduceRight = (__webpack_require__(182).right); +var arrayMethodIsStrict = __webpack_require__(148); +var CHROME_VERSION = __webpack_require__(28); +var IS_NODE = __webpack_require__(183); -var $reduceRight = (__webpack_require__(176).right); - -var arrayMethodIsStrict = __webpack_require__(142); - -var CHROME_VERSION = __webpack_require__(27); - -var IS_NODE = __webpack_require__(177); - -var STRICT_METHOD = arrayMethodIsStrict('reduceRight'); // Chrome 80-82 has a critical bug +// Chrome 80-82 has a critical bug // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982 +var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83; +var FORCED = CHROME_BUG || !arrayMethodIsStrict('reduceRight'); -var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83; // `Array.prototype.reduceRight` method +// `Array.prototype.reduceRight` method // https://tc39.es/ecma262/#sec-array.prototype.reduceright - $({ target: 'Array', proto: true, - forced: !STRICT_METHOD || CHROME_BUG + forced: FORCED }, { - reduceRight: function reduceRight(callbackfn - /* , initialValue */ - ) { + reduceRight: function reduceRight(callbackfn /* , initialValue */) { return $reduceRight(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); } }); /***/ }), -/* 179 */ +/* 185 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var uncurryThis = __webpack_require__(14); - -var isArray = __webpack_require__(87); - +var isArray = __webpack_require__(90); var nativeReverse = uncurryThis([].reverse); -var test = [1, 2]; // `Array.prototype.reverse` method +var test = [1, 2]; + +// `Array.prototype.reverse` method // https://tc39.es/ecma262/#sec-array.prototype.reverse // fix for Safari 12.0 bug // https://bugs.webkit.org/show_bug.cgi?id=188794 - $({ target: 'Array', proto: true, @@ -5762,41 +4886,31 @@ $({ }); /***/ }), -/* 180 */ +/* 186 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - -var isArray = __webpack_require__(87); - -var isConstructor = __webpack_require__(88); - +var isArray = __webpack_require__(90); +var isConstructor = __webpack_require__(91); var isObject = __webpack_require__(20); - -var toAbsoluteIndex = __webpack_require__(60); - -var lengthOfArrayLike = __webpack_require__(63); - +var toAbsoluteIndex = __webpack_require__(61); +var lengthOfArrayLike = __webpack_require__(64); var toIndexedObject = __webpack_require__(12); - -var createProperty = __webpack_require__(77); - -var wellKnownSymbol = __webpack_require__(33); - -var arrayMethodHasSpeciesSupport = __webpack_require__(137); - -var nativeSlice = __webpack_require__(94); - +var createProperty = __webpack_require__(78); +var wellKnownSymbol = __webpack_require__(34); +var arrayMethodHasSpeciesSupport = __webpack_require__(143); +var nativeSlice = __webpack_require__(97); var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice'); var SPECIES = wellKnownSymbol('species'); var $Array = Array; -var max = Math.max; // `Array.prototype.slice` method +var max = Math.max; + +// `Array.prototype.slice` method // https://tc39.es/ecma262/#sec-array.prototype.slice // fallback for not array-like ES3 strings and DOM objects - $({ target: 'Array', proto: true, @@ -5806,109 +4920,87 @@ $({ var O = toIndexedObject(this); var length = lengthOfArrayLike(O); var k = toAbsoluteIndex(start, length); - var fin = toAbsoluteIndex(end === undefined ? length : end, length); // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible - + var fin = toAbsoluteIndex(end === undefined ? length : end, length); + // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible var Constructor, result, n; - if (isArray(O)) { - Constructor = O.constructor; // cross-realm fallback - + Constructor = O.constructor; + // cross-realm fallback if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) { Constructor = undefined; } else if (isObject(Constructor)) { Constructor = Constructor[SPECIES]; if (Constructor === null) Constructor = undefined; } - if (Constructor === $Array || Constructor === undefined) { return nativeSlice(O, k, fin); } } - result = new (Constructor === undefined ? $Array : Constructor)(max(fin - k, 0)); - for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]); - result.length = n; return result; } }); /***/ }), -/* 181 */ +/* 187 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var $some = (__webpack_require__(85).some); +var arrayMethodIsStrict = __webpack_require__(148); +var STRICT_METHOD = arrayMethodIsStrict('some'); -var $some = (__webpack_require__(83).some); - -var arrayMethodIsStrict = __webpack_require__(142); - -var STRICT_METHOD = arrayMethodIsStrict('some'); // `Array.prototype.some` method +// `Array.prototype.some` method // https://tc39.es/ecma262/#sec-array.prototype.some - $({ target: 'Array', proto: true, forced: !STRICT_METHOD }, { - some: function some(callbackfn - /* , thisArg */ - ) { + some: function some(callbackfn /* , thisArg */) { return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); /***/ }), -/* 182 */ +/* 188 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var uncurryThis = __webpack_require__(14); - -var aCallable = __webpack_require__(30); - -var toObject = __webpack_require__(39); - -var lengthOfArrayLike = __webpack_require__(63); - -var deletePropertyOrThrow = __webpack_require__(140); - -var toString = __webpack_require__(68); - +var aCallable = __webpack_require__(31); +var toObject = __webpack_require__(40); +var lengthOfArrayLike = __webpack_require__(64); +var deletePropertyOrThrow = __webpack_require__(146); +var toString = __webpack_require__(69); var fails = __webpack_require__(7); - -var internalSort = __webpack_require__(183); - -var arrayMethodIsStrict = __webpack_require__(142); - -var FF = __webpack_require__(184); - -var IE_OR_EDGE = __webpack_require__(185); - -var V8 = __webpack_require__(27); - -var WEBKIT = __webpack_require__(186); - +var internalSort = __webpack_require__(189); +var arrayMethodIsStrict = __webpack_require__(148); +var FF = __webpack_require__(190); +var IE_OR_EDGE = __webpack_require__(191); +var V8 = __webpack_require__(28); +var WEBKIT = __webpack_require__(192); var test = []; var nativeSort = uncurryThis(test.sort); -var push = uncurryThis(test.push); // IE8- +var push = uncurryThis(test.push); +// IE8- var FAILS_ON_UNDEFINED = fails(function () { test.sort(undefined); -}); // V8 bug - +}); +// V8 bug var FAILS_ON_NULL = fails(function () { test.sort(null); -}); // Old WebKit - +}); +// Old WebKit var STRICT_METHOD = arrayMethodIsStrict('sort'); var STABLE_SORT = !fails(function () { // feature detection can be too slow, so check engines versions @@ -5917,11 +5009,11 @@ var STABLE_SORT = !fails(function () { if (IE_OR_EDGE) return true; if (WEBKIT) return WEBKIT < 603; var result = ''; - var code, chr, value, index; // generate an array with more 512 elements (Chakra and old V8 fails only in this case) + var code, chr, value, index; + // generate an array with more 512 elements (Chakra and old V8 fails only in this case) for (code = 65; code < 76; code++) { chr = String.fromCharCode(code); - switch (code) { case 66: case 69: @@ -5929,16 +5021,13 @@ var STABLE_SORT = !fails(function () { case 72: value = 3; break; - case 68: case 71: value = 4; break; - default: value = 2; } - for (index = 0; index < 47; index++) { test.push({ k: chr + index, @@ -5946,20 +5035,16 @@ var STABLE_SORT = !fails(function () { }); } } - test.sort(function (a, b) { return b.v - a.v; }); - for (index = 0; index < test.length; index++) { chr = test[index].k.charAt(0); if (result.charAt(result.length - 1) !== chr) result += chr; } - return result !== 'DGBEFHACIJK'; }); var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT; - var getSortCompare = function (comparefn) { return function (x, y) { if (y === undefined) return -1; @@ -5967,10 +5052,10 @@ var getSortCompare = function (comparefn) { if (comparefn !== undefined) return +comparefn(x, y) || 0; return toString(x) > toString(y) ? 1 : -1; }; -}; // `Array.prototype.sort` method +}; + +// `Array.prototype.sort` method // https://tc39.es/ecma262/#sec-array.prototype.sort - - $({ target: 'Array', proto: true, @@ -5983,130 +5068,104 @@ $({ var items = []; var arrayLength = lengthOfArrayLike(array); var itemsLength, index; - for (index = 0; index < arrayLength; index++) { if (index in array) push(items, array[index]); } - internalSort(items, getSortCompare(comparefn)); itemsLength = lengthOfArrayLike(items); index = 0; - while (index < itemsLength) array[index] = items[index++]; - while (index < arrayLength) deletePropertyOrThrow(array, index++); - return array; } }); /***/ }), -/* 183 */ +/* 189 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var arraySlice = __webpack_require__(76); - +var arraySlice = __webpack_require__(77); var floor = Math.floor; - var mergeSort = function (array, comparefn) { var length = array.length; var middle = floor(length / 2); return length < 8 ? insertionSort(array, comparefn) : merge(array, mergeSort(arraySlice(array, 0, middle), comparefn), mergeSort(arraySlice(array, middle), comparefn), comparefn); }; - var insertionSort = function (array, comparefn) { var length = array.length; var i = 1; var element, j; - while (i < length) { j = i; element = array[i]; - while (j && comparefn(array[j - 1], element) > 0) { array[j] = array[--j]; } - if (j !== i++) array[j] = element; } - return array; }; - var merge = function (array, left, right, comparefn) { var llength = left.length; var rlength = right.length; var lindex = 0; var rindex = 0; - while (lindex < llength || rindex < rlength) { array[lindex + rindex] = lindex < llength && rindex < rlength ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++] : lindex < llength ? left[lindex++] : right[rindex++]; } - return array; }; - module.exports = mergeSort; /***/ }), -/* 184 */ +/* 190 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var userAgent = __webpack_require__(28); - +var userAgent = __webpack_require__(29); var firefox = userAgent.match(/firefox\/(\d+)/i); module.exports = !!firefox && +firefox[1]; /***/ }), -/* 185 */ +/* 191 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var UA = __webpack_require__(28); - +var UA = __webpack_require__(29); module.exports = /MSIE|Trident/.test(UA); /***/ }), -/* 186 */ +/* 192 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var userAgent = __webpack_require__(28); - +var userAgent = __webpack_require__(29); var webkit = userAgent.match(/AppleWebKit\/(\d+)\./); module.exports = !!webkit && +webkit[1]; /***/ }), -/* 187 */ +/* 193 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var setSpecies = __webpack_require__(188); // `Array[@@species]` getter +var setSpecies = __webpack_require__(194); + +// `Array[@@species]` getter // https://tc39.es/ecma262/#sec-get-array-@@species - - setSpecies('Array'); /***/ }), -/* 188 */ +/* 194 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var getBuiltIn = __webpack_require__(23); - -var definePropertyModule = __webpack_require__(44); - -var wellKnownSymbol = __webpack_require__(33); - +var getBuiltIn = __webpack_require__(24); +var defineBuiltInAccessor = __webpack_require__(79); +var wellKnownSymbol = __webpack_require__(34); var DESCRIPTORS = __webpack_require__(6); - var SPECIES = wellKnownSymbol('species'); - module.exports = function (CONSTRUCTOR_NAME) { var Constructor = getBuiltIn(CONSTRUCTOR_NAME); - var defineProperty = definePropertyModule.f; - if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { - defineProperty(Constructor, SPECIES, { + defineBuiltInAccessor(Constructor, SPECIES, { configurable: true, get: function () { return this; @@ -6116,54 +5175,41 @@ module.exports = function (CONSTRUCTOR_NAME) { }; /***/ }), -/* 189 */ +/* 195 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - -var toObject = __webpack_require__(39); - -var toAbsoluteIndex = __webpack_require__(60); - -var toIntegerOrInfinity = __webpack_require__(61); - -var lengthOfArrayLike = __webpack_require__(63); - -var setArrayLength = __webpack_require__(174); - -var doesNotExceedSafeInteger = __webpack_require__(136); - -var arraySpeciesCreate = __webpack_require__(85); - -var createProperty = __webpack_require__(77); - -var deletePropertyOrThrow = __webpack_require__(140); - -var arrayMethodHasSpeciesSupport = __webpack_require__(137); - +var toObject = __webpack_require__(40); +var toAbsoluteIndex = __webpack_require__(61); +var toIntegerOrInfinity = __webpack_require__(62); +var lengthOfArrayLike = __webpack_require__(64); +var setArrayLength = __webpack_require__(180); +var doesNotExceedSafeInteger = __webpack_require__(142); +var arraySpeciesCreate = __webpack_require__(88); +var createProperty = __webpack_require__(78); +var deletePropertyOrThrow = __webpack_require__(146); +var arrayMethodHasSpeciesSupport = __webpack_require__(143); var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice'); var max = Math.max; -var min = Math.min; // `Array.prototype.splice` method +var min = Math.min; + +// `Array.prototype.splice` method // https://tc39.es/ecma262/#sec-array.prototype.splice // with adding support of @@species - $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { - splice: function splice(start, deleteCount - /* , ...items */ - ) { + splice: function splice(start, deleteCount /* , ...items */) { var O = toObject(this); var len = lengthOfArrayLike(O); var actualStart = toAbsoluteIndex(start, len); var argumentsLength = arguments.length; var insertCount, actualDeleteCount, A, k, from, to; - if (argumentsLength === 0) { insertCount = actualDeleteCount = 0; } else if (argumentsLength === 1) { @@ -6173,24 +5219,19 @@ $({ insertCount = argumentsLength - 2; actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart); } - doesNotExceedSafeInteger(len + insertCount - actualDeleteCount); A = arraySpeciesCreate(O, actualDeleteCount); - for (k = 0; k < actualDeleteCount; k++) { from = actualStart + k; if (from in O) createProperty(A, k, O[from]); } - A.length = actualDeleteCount; - if (insertCount < actualDeleteCount) { for (k = actualStart; k < len - actualDeleteCount; k++) { from = k + actualDeleteCount; to = k + insertCount; if (from in O) O[to] = O[from];else deletePropertyOrThrow(O, to); } - for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow(O, k - 1); } else if (insertCount > actualDeleteCount) { for (k = len - actualDeleteCount; k > actualStart; k--) { @@ -6199,122 +5240,300 @@ $({ if (from in O) O[to] = O[from];else deletePropertyOrThrow(O, to); } } - for (k = 0; k < insertCount; k++) { O[k + actualStart] = arguments[k + 2]; } - setArrayLength(O, len - actualDeleteCount + insertCount); return A; } }); /***/ }), -/* 190 */ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -// this method was added to unscopables after implementation -// in popular engines, so it's moved to a separate module -var addToUnscopables = __webpack_require__(134); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables - - -addToUnscopables('flat'); - -/***/ }), -/* 191 */ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -// this method was added to unscopables after implementation -// in popular engines, so it's moved to a separate module -var addToUnscopables = __webpack_require__(134); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables - - -addToUnscopables('flatMap'); - -/***/ }), -/* 192 */ +/* 196 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var arrayToReversed = __webpack_require__(197); +var toIndexedObject = __webpack_require__(12); +var addToUnscopables = __webpack_require__(140); +var $Array = Array; -var toObject = __webpack_require__(39); +// `Array.prototype.toReversed` method +// https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toReversed +$({ + target: 'Array', + proto: true +}, { + toReversed: function toReversed() { + return arrayToReversed(toIndexedObject(this), $Array); + } +}); +addToUnscopables('toReversed'); -var lengthOfArrayLike = __webpack_require__(63); +/***/ }), +/* 197 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var setArrayLength = __webpack_require__(174); +var lengthOfArrayLike = __webpack_require__(64); -var deletePropertyOrThrow = __webpack_require__(140); +// https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toReversed +// https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toReversed +module.exports = function (O, C) { + var len = lengthOfArrayLike(O); + var A = new C(len); + var k = 0; + for (; k < len; k++) A[k] = O[len - k - 1]; + return A; +}; -var doesNotExceedSafeInteger = __webpack_require__(136); // IE8- +/***/ }), +/* 198 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; -var INCORRECT_RESULT = [].unshift(0) !== 1; // V8 ~ Chrome < 71 and Safari <= 15.4, FF < 23 throws InternalError +var $ = __webpack_require__(3); +var uncurryThis = __webpack_require__(14); +var aCallable = __webpack_require__(31); +var toIndexedObject = __webpack_require__(12); +var arrayFromConstructorAndList = __webpack_require__(199); +var getVirtual = __webpack_require__(200); +var addToUnscopables = __webpack_require__(140); +var $Array = Array; +var sort = uncurryThis(getVirtual('Array').sort); -var SILENT_ON_NON_WRITABLE_LENGTH = !function () { +// `Array.prototype.toSorted` method +// https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toSorted +$({ + target: 'Array', + proto: true +}, { + toSorted: function toSorted(compareFn) { + if (compareFn !== undefined) aCallable(compareFn); + var O = toIndexedObject(this); + var A = arrayFromConstructorAndList($Array, O); + return sort(A, compareFn); + } +}); +addToUnscopables('toSorted'); + +/***/ }), +/* 199 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var lengthOfArrayLike = __webpack_require__(64); +module.exports = function (Constructor, list) { + var index = 0; + var length = lengthOfArrayLike(list); + var result = new Constructor(length); + while (length > index) result[index] = list[index++]; + return result; +}; + +/***/ }), +/* 200 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var global = __webpack_require__(4); +module.exports = function (CONSTRUCTOR) { + return global[CONSTRUCTOR].prototype; +}; + +/***/ }), +/* 201 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var $ = __webpack_require__(3); +var addToUnscopables = __webpack_require__(140); +var doesNotExceedSafeInteger = __webpack_require__(142); +var lengthOfArrayLike = __webpack_require__(64); +var toAbsoluteIndex = __webpack_require__(61); +var toIndexedObject = __webpack_require__(12); +var toIntegerOrInfinity = __webpack_require__(62); +var $Array = Array; +var max = Math.max; +var min = Math.min; + +// `Array.prototype.toSpliced` method +// https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toSpliced +$({ + target: 'Array', + proto: true +}, { + toSpliced: function toSpliced(start, deleteCount /* , ...items */) { + var O = toIndexedObject(this); + var len = lengthOfArrayLike(O); + var actualStart = toAbsoluteIndex(start, len); + var argumentsLength = arguments.length; + var k = 0; + var insertCount, actualDeleteCount, newLen, A; + if (argumentsLength === 0) { + insertCount = actualDeleteCount = 0; + } else if (argumentsLength === 1) { + insertCount = 0; + actualDeleteCount = len - actualStart; + } else { + insertCount = argumentsLength - 2; + actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart); + } + newLen = doesNotExceedSafeInteger(len + insertCount - actualDeleteCount); + A = $Array(newLen); + for (; k < actualStart; k++) A[k] = O[k]; + for (; k < actualStart + insertCount; k++) A[k] = arguments[k - actualStart + 2]; + for (; k < newLen; k++) A[k] = O[k + actualDeleteCount - insertCount]; + return A; + } +}); +addToUnscopables('toSpliced'); + +/***/ }), +/* 202 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +// this method was added to unscopables after implementation +// in popular engines, so it's moved to a separate module +var addToUnscopables = __webpack_require__(140); + +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables('flat'); + +/***/ }), +/* 203 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +// this method was added to unscopables after implementation +// in popular engines, so it's moved to a separate module +var addToUnscopables = __webpack_require__(140); + +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables('flatMap'); + +/***/ }), +/* 204 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var $ = __webpack_require__(3); +var toObject = __webpack_require__(40); +var lengthOfArrayLike = __webpack_require__(64); +var setArrayLength = __webpack_require__(180); +var deletePropertyOrThrow = __webpack_require__(146); +var doesNotExceedSafeInteger = __webpack_require__(142); + +// IE8- +var INCORRECT_RESULT = [].unshift(0) !== 1; + +// V8 ~ Chrome < 71 and Safari <= 15.4, FF < 23 throws InternalError +var properErrorOnNonWritableLength = function () { try { - // eslint-disable-next-line es-x/no-object-defineproperty -- safe + // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty([], 'length', { writable: false }).unshift(); } catch (error) { return error instanceof TypeError; } -}(); // `Array.prototype.unshift` method -// https://tc39.es/ecma262/#sec-array.prototype.unshift +}; +var FORCED = INCORRECT_RESULT || !properErrorOnNonWritableLength(); +// `Array.prototype.unshift` method +// https://tc39.es/ecma262/#sec-array.prototype.unshift $({ target: 'Array', proto: true, arity: 1, - forced: INCORRECT_RESULT || SILENT_ON_NON_WRITABLE_LENGTH + forced: FORCED }, { // eslint-disable-next-line no-unused-vars -- required for `.length` unshift: function unshift(item) { var O = toObject(this); var len = lengthOfArrayLike(O); var argCount = arguments.length; - if (argCount) { doesNotExceedSafeInteger(len + argCount); var k = len; - while (k--) { var to = k + argCount; if (k in O) O[to] = O[k];else deletePropertyOrThrow(O, to); } - for (var j = 0; j < argCount; j++) { O[j] = arguments[j]; } } - return setArrayLength(O, len + argCount); } }); /***/ }), -/* 193 */ +/* 205 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var arrayWith = __webpack_require__(206); +var toIndexedObject = __webpack_require__(12); +var $Array = Array; +// `Array.prototype.with` method +// https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.with +$({ + target: 'Array', + proto: true +}, { + 'with': function (index, value) { + return arrayWith(toIndexedObject(this), $Array, index, value); + } +}); + +/***/ }), +/* 206 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var lengthOfArrayLike = __webpack_require__(64); +var toIntegerOrInfinity = __webpack_require__(62); +var $RangeError = RangeError; + +// https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.with +// https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.with +module.exports = function (O, C, index, value) { + var len = lengthOfArrayLike(O); + var relativeIndex = toIntegerOrInfinity(index); + var actualIndex = relativeIndex < 0 ? len + relativeIndex : relativeIndex; + if (actualIndex >= len || actualIndex < 0) throw $RangeError('Incorrect index'); + var A = new C(len); + var k = 0; + for (; k < len; k++) A[k] = k === actualIndex ? value : O[k]; + return A; +}; + +/***/ }), +/* 207 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var $ = __webpack_require__(3); var global = __webpack_require__(4); - -var arrayBufferModule = __webpack_require__(194); - -var setSpecies = __webpack_require__(188); - +var arrayBufferModule = __webpack_require__(208); +var setSpecies = __webpack_require__(194); var ARRAY_BUFFER = 'ArrayBuffer'; var ArrayBuffer = arrayBufferModule[ARRAY_BUFFER]; -var NativeArrayBuffer = global[ARRAY_BUFFER]; // `ArrayBuffer` constructor -// https://tc39.es/ecma262/#sec-arraybuffer-constructor +var NativeArrayBuffer = global[ARRAY_BUFFER]; +// `ArrayBuffer` constructor +// https://tc39.es/ecma262/#sec-arraybuffer-constructor $({ global: true, constructor: true, @@ -6325,63 +5544,43 @@ $({ setSpecies(ARRAY_BUFFER); /***/ }), -/* 194 */ +/* 208 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var global = __webpack_require__(4); - var uncurryThis = __webpack_require__(14); - var DESCRIPTORS = __webpack_require__(6); - -var NATIVE_ARRAY_BUFFER = __webpack_require__(195); - -var FunctionName = __webpack_require__(49); - -var createNonEnumerableProperty = __webpack_require__(43); - -var defineBuiltIns = __webpack_require__(196); - +var NATIVE_ARRAY_BUFFER = __webpack_require__(209); +var FunctionName = __webpack_require__(50); +var createNonEnumerableProperty = __webpack_require__(44); +var defineBuiltInAccessor = __webpack_require__(79); +var defineBuiltIns = __webpack_require__(210); var fails = __webpack_require__(7); - -var anInstance = __webpack_require__(197); - -var toIntegerOrInfinity = __webpack_require__(61); - -var toLength = __webpack_require__(64); - -var toIndex = __webpack_require__(198); - -var IEEE754 = __webpack_require__(199); - -var getPrototypeOf = __webpack_require__(124); - -var setPrototypeOf = __webpack_require__(112); - -var getOwnPropertyNames = (__webpack_require__(57).f); - -var defineProperty = (__webpack_require__(44).f); - -var arrayFill = __webpack_require__(144); - -var arraySlice = __webpack_require__(76); - -var setToStringTag = __webpack_require__(82); - -var InternalStateModule = __webpack_require__(51); - +var anInstance = __webpack_require__(211); +var toIntegerOrInfinity = __webpack_require__(62); +var toLength = __webpack_require__(65); +var toIndex = __webpack_require__(212); +var IEEE754 = __webpack_require__(213); +var getPrototypeOf = __webpack_require__(130); +var setPrototypeOf = __webpack_require__(116); +var getOwnPropertyNames = (__webpack_require__(58).f); +var arrayFill = __webpack_require__(150); +var arraySlice = __webpack_require__(77); +var setToStringTag = __webpack_require__(84); +var InternalStateModule = __webpack_require__(52); var PROPER_FUNCTION_NAME = FunctionName.PROPER; var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE; -var getInternalState = InternalStateModule.get; -var setInternalState = InternalStateModule.set; var ARRAY_BUFFER = 'ArrayBuffer'; var DATA_VIEW = 'DataView'; var PROTOTYPE = 'prototype'; var WRONG_LENGTH = 'Wrong length'; var WRONG_INDEX = 'Wrong index'; +var getInternalArrayBufferState = InternalStateModule.getterFor(ARRAY_BUFFER); +var getInternalDataViewState = InternalStateModule.getterFor(DATA_VIEW); +var setInternalState = InternalStateModule.set; var NativeArrayBuffer = global[ARRAY_BUFFER]; var $ArrayBuffer = NativeArrayBuffer; var ArrayBufferPrototype = $ArrayBuffer && $ArrayBuffer[PROTOTYPE]; @@ -6394,103 +5593,94 @@ var fill = uncurryThis(arrayFill); var reverse = uncurryThis([].reverse); var packIEEE754 = IEEE754.pack; var unpackIEEE754 = IEEE754.unpack; - var packInt8 = function (number) { return [number & 0xFF]; }; - var packInt16 = function (number) { return [number & 0xFF, number >> 8 & 0xFF]; }; - var packInt32 = function (number) { return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF]; }; - var unpackInt32 = function (buffer) { return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0]; }; - var packFloat32 = function (number) { return packIEEE754(number, 23, 4); }; - var packFloat64 = function (number) { return packIEEE754(number, 52, 8); }; - -var addGetter = function (Constructor, key) { - defineProperty(Constructor[PROTOTYPE], key, { +var addGetter = function (Constructor, key, getInternalState) { + defineBuiltInAccessor(Constructor[PROTOTYPE], key, { + configurable: true, get: function () { return getInternalState(this)[key]; } }); }; - var get = function (view, count, index, isLittleEndian) { var intIndex = toIndex(index); - var store = getInternalState(view); + var store = getInternalDataViewState(view); if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX); - var bytes = getInternalState(store.buffer).bytes; + var bytes = store.bytes; var start = intIndex + store.byteOffset; var pack = arraySlice(bytes, start, start + count); return isLittleEndian ? pack : reverse(pack); }; - var set = function (view, count, index, conversion, value, isLittleEndian) { var intIndex = toIndex(index); - var store = getInternalState(view); + var store = getInternalDataViewState(view); if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX); - var bytes = getInternalState(store.buffer).bytes; + var bytes = store.bytes; var start = intIndex + store.byteOffset; var pack = conversion(+value); - for (var i = 0; i < count; i++) bytes[start + i] = pack[isLittleEndian ? i : count - i - 1]; }; - if (!NATIVE_ARRAY_BUFFER) { $ArrayBuffer = function ArrayBuffer(length) { anInstance(this, ArrayBufferPrototype); var byteLength = toIndex(length); setInternalState(this, { + type: ARRAY_BUFFER, bytes: fill(Array(byteLength), 0), byteLength: byteLength }); - if (!DESCRIPTORS) this.byteLength = byteLength; + if (!DESCRIPTORS) { + this.byteLength = byteLength; + this.detached = false; + } }; - ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE]; - $DataView = function DataView(buffer, byteOffset, byteLength) { anInstance(this, DataViewPrototype); anInstance(buffer, ArrayBufferPrototype); - var bufferLength = getInternalState(buffer).byteLength; + var bufferState = getInternalArrayBufferState(buffer); + var bufferLength = bufferState.byteLength; var offset = toIntegerOrInfinity(byteOffset); if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset'); byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); setInternalState(this, { + type: DATA_VIEW, buffer: buffer, byteLength: byteLength, - byteOffset: offset + byteOffset: offset, + bytes: bufferState.bytes }); - if (!DESCRIPTORS) { this.buffer = buffer; this.byteLength = byteLength; this.byteOffset = offset; } }; - DataViewPrototype = $DataView[PROTOTYPE]; - if (DESCRIPTORS) { - addGetter($ArrayBuffer, 'byteLength'); - addGetter($DataView, 'buffer'); - addGetter($DataView, 'byteLength'); - addGetter($DataView, 'byteOffset'); + addGetter($ArrayBuffer, 'byteLength', getInternalArrayBufferState); + addGetter($DataView, 'buffer', getInternalDataViewState); + addGetter($DataView, 'byteLength', getInternalDataViewState); + addGetter($DataView, 'byteOffset', getInternalDataViewState); } - defineBuiltIns(DataViewPrototype, { getInt8: function getInt8(byteOffset) { return get(this, 1, byteOffset)[0] << 24 >> 24; @@ -6498,36 +5688,24 @@ if (!NATIVE_ARRAY_BUFFER) { getUint8: function getUint8(byteOffset) { return get(this, 1, byteOffset)[0]; }, - getInt16: function getInt16(byteOffset - /* , littleEndian */ - ) { + getInt16: function getInt16(byteOffset /* , littleEndian */) { var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined); return (bytes[1] << 8 | bytes[0]) << 16 >> 16; }, - getUint16: function getUint16(byteOffset - /* , littleEndian */ - ) { + getUint16: function getUint16(byteOffset /* , littleEndian */) { var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined); return bytes[1] << 8 | bytes[0]; }, - getInt32: function getInt32(byteOffset - /* , littleEndian */ - ) { + getInt32: function getInt32(byteOffset /* , littleEndian */) { return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)); }, - getUint32: function getUint32(byteOffset - /* , littleEndian */ - ) { + getUint32: function getUint32(byteOffset /* , littleEndian */) { return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) >>> 0; }, - getFloat32: function getFloat32(byteOffset - /* , littleEndian */ - ) { + getFloat32: function getFloat32(byteOffset /* , littleEndian */) { return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 23); }, - getFloat64: function getFloat64(byteOffset - /* , littleEndian */ - ) { + getFloat64: function getFloat64(byteOffset /* , littleEndian */) { return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 52); }, setInt8: function setInt8(byteOffset, value) { @@ -6536,41 +5714,28 @@ if (!NATIVE_ARRAY_BUFFER) { setUint8: function setUint8(byteOffset, value) { set(this, 1, byteOffset, packInt8, value); }, - setInt16: function setInt16(byteOffset, value - /* , littleEndian */ - ) { + setInt16: function setInt16(byteOffset, value /* , littleEndian */) { set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined); }, - setUint16: function setUint16(byteOffset, value - /* , littleEndian */ - ) { + setUint16: function setUint16(byteOffset, value /* , littleEndian */) { set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined); }, - setInt32: function setInt32(byteOffset, value - /* , littleEndian */ - ) { + setInt32: function setInt32(byteOffset, value /* , littleEndian */) { set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined); }, - setUint32: function setUint32(byteOffset, value - /* , littleEndian */ - ) { + setUint32: function setUint32(byteOffset, value /* , littleEndian */) { set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined); }, - setFloat32: function setFloat32(byteOffset, value - /* , littleEndian */ - ) { + setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : undefined); }, - setFloat64: function setFloat64(byteOffset, value - /* , littleEndian */ - ) { + setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : undefined); } }); } else { var INCORRECT_ARRAY_BUFFER_NAME = PROPER_FUNCTION_NAME && NativeArrayBuffer.name !== ARRAY_BUFFER; /* eslint-disable no-new -- required for testing */ - if (!fails(function () { NativeArrayBuffer(1); }) || !fails(function () { @@ -6586,26 +5751,23 @@ if (!NATIVE_ARRAY_BUFFER) { anInstance(this, ArrayBufferPrototype); return new NativeArrayBuffer(toIndex(length)); }; - $ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype; - for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j;) { if (!((key = keys[j++]) in $ArrayBuffer)) { createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]); } } - ArrayBufferPrototype.constructor = $ArrayBuffer; } else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) { createNonEnumerableProperty(NativeArrayBuffer, 'name', ARRAY_BUFFER); - } // WebKit bug - the same parent prototype for typed arrays and data view - + } + // WebKit bug - the same parent prototype for typed arrays and data view if (setPrototypeOf && getPrototypeOf(DataViewPrototype) !== ObjectPrototype) { setPrototypeOf(DataViewPrototype, ObjectPrototype); - } // iOS Safari 7.x bug - + } + // iOS Safari 7.x bug var testView = new $DataView(new $ArrayBuffer(2)); var $setInt8 = uncurryThis(DataViewPrototype.setInt8); testView.setInt8(0, 2147483648); @@ -6621,7 +5783,6 @@ if (!NATIVE_ARRAY_BUFFER) { unsafe: true }); } - setToStringTag($ArrayBuffer, ARRAY_BUFFER); setToStringTag($DataView, DATA_VIEW); module.exports = { @@ -6630,48 +5791,43 @@ module.exports = { }; /***/ }), -/* 195 */ +/* 209 */ /***/ ((module) => { -// eslint-disable-next-line es-x/no-typed-arrays -- safe +// eslint-disable-next-line es/no-typed-arrays -- safe module.exports = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined'; /***/ }), -/* 196 */ +/* 210 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var defineBuiltIn = __webpack_require__(47); - +var defineBuiltIn = __webpack_require__(48); module.exports = function (target, src, options) { for (var key in src) defineBuiltIn(target, key, src[key], options); - return target; }; /***/ }), -/* 197 */ +/* 211 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var isPrototypeOf = __webpack_require__(24); - +var isPrototypeOf = __webpack_require__(25); var $TypeError = TypeError; - module.exports = function (it, Prototype) { if (isPrototypeOf(Prototype, it)) return it; throw $TypeError('Incorrect invocation'); }; /***/ }), -/* 198 */ +/* 212 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var toIntegerOrInfinity = __webpack_require__(61); +var toIntegerOrInfinity = __webpack_require__(62); +var toLength = __webpack_require__(65); +var $RangeError = RangeError; -var toLength = __webpack_require__(64); - -var $RangeError = RangeError; // `ToIndex` abstract operation +// `ToIndex` abstract operation // https://tc39.es/ecma262/#sec-toindex - module.exports = function (it) { if (it === undefined) return 0; var number = toIntegerOrInfinity(it); @@ -6681,7 +5837,7 @@ module.exports = function (it) { }; /***/ }), -/* 199 */ +/* 213 */ /***/ ((module) => { // IEEE754 conversions based on https://github.com/feross/ieee754 @@ -6691,7 +5847,6 @@ var pow = Math.pow; var floor = Math.floor; var log = Math.log; var LN2 = Math.LN2; - var pack = function (number, mantissaLength, bytes) { var buffer = $Array(bytes); var exponentLength = bytes * 8 - mantissaLength - 1; @@ -6701,8 +5856,8 @@ var pack = function (number, mantissaLength, bytes) { var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0; var index = 0; var exponent, mantissa, c; - number = abs(number); // eslint-disable-next-line no-self-compare -- NaN check - + number = abs(number); + // eslint-disable-next-line no-self-compare -- NaN check if (number != number || number === Infinity) { // eslint-disable-next-line no-self-compare -- NaN check mantissa = number != number ? 1 : 0; @@ -6710,23 +5865,19 @@ var pack = function (number, mantissaLength, bytes) { } else { exponent = floor(log(number) / LN2); c = pow(2, -exponent); - if (number * c < 1) { exponent--; c *= 2; } - if (exponent + eBias >= 1) { number += rt / c; } else { number += rt * pow(2, 1 - eBias); } - if (number * c >= 2) { exponent++; c /= 2; } - if (exponent + eBias >= eMax) { mantissa = 0; exponent = eMax; @@ -6738,26 +5889,21 @@ var pack = function (number, mantissaLength, bytes) { exponent = 0; } } - while (mantissaLength >= 8) { buffer[index++] = mantissa & 255; mantissa /= 256; mantissaLength -= 8; } - exponent = exponent << mantissaLength | mantissa; exponentLength += mantissaLength; - while (exponentLength > 0) { buffer[index++] = exponent & 255; exponent /= 256; exponentLength -= 8; } - buffer[--index] |= sign * 128; return buffer; }; - var unpack = function (buffer, mantissaLength) { var bytes = buffer.length; var exponentLength = bytes * 8 - mantissaLength - 1; @@ -6769,21 +5915,17 @@ var unpack = function (buffer, mantissaLength) { var exponent = sign & 127; var mantissa; sign >>= 7; - while (nBits > 0) { exponent = exponent * 256 + buffer[index--]; nBits -= 8; } - mantissa = exponent & (1 << -nBits) - 1; exponent >>= -nBits; nBits += mantissaLength; - while (nBits > 0) { mantissa = mantissa * 256 + buffer[index--]; nBits -= 8; } - if (exponent === 0) { exponent = 1 - eBias; } else if (exponent === eMax) { @@ -6792,26 +5934,23 @@ var unpack = function (buffer, mantissaLength) { mantissa = mantissa + pow(2, mantissaLength); exponent = exponent - eBias; } - return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength); }; - module.exports = { pack: pack, unpack: unpack }; /***/ }), -/* 200 */ +/* 214 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var ArrayBufferViewCore = __webpack_require__(215); +var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS; -var ArrayBufferViewCore = __webpack_require__(201); - -var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS; // `ArrayBuffer.isView` method +// `ArrayBuffer.isView` method // https://tc39.es/ecma262/#sec-arraybuffer.isview - $({ target: 'ArrayBuffer', stat: true, @@ -6821,46 +5960,29 @@ $({ }); /***/ }), -/* 201 */ +/* 215 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var NATIVE_ARRAY_BUFFER = __webpack_require__(195); - +var NATIVE_ARRAY_BUFFER = __webpack_require__(209); var DESCRIPTORS = __webpack_require__(6); - var global = __webpack_require__(4); - var isCallable = __webpack_require__(21); - var isObject = __webpack_require__(20); - -var hasOwn = __webpack_require__(38); - -var classof = __webpack_require__(69); - -var tryToString = __webpack_require__(31); - -var createNonEnumerableProperty = __webpack_require__(43); - -var defineBuiltIn = __webpack_require__(47); - -var defineProperty = (__webpack_require__(44).f); - -var isPrototypeOf = __webpack_require__(24); - -var getPrototypeOf = __webpack_require__(124); - -var setPrototypeOf = __webpack_require__(112); - -var wellKnownSymbol = __webpack_require__(33); - -var uid = __webpack_require__(40); - -var InternalStateModule = __webpack_require__(51); - +var hasOwn = __webpack_require__(39); +var classof = __webpack_require__(70); +var tryToString = __webpack_require__(32); +var createNonEnumerableProperty = __webpack_require__(44); +var defineBuiltIn = __webpack_require__(48); +var defineBuiltInAccessor = __webpack_require__(79); +var isPrototypeOf = __webpack_require__(25); +var getPrototypeOf = __webpack_require__(130); +var setPrototypeOf = __webpack_require__(116); +var wellKnownSymbol = __webpack_require__(34); +var uid = __webpack_require__(41); +var InternalStateModule = __webpack_require__(52); var enforceInternalState = InternalStateModule.enforce; var getInternalState = InternalStateModule.get; var Int8Array = global.Int8Array; @@ -6873,8 +5995,8 @@ var ObjectPrototype = Object.prototype; var TypeError = global.TypeError; var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG'); -var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor'; // Fixing native typed arrays in Opera Presto crashes the browser, see #595 - +var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor'; +// Fixing native typed arrays in Opera Presto crashes the browser, see #595 var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera'; var TYPED_ARRAY_TAG_REQUIRED = false; var NAME, Constructor, Prototype; @@ -6893,36 +6015,30 @@ var BigIntArrayConstructorsList = { BigInt64Array: 8, BigUint64Array: 8 }; - var isView = function isView(it) { if (!isObject(it)) return false; var klass = classof(it); return klass === 'DataView' || hasOwn(TypedArrayConstructorsList, klass) || hasOwn(BigIntArrayConstructorsList, klass); }; - var getTypedArrayConstructor = function (it) { var proto = getPrototypeOf(it); if (!isObject(proto)) return; var state = getInternalState(proto); return state && hasOwn(state, TYPED_ARRAY_CONSTRUCTOR) ? state[TYPED_ARRAY_CONSTRUCTOR] : getTypedArrayConstructor(proto); }; - var isTypedArray = function (it) { if (!isObject(it)) return false; var klass = classof(it); return hasOwn(TypedArrayConstructorsList, klass) || hasOwn(BigIntArrayConstructorsList, klass); }; - var aTypedArray = function (it) { if (isTypedArray(it)) return it; throw TypeError('Target is not a typed array'); }; - var aTypedArrayConstructor = function (C) { if (isCallable(C) && (!setPrototypeOf || isPrototypeOf(TypedArray, C))) return C; throw TypeError(tryToString(C) + ' is not a typed array constructor'); }; - var exportTypedArrayMethod = function (KEY, property, forced, options) { if (!DESCRIPTORS) return; if (forced) for (var ARRAY in TypedArrayConstructorsList) { @@ -6933,99 +6049,81 @@ var exportTypedArrayMethod = function (KEY, property, forced, options) { // old WebKit bug - some methods are non-configurable try { TypedArrayConstructor.prototype[KEY] = property; - } catch (error2) { - /* empty */ - } + } catch (error2) {/* empty */} } } - if (!TypedArrayPrototype[KEY] || forced) { defineBuiltIn(TypedArrayPrototype, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options); } }; - var exportTypedArrayStaticMethod = function (KEY, property, forced) { var ARRAY, TypedArrayConstructor; if (!DESCRIPTORS) return; - if (setPrototypeOf) { if (forced) for (ARRAY in TypedArrayConstructorsList) { TypedArrayConstructor = global[ARRAY]; if (TypedArrayConstructor && hasOwn(TypedArrayConstructor, KEY)) try { delete TypedArrayConstructor[KEY]; - } catch (error) { - /* empty */ - } + } catch (error) {/* empty */} } - if (!TypedArray[KEY] || forced) { // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable try { return defineBuiltIn(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property); - } catch (error) { - /* empty */ - } + } catch (error) {/* empty */} } else return; } - for (ARRAY in TypedArrayConstructorsList) { TypedArrayConstructor = global[ARRAY]; - if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) { defineBuiltIn(TypedArrayConstructor, KEY, property); } } }; - for (NAME in TypedArrayConstructorsList) { Constructor = global[NAME]; Prototype = Constructor && Constructor.prototype; if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;else NATIVE_ARRAY_BUFFER_VIEWS = false; } - for (NAME in BigIntArrayConstructorsList) { Constructor = global[NAME]; Prototype = Constructor && Constructor.prototype; if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor; -} // WebKit bug - typed arrays constructors prototype is Object.prototype - +} +// WebKit bug - typed arrays constructors prototype is Object.prototype if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) { // eslint-disable-next-line no-shadow -- safe TypedArray = function TypedArray() { throw TypeError('Incorrect invocation'); }; - if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { if (global[NAME]) setPrototypeOf(global[NAME], TypedArray); } } - if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) { TypedArrayPrototype = TypedArray.prototype; if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype); } -} // WebKit bug - one more object in Uint8ClampedArray prototype chain - +} +// WebKit bug - one more object in Uint8ClampedArray prototype chain if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) { setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype); } - if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) { TYPED_ARRAY_TAG_REQUIRED = true; - defineProperty(TypedArrayPrototype, TO_STRING_TAG, { + defineBuiltInAccessor(TypedArrayPrototype, TO_STRING_TAG, { + configurable: true, get: function () { return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined; } }); - for (NAME in TypedArrayConstructorsList) if (global[NAME]) { createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME); } } - module.exports = { NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS, TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG, @@ -7041,28 +6139,20 @@ module.exports = { }; /***/ }), -/* 202 */ +/* 216 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - -var uncurryThis = __webpack_require__(14); - +var uncurryThis = __webpack_require__(87); var fails = __webpack_require__(7); - -var ArrayBufferModule = __webpack_require__(194); - -var anObject = __webpack_require__(46); - -var toAbsoluteIndex = __webpack_require__(60); - -var toLength = __webpack_require__(64); - -var speciesConstructor = __webpack_require__(203); - +var ArrayBufferModule = __webpack_require__(208); +var anObject = __webpack_require__(47); +var toAbsoluteIndex = __webpack_require__(61); +var toLength = __webpack_require__(65); +var speciesConstructor = __webpack_require__(217); var ArrayBuffer = ArrayBufferModule.ArrayBuffer; var DataView = ArrayBufferModule.DataView; var DataViewPrototype = DataView.prototype; @@ -7071,9 +6161,10 @@ var getUint8 = uncurryThis(DataViewPrototype.getUint8); var setUint8 = uncurryThis(DataViewPrototype.setUint8); var INCORRECT_SLICE = fails(function () { return !new ArrayBuffer(2).slice(1, undefined).byteLength; -}); // `ArrayBuffer.prototype.slice` method -// https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice +}); +// `ArrayBuffer.prototype.slice` method +// https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice $({ target: 'ArrayBuffer', proto: true, @@ -7092,30 +6183,25 @@ $({ var viewSource = new DataView(this); var viewTarget = new DataView(result); var index = 0; - while (first < fin) { setUint8(viewTarget, index++, getUint8(viewSource, first++)); } - return result; } }); /***/ }), -/* 203 */ +/* 217 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var anObject = __webpack_require__(46); - -var aConstructor = __webpack_require__(204); - +var anObject = __webpack_require__(47); +var aConstructor = __webpack_require__(218); var isNullOrUndefined = __webpack_require__(17); +var wellKnownSymbol = __webpack_require__(34); +var SPECIES = wellKnownSymbol('species'); -var wellKnownSymbol = __webpack_require__(33); - -var SPECIES = wellKnownSymbol('species'); // `SpeciesConstructor` abstract operation +// `SpeciesConstructor` abstract operation // https://tc39.es/ecma262/#sec-speciesconstructor - module.exports = function (O, defaultConstructor) { var C = anObject(O).constructor; var S; @@ -7123,39 +6209,36 @@ module.exports = function (O, defaultConstructor) { }; /***/ }), -/* 204 */ +/* 218 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var isConstructor = __webpack_require__(88); - -var tryToString = __webpack_require__(31); - -var $TypeError = TypeError; // `Assert: IsConstructor(argument) is true` +var isConstructor = __webpack_require__(91); +var tryToString = __webpack_require__(32); +var $TypeError = TypeError; +// `Assert: IsConstructor(argument) is true` module.exports = function (argument) { if (isConstructor(argument)) return argument; throw $TypeError(tryToString(argument) + ' is not a constructor'); }; /***/ }), -/* 205 */ +/* 219 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove this module from `core-js@4` since it's replaced to module below -__webpack_require__(206); +__webpack_require__(220); /***/ }), -/* 206 */ +/* 220 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var ArrayBufferModule = __webpack_require__(208); +var NATIVE_ARRAY_BUFFER = __webpack_require__(209); -var ArrayBufferModule = __webpack_require__(194); - -var NATIVE_ARRAY_BUFFER = __webpack_require__(195); // `DataView` constructor +// `DataView` constructor // https://tc39.es/ecma262/#sec-dataview-constructor - - $({ global: true, constructor: true, @@ -7165,24 +6248,25 @@ $({ }); /***/ }), -/* 207 */ +/* 221 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var uncurryThis = __webpack_require__(14); - var fails = __webpack_require__(7); +// IE8- non-standard case var FORCED = fails(function () { + // eslint-disable-next-line es/no-date-prototype-getyear-setyear -- detection return new Date(16e11).getYear() !== 120; }); -var getFullYear = uncurryThis(Date.prototype.getFullYear); // `Date.prototype.getYear` method -// https://tc39.es/ecma262/#sec-date.prototype.getyear +var getFullYear = uncurryThis(Date.prototype.getFullYear); +// `Date.prototype.getYear` method +// https://tc39.es/ecma262/#sec-date.prototype.getyear $({ target: 'Date', proto: true, @@ -7194,18 +6278,17 @@ $({ }); /***/ }), -/* 208 */ +/* 222 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove from `core-js@4` var $ = __webpack_require__(3); - var uncurryThis = __webpack_require__(14); - var $Date = Date; -var thisTimeValue = uncurryThis($Date.prototype.getTime); // `Date.now` method -// https://tc39.es/ecma262/#sec-date.now +var thisTimeValue = uncurryThis($Date.prototype.getTime); +// `Date.now` method +// https://tc39.es/ecma262/#sec-date.now $({ target: 'Date', stat: true @@ -7216,23 +6299,21 @@ $({ }); /***/ }), -/* 209 */ +/* 223 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var uncurryThis = __webpack_require__(14); - -var toIntegerOrInfinity = __webpack_require__(61); - +var toIntegerOrInfinity = __webpack_require__(62); var DatePrototype = Date.prototype; var thisTimeValue = uncurryThis(DatePrototype.getTime); -var setFullYear = uncurryThis(DatePrototype.setFullYear); // `Date.prototype.setYear` method -// https://tc39.es/ecma262/#sec-date.prototype.setyear +var setFullYear = uncurryThis(DatePrototype.setFullYear); +// `Date.prototype.setYear` method +// https://tc39.es/ecma262/#sec-date.prototype.setyear $({ target: 'Date', proto: true @@ -7247,13 +6328,13 @@ $({ }); /***/ }), -/* 210 */ +/* 224 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var $ = __webpack_require__(3); // `Date.prototype.toGMTString` method +var $ = __webpack_require__(3); + +// `Date.prototype.toGMTString` method // https://tc39.es/ecma262/#sec-date.prototype.togmtstring - - $({ target: 'Date', proto: true @@ -7262,16 +6343,15 @@ $({ }); /***/ }), -/* 211 */ +/* 225 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var toISOString = __webpack_require__(226); -var toISOString = __webpack_require__(212); // `Date.prototype.toISOString` method +// `Date.prototype.toISOString` method // https://tc39.es/ecma262/#sec-date.prototype.toisostring // PhantomJS / old WebKit has a broken implementations - - $({ target: 'Date', proto: true, @@ -7281,18 +6361,15 @@ $({ }); /***/ }), -/* 212 */ +/* 226 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var uncurryThis = __webpack_require__(14); - var fails = __webpack_require__(7); - -var padStart = (__webpack_require__(213).start); - +var padStart = (__webpack_require__(227).start); var $RangeError = RangeError; var $isFinite = isFinite; var abs = Math.abs; @@ -7305,10 +6382,11 @@ var getUTCHours = uncurryThis(DatePrototype.getUTCHours); var getUTCMilliseconds = uncurryThis(DatePrototype.getUTCMilliseconds); var getUTCMinutes = uncurryThis(DatePrototype.getUTCMinutes); var getUTCMonth = uncurryThis(DatePrototype.getUTCMonth); -var getUTCSeconds = uncurryThis(DatePrototype.getUTCSeconds); // `Date.prototype.toISOString` method implementation +var getUTCSeconds = uncurryThis(DatePrototype.getUTCSeconds); + +// `Date.prototype.toISOString` method implementation // https://tc39.es/ecma262/#sec-date.prototype.toisostring // PhantomJS / old WebKit fails here: - module.exports = fails(function () { return nativeDateToISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; }) || !fails(function () { @@ -7323,24 +6401,20 @@ module.exports = fails(function () { } : nativeDateToISOString; /***/ }), -/* 213 */ +/* 227 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // https://github.com/tc39/proposal-string-pad-start-end var uncurryThis = __webpack_require__(14); - -var toLength = __webpack_require__(64); - -var toString = __webpack_require__(68); - -var $repeat = __webpack_require__(214); - +var toLength = __webpack_require__(65); +var toString = __webpack_require__(69); +var $repeat = __webpack_require__(228); var requireObjectCoercible = __webpack_require__(16); - var repeat = uncurryThis($repeat); var stringSlice = uncurryThis(''.slice); -var ceil = Math.ceil; // `String.prototype.{ padStart, padEnd }` methods implementation +var ceil = Math.ceil; +// `String.prototype.{ padStart, padEnd }` methods implementation var createMethod = function (IS_END) { return function ($this, maxLength, fillString) { var S = toString(requireObjectCoercible($this)); @@ -7355,7 +6429,6 @@ var createMethod = function (IS_END) { return IS_END ? S + stringFiller : stringFiller + S; }; }; - module.exports = { // `String.prototype.padStart` method // https://tc39.es/ecma262/#sec-string.prototype.padstart @@ -7366,56 +6439,49 @@ module.exports = { }; /***/ }), -/* 214 */ +/* 228 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var toIntegerOrInfinity = __webpack_require__(61); - -var toString = __webpack_require__(68); - +var toIntegerOrInfinity = __webpack_require__(62); +var toString = __webpack_require__(69); var requireObjectCoercible = __webpack_require__(16); +var $RangeError = RangeError; -var $RangeError = RangeError; // `String.prototype.repeat` method implementation +// `String.prototype.repeat` method implementation // https://tc39.es/ecma262/#sec-string.prototype.repeat - module.exports = function repeat(count) { var str = toString(requireObjectCoercible(this)); var result = ''; var n = toIntegerOrInfinity(count); if (n < 0 || n == Infinity) throw $RangeError('Wrong number of repetitions'); - for (; n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str; - return result; }; /***/ }), -/* 215 */ +/* 229 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var fails = __webpack_require__(7); - -var toObject = __webpack_require__(39); - +var toObject = __webpack_require__(40); var toPrimitive = __webpack_require__(19); - var FORCED = fails(function () { return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; -}); // `Date.prototype.toJSON` method -// https://tc39.es/ecma262/#sec-date.prototype.tojson +}); +// `Date.prototype.toJSON` method +// https://tc39.es/ecma262/#sec-date.prototype.tojson $({ target: 'Date', proto: true, @@ -7431,39 +6497,35 @@ $({ }); /***/ }), -/* 216 */ +/* 230 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var hasOwn = __webpack_require__(38); - -var defineBuiltIn = __webpack_require__(47); - -var dateToPrimitive = __webpack_require__(217); - -var wellKnownSymbol = __webpack_require__(33); - +var hasOwn = __webpack_require__(39); +var defineBuiltIn = __webpack_require__(48); +var dateToPrimitive = __webpack_require__(231); +var wellKnownSymbol = __webpack_require__(34); var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); -var DatePrototype = Date.prototype; // `Date.prototype[@@toPrimitive]` method -// https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive +var DatePrototype = Date.prototype; +// `Date.prototype[@@toPrimitive]` method +// https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive if (!hasOwn(DatePrototype, TO_PRIMITIVE)) { defineBuiltIn(DatePrototype, TO_PRIMITIVE, dateToPrimitive); } /***/ }), -/* 217 */ +/* 231 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var anObject = __webpack_require__(46); +var anObject = __webpack_require__(47); +var ordinaryToPrimitive = __webpack_require__(33); +var $TypeError = TypeError; -var ordinaryToPrimitive = __webpack_require__(32); - -var $TypeError = TypeError; // `Date.prototype[@@toPrimitive](hint)` method implementation +// `Date.prototype[@@toPrimitive](hint)` method implementation // https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive - module.exports = function (hint) { anObject(this); if (hint === 'string' || hint === 'default') hint = 'string';else if (hint !== 'number') throw $TypeError('Incorrect hint'); @@ -7471,59 +6533,52 @@ module.exports = function (hint) { }; /***/ }), -/* 218 */ +/* 232 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove from `core-js@4` var uncurryThis = __webpack_require__(14); - -var defineBuiltIn = __webpack_require__(47); - +var defineBuiltIn = __webpack_require__(48); var DatePrototype = Date.prototype; var INVALID_DATE = 'Invalid Date'; var TO_STRING = 'toString'; var nativeDateToString = uncurryThis(DatePrototype[TO_STRING]); -var thisTimeValue = uncurryThis(DatePrototype.getTime); // `Date.prototype.toString` method -// https://tc39.es/ecma262/#sec-date.prototype.tostring +var thisTimeValue = uncurryThis(DatePrototype.getTime); +// `Date.prototype.toString` method +// https://tc39.es/ecma262/#sec-date.prototype.tostring if (String(new Date(NaN)) != INVALID_DATE) { defineBuiltIn(DatePrototype, TO_STRING, function toString() { - var value = thisTimeValue(this); // eslint-disable-next-line no-self-compare -- NaN check - + var value = thisTimeValue(this); + // eslint-disable-next-line no-self-compare -- NaN check return value === value ? nativeDateToString(this) : INVALID_DATE; }); } /***/ }), -/* 219 */ +/* 233 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var uncurryThis = __webpack_require__(14); - -var toString = __webpack_require__(68); - +var toString = __webpack_require__(69); var charAt = uncurryThis(''.charAt); var charCodeAt = uncurryThis(''.charCodeAt); var exec = uncurryThis(/./.exec); var numberToString = uncurryThis(1.0.toString); var toUpperCase = uncurryThis(''.toUpperCase); var raw = /[\w*+\-./@]/; - var hex = function (code, length) { var result = numberToString(code, 16); - while (result.length < length) result = '0' + result; - return result; -}; // `escape` method +}; + +// `escape` method // https://tc39.es/ecma262/#sec-escape-string - - $({ global: true }, { @@ -7533,15 +6588,12 @@ $({ var length = str.length; var index = 0; var chr, code; - while (index < length) { chr = charAt(str, index++); - if (exec(raw, chr)) { result += chr; } else { code = charCodeAt(chr, 0); - if (code < 256) { result += '%' + hex(code, 2); } else { @@ -7549,22 +6601,21 @@ $({ } } } - return result; } }); /***/ }), -/* 220 */ +/* 234 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove from `core-js@4` var $ = __webpack_require__(3); +var bind = __webpack_require__(235); -var bind = __webpack_require__(221); // `Function.prototype.bind` method +// `Function.prototype.bind` method // https://tc39.es/ecma262/#sec-function.prototype.bind - - +// eslint-disable-next-line es/no-function-prototype-bind -- detection $({ target: 'Function', proto: true, @@ -7574,117 +6625,95 @@ $({ }); /***/ }), -/* 221 */ +/* 235 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var uncurryThis = __webpack_require__(14); - -var aCallable = __webpack_require__(30); - +var aCallable = __webpack_require__(31); var isObject = __webpack_require__(20); - -var hasOwn = __webpack_require__(38); - -var arraySlice = __webpack_require__(94); - +var hasOwn = __webpack_require__(39); +var arraySlice = __webpack_require__(97); var NATIVE_BIND = __webpack_require__(9); - var $Function = Function; var concat = uncurryThis([].concat); var join = uncurryThis([].join); var factories = {}; - var construct = function (C, argsLength, args) { if (!hasOwn(factories, argsLength)) { for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']'; - factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')'); } - return factories[argsLength](C, args); -}; // `Function.prototype.bind` method implementation +}; + +// `Function.prototype.bind` method implementation // https://tc39.es/ecma262/#sec-function.prototype.bind - - -module.exports = NATIVE_BIND ? $Function.bind : function bind(that -/* , ...args */ -) { +// eslint-disable-next-line es/no-function-prototype-bind -- detection +module.exports = NATIVE_BIND ? $Function.bind : function bind(that /* , ...args */) { var F = aCallable(this); var Prototype = F.prototype; var partArgs = arraySlice(arguments, 1); - - var boundFunction = function - /* args... */ - bound() { + var boundFunction = function bound( /* args... */ + ) { var args = concat(partArgs, arraySlice(arguments)); return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args); }; - if (isObject(Prototype)) boundFunction.prototype = Prototype; return boundFunction; }; /***/ }), -/* 222 */ +/* 236 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var isCallable = __webpack_require__(21); - var isObject = __webpack_require__(20); - -var definePropertyModule = __webpack_require__(44); - -var getPrototypeOf = __webpack_require__(124); - -var wellKnownSymbol = __webpack_require__(33); - -var makeBuiltIn = __webpack_require__(48); - +var definePropertyModule = __webpack_require__(45); +var getPrototypeOf = __webpack_require__(130); +var wellKnownSymbol = __webpack_require__(34); +var makeBuiltIn = __webpack_require__(49); var HAS_INSTANCE = wellKnownSymbol('hasInstance'); -var FunctionPrototype = Function.prototype; // `Function.prototype[@@hasInstance]` method -// https://tc39.es/ecma262/#sec-function.prototype-@@hasinstance +var FunctionPrototype = Function.prototype; +// `Function.prototype[@@hasInstance]` method +// https://tc39.es/ecma262/#sec-function.prototype-@@hasinstance if (!(HAS_INSTANCE in FunctionPrototype)) { definePropertyModule.f(FunctionPrototype, HAS_INSTANCE, { value: makeBuiltIn(function (O) { if (!isCallable(this) || !isObject(O)) return false; var P = this.prototype; - if (!isObject(P)) return O instanceof this; // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: - + if (!isObject(P)) return O instanceof this; + // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: while (O = getPrototypeOf(O)) if (P === O) return true; - return false; }, HAS_INSTANCE) }); } /***/ }), -/* 223 */ +/* 237 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(6); - -var FUNCTION_NAME_EXISTS = (__webpack_require__(49).EXISTS); - +var FUNCTION_NAME_EXISTS = (__webpack_require__(50).EXISTS); var uncurryThis = __webpack_require__(14); - -var defineProperty = (__webpack_require__(44).f); - +var defineBuiltInAccessor = __webpack_require__(79); var FunctionPrototype = Function.prototype; var functionToString = uncurryThis(FunctionPrototype.toString); var nameRE = /function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/; var regExpExec = uncurryThis(nameRE.exec); -var NAME = 'name'; // Function instances `.name` property -// https://tc39.es/ecma262/#sec-function-instances-name +var NAME = 'name'; +// Function instances `.name` property +// https://tc39.es/ecma262/#sec-function-instances-name if (DESCRIPTORS && !FUNCTION_NAME_EXISTS) { - defineProperty(FunctionPrototype, NAME, { + defineBuiltInAccessor(FunctionPrototype, NAME, { configurable: true, get: function () { try { @@ -7697,15 +6726,14 @@ if (DESCRIPTORS && !FUNCTION_NAME_EXISTS) { } /***/ }), -/* 224 */ +/* 238 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var global = __webpack_require__(4); -var global = __webpack_require__(4); // `globalThis` object +// `globalThis` object // https://tc39.es/ecma262/#sec-globalthis - - $({ global: true, forced: global.globalThis !== global @@ -7714,37 +6742,35 @@ $({ }); /***/ }), -/* 225 */ +/* 239 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4); +var setToStringTag = __webpack_require__(84); -var setToStringTag = __webpack_require__(82); // JSON[@@toStringTag] property +// JSON[@@toStringTag] property // https://tc39.es/ecma262/#sec-json-@@tostringtag - - setToStringTag(global.JSON, 'JSON', true); /***/ }), -/* 226 */ +/* 240 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove this module from `core-js@4` since it's replaced to module below -__webpack_require__(227); +__webpack_require__(241); /***/ }), -/* 227 */ +/* 241 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var collection = __webpack_require__(228); +var collection = __webpack_require__(242); +var collectionStrong = __webpack_require__(247); -var collectionStrong = __webpack_require__(233); // `Map` constructor +// `Map` constructor // https://tc39.es/ecma262/#sec-map-objects - - collection('Map', function (init) { return function Map() { return init(this, arguments.length ? arguments[0] : undefined); @@ -7752,42 +6778,27 @@ collection('Map', function (init) { }, collectionStrong); /***/ }), -/* 228 */ +/* 242 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var global = __webpack_require__(4); - var uncurryThis = __webpack_require__(14); - -var isForced = __webpack_require__(67); - -var defineBuiltIn = __webpack_require__(47); - -var InternalMetadataModule = __webpack_require__(229); - -var iterate = __webpack_require__(126); - -var anInstance = __webpack_require__(197); - +var isForced = __webpack_require__(68); +var defineBuiltIn = __webpack_require__(48); +var InternalMetadataModule = __webpack_require__(243); +var iterate = __webpack_require__(132); +var anInstance = __webpack_require__(211); var isCallable = __webpack_require__(21); - var isNullOrUndefined = __webpack_require__(17); - var isObject = __webpack_require__(20); - var fails = __webpack_require__(7); - -var checkCorrectnessOfIteration = __webpack_require__(159); - -var setToStringTag = __webpack_require__(82); - -var inheritIfRequired = __webpack_require__(115); - +var checkCorrectnessOfIteration = __webpack_require__(165); +var setToStringTag = __webpack_require__(84); +var inheritIfRequired = __webpack_require__(120); module.exports = function (CONSTRUCTOR_NAME, wrapper, common) { var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1; var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1; @@ -7796,7 +6807,6 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common) { var NativePrototype = NativeConstructor && NativeConstructor.prototype; var Constructor = NativeConstructor; var exported = {}; - var fixMethod = function (KEY) { var uncurriedNativeMethod = uncurryThis(NativePrototype[KEY]); defineBuiltIn(NativePrototype, KEY, KEY == 'add' ? function add(value) { @@ -7813,39 +6823,34 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common) { return this; }); }; - var REPLACE = isForced(CONSTRUCTOR_NAME, !isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails(function () { new NativeConstructor().entries().next(); }))); - if (REPLACE) { // create collection constructor Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER); InternalMetadataModule.enable(); } else if (isForced(CONSTRUCTOR_NAME, true)) { - var instance = new Constructor(); // early implementations not supports chaining - - var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false - + var instance = new Constructor(); + // early implementations not supports chaining + var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); - }); // most early implementations doesn't supports iterables, most modern - not close it correctly + }); + // most early implementations doesn't supports iterables, most modern - not close it correctly // eslint-disable-next-line no-new -- required for testing - var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); - }); // for early implementations -0 and +0 not the same - + }); + // for early implementations -0 and +0 not the same var BUGGY_ZERO = !IS_WEAK && fails(function () { // V8 ~ Chromium 42- fails only with 5+ elements var $instance = new NativeConstructor(); var index = 5; - while (index--) $instance[ADDER](index, index); - return !$instance.has(-0); }); - if (!ACCEPT_ITERABLES) { Constructor = wrapper(function (dummy, iterable) { anInstance(dummy, NativePrototype); @@ -7859,18 +6864,16 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common) { Constructor.prototype = NativePrototype; NativePrototype.constructor = Constructor; } - if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { fixMethod('delete'); fixMethod('has'); IS_MAP && fixMethod('get'); } + if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); - if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); // weak collections should not contains .clear method - + // weak collections should not contains .clear method if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear; } - exported[CONSTRUCTOR_NAME] = Constructor; $({ global: true, @@ -7883,42 +6886,29 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common) { }; /***/ }), -/* 229 */ +/* 243 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var uncurryThis = __webpack_require__(14); - -var hiddenKeys = __webpack_require__(54); - +var hiddenKeys = __webpack_require__(55); var isObject = __webpack_require__(20); - -var hasOwn = __webpack_require__(38); - -var defineProperty = (__webpack_require__(44).f); - -var getOwnPropertyNamesModule = __webpack_require__(57); - -var getOwnPropertyNamesExternalModule = __webpack_require__(75); - -var isExtensible = __webpack_require__(230); - -var uid = __webpack_require__(40); - -var FREEZING = __webpack_require__(232); - +var hasOwn = __webpack_require__(39); +var defineProperty = (__webpack_require__(45).f); +var getOwnPropertyNamesModule = __webpack_require__(58); +var getOwnPropertyNamesExternalModule = __webpack_require__(76); +var isExtensible = __webpack_require__(244); +var uid = __webpack_require__(41); +var FREEZING = __webpack_require__(246); var REQUIRED = false; var METADATA = uid('meta'); var id = 0; - var setMetadata = function (it) { defineProperty(it, METADATA, { value: { objectID: 'O' + id++, // object ID weakData: {} // weak collections IDs - } }); }; @@ -7926,63 +6916,55 @@ var setMetadata = function (it) { var fastKey = function (it, create) { // return a primitive with prefix if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; - if (!hasOwn(it, METADATA)) { // can't set metadata to uncaught frozen object - if (!isExtensible(it)) return 'F'; // not necessary to add metadata - - if (!create) return 'E'; // add missing metadata - - setMetadata(it); // return object ID + if (!isExtensible(it)) return 'F'; + // not necessary to add metadata + if (!create) return 'E'; + // add missing metadata + setMetadata(it); + // return object ID } - return it[METADATA].objectID; }; - var getWeakData = function (it, create) { if (!hasOwn(it, METADATA)) { // can't set metadata to uncaught frozen object - if (!isExtensible(it)) return true; // not necessary to add metadata - - if (!create) return false; // add missing metadata - - setMetadata(it); // return the store of weak collections IDs + if (!isExtensible(it)) return true; + // not necessary to add metadata + if (!create) return false; + // add missing metadata + setMetadata(it); + // return the store of weak collections IDs } - return it[METADATA].weakData; -}; // add metadata on freeze-family methods calling - +}; +// add metadata on freeze-family methods calling var onFreeze = function (it) { if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it); return it; }; - var enable = function () { - meta.enable = function () { - /* empty */ - }; - + meta.enable = function () {/* empty */}; REQUIRED = true; var getOwnPropertyNames = getOwnPropertyNamesModule.f; var splice = uncurryThis([].splice); var test = {}; - test[METADATA] = 1; // prevent exposing of metadata key + test[METADATA] = 1; + // prevent exposing of metadata key if (getOwnPropertyNames(test).length) { getOwnPropertyNamesModule.f = function (it) { var result = getOwnPropertyNames(it); - for (var i = 0, length = result.length; i < length; i++) { if (result[i] === METADATA) { splice(result, i, 1); break; } } - return result; }; - $({ target: 'Object', stat: true, @@ -7992,7 +6974,6 @@ var enable = function () { }); } }; - var meta = module.exports = { enable: enable, fastKey: fastKey, @@ -8002,24 +6983,22 @@ var meta = module.exports = { hiddenKeys[METADATA] = true; /***/ }), -/* 230 */ +/* 244 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fails = __webpack_require__(7); - var isObject = __webpack_require__(20); - var classof = __webpack_require__(15); +var ARRAY_BUFFER_NON_EXTENSIBLE = __webpack_require__(245); -var ARRAY_BUFFER_NON_EXTENSIBLE = __webpack_require__(231); // eslint-disable-next-line es-x/no-object-isextensible -- safe - - +// eslint-disable-next-line es/no-object-isextensible -- safe var $isExtensible = Object.isExtensible; var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); -}); // `Object.isExtensible` method -// https://tc39.es/ecma262/#sec-object.isextensible +}); +// `Object.isExtensible` method +// https://tc39.es/ecma262/#sec-object.isextensible module.exports = FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE ? function isExtensible(it) { if (!isObject(it)) return false; if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) == 'ArrayBuffer') return false; @@ -8027,16 +7006,15 @@ module.exports = FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE ? function i } : $isExtensible; /***/ }), -/* 231 */ +/* 245 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it var fails = __webpack_require__(7); - module.exports = fails(function () { if (typeof ArrayBuffer == 'function') { - var buffer = new ArrayBuffer(8); // eslint-disable-next-line es-x/no-object-isextensible, es-x/no-object-defineproperty -- safe - + var buffer = new ArrayBuffer(8); + // eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 }); @@ -8044,49 +7022,35 @@ module.exports = fails(function () { }); /***/ }), -/* 232 */ +/* 246 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fails = __webpack_require__(7); - module.exports = !fails(function () { - // eslint-disable-next-line es-x/no-object-isextensible, es-x/no-object-preventextensions -- required for testing + // eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing return Object.isExtensible(Object.preventExtensions({})); }); /***/ }), -/* 233 */ +/* 247 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var defineProperty = (__webpack_require__(44).f); - -var create = __webpack_require__(71); - -var defineBuiltIns = __webpack_require__(196); - -var bind = __webpack_require__(84); - -var anInstance = __webpack_require__(197); - +var create = __webpack_require__(72); +var defineBuiltInAccessor = __webpack_require__(79); +var defineBuiltIns = __webpack_require__(210); +var bind = __webpack_require__(86); +var anInstance = __webpack_require__(211); var isNullOrUndefined = __webpack_require__(17); - -var iterate = __webpack_require__(126); - -var defineIterator = __webpack_require__(164); - -var createIterResultObject = __webpack_require__(167); - -var setSpecies = __webpack_require__(188); - +var iterate = __webpack_require__(132); +var defineIterator = __webpack_require__(170); +var createIterResultObject = __webpack_require__(173); +var setSpecies = __webpack_require__(194); var DESCRIPTORS = __webpack_require__(6); - -var fastKey = (__webpack_require__(229).fastKey); - -var InternalStateModule = __webpack_require__(51); - +var fastKey = (__webpack_require__(243).fastKey); +var InternalStateModule = __webpack_require__(52); var setInternalState = InternalStateModule.set; var internalStateGetterFor = InternalStateModule.getterFor; module.exports = { @@ -8108,14 +7072,14 @@ module.exports = { }); var Prototype = Constructor.prototype; var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); - var define = function (that, key, value) { var state = getInternalState(that); var entry = getEntry(that, key); - var previous, index; // change existing entry - + var previous, index; + // change existing entry if (entry) { - entry.value = value; // create new entry + entry.value = value; + // create new entry } else { state.last = entry = { index: index = fastKey(key, true), @@ -8127,26 +7091,23 @@ module.exports = { }; if (!state.first) state.first = entry; if (previous) previous.next = entry; - if (DESCRIPTORS) state.size++;else that.size++; // add to index - + if (DESCRIPTORS) state.size++;else that.size++; + // add to index if (index !== 'F') state.index[index] = entry; } - return that; }; - var getEntry = function (that, key) { - var state = getInternalState(that); // fast case - + var state = getInternalState(that); + // fast case var index = fastKey(key); var entry; - if (index !== 'F') return state.index[index]; // frozen object case - + if (index !== 'F') return state.index[index]; + // frozen object case for (entry = state.first; entry; entry = entry.next) { if (entry.key == key) return entry; } }; - defineBuiltIns(Prototype, { // `{ Map, Set }.prototype.clear()` methods // https://tc39.es/ecma262/#sec-map.prototype.clear @@ -8156,14 +7117,12 @@ module.exports = { var state = getInternalState(that); var data = state.index; var entry = state.first; - while (entry) { entry.removed = true; if (entry.previous) entry.previous = entry.previous.next = undefined; delete data[entry.index]; entry = entry.next; } - state.first = state.last = undefined; if (DESCRIPTORS) state.size = 0;else that.size = 0; }, @@ -8174,7 +7133,6 @@ module.exports = { var that = this; var state = getInternalState(that); var entry = getEntry(that, key); - if (entry) { var next = entry.next; var prev = entry.previous; @@ -8186,22 +7144,18 @@ module.exports = { if (state.last == entry) state.last = prev; if (DESCRIPTORS) state.size--;else that.size--; } - return !!entry; }, // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods // https://tc39.es/ecma262/#sec-map.prototype.foreach // https://tc39.es/ecma262/#sec-set.prototype.foreach - forEach: function forEach(callbackfn - /* , that = undefined */ - ) { + forEach: function forEach(callbackfn /* , that = undefined */) { var state = getInternalState(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var entry; - while (entry = entry ? entry.next : state.first) { - boundFunction(entry.value, entry.key, this); // revert to the last existing entry - + boundFunction(entry.value, entry.key, this); + // revert to the last existing entry while (entry && entry.removed) entry = entry.previous; } }, @@ -8231,7 +7185,8 @@ module.exports = { return define(this, value = value === 0 ? 0 : value, value); } }); - if (DESCRIPTORS) defineProperty(Prototype, 'size', { + if (DESCRIPTORS) defineBuiltInAccessor(Prototype, 'size', { + configurable: true, get: function () { return getInternalState(this).size; } @@ -8241,7 +7196,8 @@ module.exports = { setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) { var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator'; var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME); - var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME); // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods + var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME); + // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods // https://tc39.es/ecma262/#sec-map.prototype.entries // https://tc39.es/ecma262/#sec-map.prototype.keys // https://tc39.es/ecma262/#sec-map.prototype.values @@ -8250,7 +7206,6 @@ module.exports = { // https://tc39.es/ecma262/#sec-set.prototype.keys // https://tc39.es/ecma262/#sec-set.prototype.values // https://tc39.es/ecma262/#sec-set.prototype-@@iterator - defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) { setInternalState(this, { type: ITERATOR_NAME, @@ -8262,47 +7217,48 @@ module.exports = { }, function () { var state = getInternalIteratorState(this); var kind = state.kind; - var entry = state.last; // revert to the last existing entry - - while (entry && entry.removed) entry = entry.previous; // get next entry - - + var entry = state.last; + // revert to the last existing entry + while (entry && entry.removed) entry = entry.previous; + // get next entry if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) { // or finish the iteration state.target = undefined; return createIterResultObject(undefined, true); - } // return step by kind - - + } + // return step by kind if (kind == 'keys') return createIterResultObject(entry.key, false); if (kind == 'values') return createIterResultObject(entry.value, false); return createIterResultObject([entry.key, entry.value], false); - }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); // `{ Map, Set }.prototype[@@species]` accessors + }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); + + // `{ Map, Set }.prototype[@@species]` accessors // https://tc39.es/ecma262/#sec-get-map-@@species // https://tc39.es/ecma262/#sec-get-set-@@species - setSpecies(CONSTRUCTOR_NAME); } }; /***/ }), -/* 234 */ +/* 248 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var log1p = __webpack_require__(249); -var log1p = __webpack_require__(235); // eslint-disable-next-line es-x/no-math-acosh -- required for testing - - +// eslint-disable-next-line es/no-math-acosh -- required for testing var $acosh = Math.acosh; var log = Math.log; var sqrt = Math.sqrt; var LN2 = Math.LN2; -var FORCED = !$acosh // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 -|| Math.floor($acosh(Number.MAX_VALUE)) != 710 // Tor Browser bug: Math.acosh(Infinity) -> NaN -|| $acosh(Infinity) != Infinity; // `Math.acosh` method -// https://tc39.es/ecma262/#sec-math.acosh +var FORCED = !$acosh +// V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 +|| Math.floor($acosh(Number.MAX_VALUE)) != 710 +// Tor Browser bug: Math.acosh(Infinity) -> NaN +|| $acosh(Infinity) != Infinity; +// `Math.acosh` method +// https://tc39.es/ecma262/#sec-math.acosh $({ target: 'Math', stat: true, @@ -8315,61 +7271,64 @@ $({ }); /***/ }), -/* 235 */ +/* 249 */ /***/ ((module) => { -var log = Math.log; // `Math.log1p` method implementation -// https://tc39.es/ecma262/#sec-math.log1p -// eslint-disable-next-line es-x/no-math-log1p -- safe +var log = Math.log; +// `Math.log1p` method implementation +// https://tc39.es/ecma262/#sec-math.log1p +// eslint-disable-next-line es/no-math-log1p -- safe module.exports = Math.log1p || function log1p(x) { var n = +x; return n > -1e-8 && n < 1e-8 ? n - n * n / 2 : log(1 + n); }; /***/ }), -/* 236 */ +/* 250 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var $ = __webpack_require__(3); // eslint-disable-next-line es-x/no-math-asinh -- required for testing - +var $ = __webpack_require__(3); +// eslint-disable-next-line es/no-math-asinh -- required for testing var $asinh = Math.asinh; var log = Math.log; var sqrt = Math.sqrt; - function asinh(x) { var n = +x; return !isFinite(n) || n == 0 ? n : n < 0 ? -asinh(-n) : log(n + sqrt(n * n + 1)); -} // `Math.asinh` method +} +var FORCED = !($asinh && 1 / $asinh(0) > 0); + +// `Math.asinh` method // https://tc39.es/ecma262/#sec-math.asinh // Tor Browser bug: Math.asinh(0) -> -0 - - $({ target: 'Math', stat: true, - forced: !($asinh && 1 / $asinh(0) > 0) + forced: FORCED }, { asinh: asinh }); /***/ }), -/* 237 */ +/* 251 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var $ = __webpack_require__(3); // eslint-disable-next-line es-x/no-math-atanh -- required for testing - +var $ = __webpack_require__(3); +// eslint-disable-next-line es/no-math-atanh -- required for testing var $atanh = Math.atanh; -var log = Math.log; // `Math.atanh` method +var log = Math.log; +var FORCED = !($atanh && 1 / $atanh(-0) < 0); + +// `Math.atanh` method // https://tc39.es/ecma262/#sec-math.atanh // Tor Browser bug: Math.atanh(-0) -> 0 - $({ target: 'Math', stat: true, - forced: !($atanh && 1 / $atanh(-0) < 0) + forced: FORCED }, { atanh: function atanh(x) { var n = +x; @@ -8378,17 +7337,16 @@ $({ }); /***/ }), -/* 238 */ +/* 252 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - -var sign = __webpack_require__(239); - +var sign = __webpack_require__(253); var abs = Math.abs; -var pow = Math.pow; // `Math.cbrt` method -// https://tc39.es/ecma262/#sec-math.cbrt +var pow = Math.pow; +// `Math.cbrt` method +// https://tc39.es/ecma262/#sec-math.cbrt $({ target: 'Math', stat: true @@ -8400,29 +7358,29 @@ $({ }); /***/ }), -/* 239 */ +/* 253 */ /***/ ((module) => { // `Math.sign` method implementation // https://tc39.es/ecma262/#sec-math.sign -// eslint-disable-next-line es-x/no-math-sign -- safe +// eslint-disable-next-line es/no-math-sign -- safe module.exports = Math.sign || function sign(x) { - var n = +x; // eslint-disable-next-line no-self-compare -- NaN check - + var n = +x; + // eslint-disable-next-line no-self-compare -- NaN check return n == 0 || n != n ? n : n < 0 ? -1 : 1; }; /***/ }), -/* 240 */ +/* 254 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var floor = Math.floor; var log = Math.log; -var LOG2E = Math.LOG2E; // `Math.clz32` method -// https://tc39.es/ecma262/#sec-math.clz32 +var LOG2E = Math.LOG2E; +// `Math.clz32` method +// https://tc39.es/ecma262/#sec-math.clz32 $({ target: 'Math', stat: true @@ -8434,23 +7392,24 @@ $({ }); /***/ }), -/* 241 */ +/* 255 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var expm1 = __webpack_require__(256); -var expm1 = __webpack_require__(242); // eslint-disable-next-line es-x/no-math-cosh -- required for testing - - +// eslint-disable-next-line es/no-math-cosh -- required for testing var $cosh = Math.cosh; var abs = Math.abs; -var E = Math.E; // `Math.cosh` method -// https://tc39.es/ecma262/#sec-math.cosh +var E = Math.E; +var FORCED = !$cosh || $cosh(710) === Infinity; +// `Math.cosh` method +// https://tc39.es/ecma262/#sec-math.cosh $({ target: 'Math', stat: true, - forced: !$cosh || $cosh(710) === Infinity + forced: FORCED }, { cosh: function cosh(x) { var t = expm1(abs(x) - 1) + 1; @@ -8459,32 +7418,34 @@ $({ }); /***/ }), -/* 242 */ +/* 256 */ /***/ ((module) => { -// eslint-disable-next-line es-x/no-math-expm1 -- safe +// eslint-disable-next-line es/no-math-expm1 -- safe var $expm1 = Math.expm1; -var exp = Math.exp; // `Math.expm1` method implementation -// https://tc39.es/ecma262/#sec-math.expm1 +var exp = Math.exp; -module.exports = !$expm1 // Old FF bug -|| $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 // Tor Browser bug +// `Math.expm1` method implementation +// https://tc39.es/ecma262/#sec-math.expm1 +module.exports = !$expm1 +// Old FF bug +|| $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 +// Tor Browser bug || $expm1(-2e-17) != -2e-17 ? function expm1(x) { var n = +x; return n == 0 ? n : n > -1e-6 && n < 1e-6 ? n + n * n / 2 : exp(n) - 1; } : $expm1; /***/ }), -/* 243 */ +/* 257 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var expm1 = __webpack_require__(256); -var expm1 = __webpack_require__(242); // `Math.expm1` method +// `Math.expm1` method // https://tc39.es/ecma262/#sec-math.expm1 -// eslint-disable-next-line es-x/no-math-expm1 -- required for testing - - +// eslint-disable-next-line es/no-math-expm1 -- required for testing $({ target: 'Math', stat: true, @@ -8494,15 +7455,14 @@ $({ }); /***/ }), -/* 244 */ +/* 258 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var fround = __webpack_require__(259); -var fround = __webpack_require__(245); // `Math.fround` method +// `Math.fround` method // https://tc39.es/ecma262/#sec-math.fround - - $({ target: 'Math', stat: true @@ -8511,25 +7471,23 @@ $({ }); /***/ }), -/* 245 */ +/* 259 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var sign = __webpack_require__(239); - +var sign = __webpack_require__(253); var abs = Math.abs; var pow = Math.pow; var EPSILON = pow(2, -52); var EPSILON32 = pow(2, -23); var MAX32 = pow(2, 127) * (2 - EPSILON32); var MIN32 = pow(2, -126); - var roundTiesToEven = function (n) { return n + 1 / EPSILON - 1 / EPSILON; -}; // `Math.fround` method implementation +}; + +// `Math.fround` method implementation // https://tc39.es/ecma262/#sec-math.fround -// eslint-disable-next-line es-x/no-math-fround -- safe - - +// eslint-disable-next-line es/no-math-fround -- safe module.exports = Math.fround || function fround(x) { var n = +x; var $abs = abs(n); @@ -8537,32 +7495,34 @@ module.exports = Math.fround || function fround(x) { var a, result; if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; a = (1 + EPSILON32 / EPSILON) * $abs; - result = a - (a - $abs); // eslint-disable-next-line no-self-compare -- NaN check - + result = a - (a - $abs); + // eslint-disable-next-line no-self-compare -- NaN check if (result > MAX32 || result != result) return $sign * Infinity; return $sign * result; }; /***/ }), -/* 246 */ +/* 260 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var $ = __webpack_require__(3); // eslint-disable-next-line es-x/no-math-hypot -- required for testing - +var $ = __webpack_require__(3); +// eslint-disable-next-line es/no-math-hypot -- required for testing var $hypot = Math.hypot; var abs = Math.abs; -var sqrt = Math.sqrt; // Chrome 77 bug +var sqrt = Math.sqrt; + +// Chrome 77 bug // https://bugs.chromium.org/p/v8/issues/detail?id=9546 +var FORCED = !!$hypot && $hypot(Infinity, NaN) !== Infinity; -var BUGGY = !!$hypot && $hypot(Infinity, NaN) !== Infinity; // `Math.hypot` method +// `Math.hypot` method // https://tc39.es/ecma262/#sec-math.hypot - $({ target: 'Math', stat: true, arity: 2, - forced: BUGGY + forced: FORCED }, { // eslint-disable-next-line no-unused-vars -- required for `.length` hypot: function hypot(value1, value2) { @@ -8571,10 +7531,8 @@ $({ var aLen = arguments.length; var larg = 0; var arg, div; - while (i < aLen) { arg = abs(arguments[i++]); - if (larg < arg) { div = larg / arg; sum = sum * div * div + 1; @@ -8584,27 +7542,26 @@ $({ sum += div * div; } else sum += arg; } - return larg === Infinity ? Infinity : larg * sqrt(sum); } }); /***/ }), -/* 247 */ +/* 261 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var fails = __webpack_require__(7); -var fails = __webpack_require__(7); // eslint-disable-next-line es-x/no-math-imul -- required for testing - - +// eslint-disable-next-line es/no-math-imul -- required for testing var $imul = Math.imul; var FORCED = fails(function () { return $imul(0xFFFFFFFF, 5) != -5 || $imul.length != 2; -}); // `Math.imul` method +}); + +// `Math.imul` method // https://tc39.es/ecma262/#sec-math.imul // some WebKit versions fails with big numbers, some has wrong arity - $({ target: 'Math', stat: true, @@ -8621,15 +7578,14 @@ $({ }); /***/ }), -/* 248 */ +/* 262 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var log10 = __webpack_require__(263); -var log10 = __webpack_require__(249); // `Math.log10` method +// `Math.log10` method // https://tc39.es/ecma262/#sec-math.log10 - - $({ target: 'Math', stat: true @@ -8638,26 +7594,26 @@ $({ }); /***/ }), -/* 249 */ +/* 263 */ /***/ ((module) => { var log = Math.log; -var LOG10E = Math.LOG10E; // eslint-disable-next-line es-x/no-math-log10 -- safe +var LOG10E = Math.LOG10E; +// eslint-disable-next-line es/no-math-log10 -- safe module.exports = Math.log10 || function log10(x) { return log(x) * LOG10E; }; /***/ }), -/* 250 */ +/* 264 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var log1p = __webpack_require__(249); -var log1p = __webpack_require__(235); // `Math.log1p` method +// `Math.log1p` method // https://tc39.es/ecma262/#sec-math.log1p - - $({ target: 'Math', stat: true @@ -8666,15 +7622,15 @@ $({ }); /***/ }), -/* 251 */ +/* 265 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var log = Math.log; -var LN2 = Math.LN2; // `Math.log2` method -// https://tc39.es/ecma262/#sec-math.log2 +var LN2 = Math.LN2; +// `Math.log2` method +// https://tc39.es/ecma262/#sec-math.log2 $({ target: 'Math', stat: true @@ -8685,15 +7641,14 @@ $({ }); /***/ }), -/* 252 */ +/* 266 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var sign = __webpack_require__(253); -var sign = __webpack_require__(239); // `Math.sign` method +// `Math.sign` method // https://tc39.es/ecma262/#sec-math.sign - - $({ target: 'Math', stat: true @@ -8702,25 +7657,23 @@ $({ }); /***/ }), -/* 253 */ +/* 267 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var fails = __webpack_require__(7); - -var expm1 = __webpack_require__(242); - +var expm1 = __webpack_require__(256); var abs = Math.abs; var exp = Math.exp; var E = Math.E; var FORCED = fails(function () { - // eslint-disable-next-line es-x/no-math-sinh -- required for testing + // eslint-disable-next-line es/no-math-sinh -- required for testing return Math.sinh(-2e-17) != -2e-17; -}); // `Math.sinh` method +}); + +// `Math.sinh` method // https://tc39.es/ecma262/#sec-math.sinh // V8 near Chromium 38 has a problem with very small numbers - $({ target: 'Math', stat: true, @@ -8733,16 +7686,15 @@ $({ }); /***/ }), -/* 254 */ +/* 268 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var expm1 = __webpack_require__(256); +var exp = Math.exp; -var expm1 = __webpack_require__(242); - -var exp = Math.exp; // `Math.tanh` method +// `Math.tanh` method // https://tc39.es/ecma262/#sec-math.tanh - $({ target: 'Math', stat: true @@ -8756,25 +7708,24 @@ $({ }); /***/ }), -/* 255 */ +/* 269 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var setToStringTag = __webpack_require__(82); // Math[@@toStringTag] property +var setToStringTag = __webpack_require__(84); + +// Math[@@toStringTag] property // https://tc39.es/ecma262/#sec-math-@@tostringtag - - setToStringTag(Math, 'Math', true); /***/ }), -/* 256 */ +/* 270 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var trunc = __webpack_require__(63); -var trunc = __webpack_require__(62); // `Math.trunc` method +// `Math.trunc` method // https://tc39.es/ecma262/#sec-math.trunc - - $({ target: 'Math', stat: true @@ -8783,68 +7734,54 @@ $({ }); /***/ }), -/* 257 */ +/* 271 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; +var $ = __webpack_require__(3); +var IS_PURE = __webpack_require__(36); var DESCRIPTORS = __webpack_require__(6); - var global = __webpack_require__(4); - +var path = __webpack_require__(82); var uncurryThis = __webpack_require__(14); - -var isForced = __webpack_require__(67); - -var defineBuiltIn = __webpack_require__(47); - -var hasOwn = __webpack_require__(38); - -var inheritIfRequired = __webpack_require__(115); - -var isPrototypeOf = __webpack_require__(24); - -var isSymbol = __webpack_require__(22); - +var isForced = __webpack_require__(68); +var hasOwn = __webpack_require__(39); +var inheritIfRequired = __webpack_require__(120); +var isPrototypeOf = __webpack_require__(25); +var isSymbol = __webpack_require__(23); var toPrimitive = __webpack_require__(19); - var fails = __webpack_require__(7); - -var getOwnPropertyNames = (__webpack_require__(57).f); - +var getOwnPropertyNames = (__webpack_require__(58).f); var getOwnPropertyDescriptor = (__webpack_require__(5).f); - -var defineProperty = (__webpack_require__(44).f); - -var thisNumberValue = __webpack_require__(258); - -var trim = (__webpack_require__(259).trim); - +var defineProperty = (__webpack_require__(45).f); +var thisNumberValue = __webpack_require__(272); +var trim = (__webpack_require__(273).trim); var NUMBER = 'Number'; var NativeNumber = global[NUMBER]; +var PureNumberNamespace = path[NUMBER]; var NumberPrototype = NativeNumber.prototype; var TypeError = global.TypeError; -var arraySlice = uncurryThis(''.slice); -var charCodeAt = uncurryThis(''.charCodeAt); // `ToNumeric` abstract operation -// https://tc39.es/ecma262/#sec-tonumeric +var stringSlice = uncurryThis(''.slice); +var charCodeAt = uncurryThis(''.charCodeAt); +// `ToNumeric` abstract operation +// https://tc39.es/ecma262/#sec-tonumeric var toNumeric = function (value) { var primValue = toPrimitive(value, 'number'); return typeof primValue == 'bigint' ? primValue : toNumber(primValue); -}; // `ToNumber` abstract operation +}; + +// `ToNumber` abstract operation // https://tc39.es/ecma262/#sec-tonumber - - var toNumber = function (argument) { var it = toPrimitive(argument, 'number'); var first, third, radix, maxCode, digits, length, index, code; if (isSymbol(it)) throw TypeError('Cannot convert a Symbol value to a number'); - if (typeof it == 'string' && it.length > 2) { it = trim(it); first = charCodeAt(it, 0); - if (first === 43 || first === 45) { third = charCodeAt(it, 2); if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix @@ -8856,99 +7793,101 @@ var toNumber = function (argument) { maxCode = 49; break; // fast equal of /^0b[01]+$/i - case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i - default: return +it; } - - digits = arraySlice(it, 2); + digits = stringSlice(it, 2); length = digits.length; - for (index = 0; index < length; index++) { - code = charCodeAt(digits, index); // parseInt parses a string to a first unavailable symbol + code = charCodeAt(digits, index); + // parseInt parses a string to a first unavailable symbol // but ToNumber should return NaN if a string contains unavailable symbols - if (code < 48 || code > maxCode) return NaN; } - return parseInt(digits, radix); } } - return +it; -}; // `Number` constructor +}; +var FORCED = isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1')); +var calledWithNew = function (dummy) { + // includes check on 1..constructor(foo) case + return isPrototypeOf(NumberPrototype, dummy) && fails(function () { + thisNumberValue(dummy); + }); +}; + +// `Number` constructor // https://tc39.es/ecma262/#sec-number-constructor +var NumberWrapper = function Number(value) { + var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value)); + return calledWithNew(this) ? inheritIfRequired(Object(n), this, NumberWrapper) : n; +}; +NumberWrapper.prototype = NumberPrototype; +if (FORCED && !IS_PURE) NumberPrototype.constructor = NumberWrapper; +$({ + global: true, + constructor: true, + wrap: true, + forced: FORCED +}, { + Number: NumberWrapper +}); - -if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) { - var NumberWrapper = function Number(value) { - var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value)); - var dummy = this; // check on 1..constructor(foo) case - - return isPrototypeOf(NumberPrototype, dummy) && fails(function () { - thisNumberValue(dummy); - }) ? inheritIfRequired(Object(n), dummy, NumberWrapper) : n; - }; - - for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : ( // ES3: - 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + // ES2015 (in case, if modules with ES2015 Number statics required before): - 'EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,' + // ESNext - 'fromString,range').split(','), j = 0, key; keys.length > j; j++) { - if (hasOwn(NativeNumber, key = keys[j]) && !hasOwn(NumberWrapper, key)) { - defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key)); +// Use `internal/copy-constructor-properties` helper in `core-js@4` +var copyConstructorProperties = function (target, source) { + for (var keys = DESCRIPTORS ? getOwnPropertyNames(source) : ( + // ES3: + 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + + // ES2015 (in case, if modules with ES2015 Number statics required before): + 'EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,' + + // ESNext + 'fromString,range').split(','), j = 0, key; keys.length > j; j++) { + if (hasOwn(source, key = keys[j]) && !hasOwn(target, key)) { + defineProperty(target, key, getOwnPropertyDescriptor(source, key)); } } - - NumberWrapper.prototype = NumberPrototype; - NumberPrototype.constructor = NumberWrapper; - defineBuiltIn(global, NUMBER, NumberWrapper, { - constructor: true - }); -} +}; +if (IS_PURE && PureNumberNamespace) copyConstructorProperties(path[NUMBER], PureNumberNamespace); +if (FORCED || IS_PURE) copyConstructorProperties(path[NUMBER], NativeNumber); /***/ }), -/* 258 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var uncurryThis = __webpack_require__(14); // `thisNumberValue` abstract operation -// https://tc39.es/ecma262/#sec-thisnumbervalue - - -module.exports = uncurryThis(1.0.valueOf); - -/***/ }), -/* 259 */ +/* 272 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(14); +// `thisNumberValue` abstract operation +// https://tc39.es/ecma262/#sec-thisnumbervalue +module.exports = uncurryThis(1.0.valueOf); + +/***/ }), +/* 273 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var uncurryThis = __webpack_require__(14); var requireObjectCoercible = __webpack_require__(16); - -var toString = __webpack_require__(68); - -var whitespaces = __webpack_require__(260); - +var toString = __webpack_require__(69); +var whitespaces = __webpack_require__(274); var replace = uncurryThis(''.replace); -var whitespace = '[' + whitespaces + ']'; -var ltrim = RegExp('^' + whitespace + whitespace + '*'); -var rtrim = RegExp(whitespace + whitespace + '*$'); // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation +var ltrim = RegExp('^[' + whitespaces + ']+'); +var rtrim = RegExp('(^|[^' + whitespaces + '])[' + whitespaces + ']+$'); +// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation var createMethod = function (TYPE) { return function ($this) { var string = toString(requireObjectCoercible($this)); if (TYPE & 1) string = replace(string, ltrim, ''); - if (TYPE & 2) string = replace(string, rtrim, ''); + if (TYPE & 2) string = replace(string, rtrim, '$1'); return string; }; }; - module.exports = { // `String.prototype.{ trimLeft, trimStart }` methods // https://tc39.es/ecma262/#sec-string.prototype.trimstart @@ -8962,20 +7901,20 @@ module.exports = { }; /***/ }), -/* 260 */ +/* 274 */ /***/ ((module) => { // a string of all valid unicode whitespaces module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' + '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; /***/ }), -/* 261 */ +/* 275 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var $ = __webpack_require__(3); // `Number.EPSILON` constant +var $ = __webpack_require__(3); + +// `Number.EPSILON` constant // https://tc39.es/ecma262/#sec-number.epsilon - - $({ target: 'Number', stat: true, @@ -8986,15 +7925,14 @@ $({ }); /***/ }), -/* 262 */ +/* 276 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var numberIsFinite = __webpack_require__(277); -var numberIsFinite = __webpack_require__(263); // `Number.isFinite` method +// `Number.isFinite` method // https://tc39.es/ecma262/#sec-number.isfinite - - $({ target: 'Number', stat: true @@ -9003,29 +7941,28 @@ $({ }); /***/ }), -/* 263 */ +/* 277 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4); +var globalIsFinite = global.isFinite; -var globalIsFinite = global.isFinite; // `Number.isFinite` method +// `Number.isFinite` method // https://tc39.es/ecma262/#sec-number.isfinite -// eslint-disable-next-line es-x/no-number-isfinite -- safe - +// eslint-disable-next-line es/no-number-isfinite -- safe module.exports = Number.isFinite || function isFinite(it) { return typeof it == 'number' && globalIsFinite(it); }; /***/ }), -/* 264 */ +/* 278 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var isIntegralNumber = __webpack_require__(279); -var isIntegralNumber = __webpack_require__(265); // `Number.isInteger` method +// `Number.isInteger` method // https://tc39.es/ecma262/#sec-number.isinteger - - $({ target: 'Number', stat: true @@ -9034,27 +7971,27 @@ $({ }); /***/ }), -/* 265 */ +/* 279 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isObject = __webpack_require__(20); +var floor = Math.floor; -var floor = Math.floor; // `IsIntegralNumber` abstract operation +// `IsIntegralNumber` abstract operation // https://tc39.es/ecma262/#sec-isintegralnumber -// eslint-disable-next-line es-x/no-number-isinteger -- safe - +// eslint-disable-next-line es/no-number-isinteger -- safe module.exports = Number.isInteger || function isInteger(it) { return !isObject(it) && isFinite(it) && floor(it) === it; }; /***/ }), -/* 266 */ +/* 280 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var $ = __webpack_require__(3); // `Number.isNaN` method +var $ = __webpack_require__(3); + +// `Number.isNaN` method // https://tc39.es/ecma262/#sec-number.isnan - - $({ target: 'Number', stat: true @@ -9066,16 +8003,15 @@ $({ }); /***/ }), -/* 267 */ +/* 281 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var isIntegralNumber = __webpack_require__(279); +var abs = Math.abs; -var isIntegralNumber = __webpack_require__(265); - -var abs = Math.abs; // `Number.isSafeInteger` method +// `Number.isSafeInteger` method // https://tc39.es/ecma262/#sec-number.issafeinteger - $({ target: 'Number', stat: true @@ -9086,13 +8022,13 @@ $({ }); /***/ }), -/* 268 */ +/* 282 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var $ = __webpack_require__(3); // `Number.MAX_SAFE_INTEGER` constant +var $ = __webpack_require__(3); + +// `Number.MAX_SAFE_INTEGER` constant // https://tc39.es/ecma262/#sec-number.max_safe_integer - - $({ target: 'Number', stat: true, @@ -9103,13 +8039,13 @@ $({ }); /***/ }), -/* 269 */ +/* 283 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var $ = __webpack_require__(3); // `Number.MIN_SAFE_INTEGER` constant +var $ = __webpack_require__(3); + +// `Number.MIN_SAFE_INTEGER` constant // https://tc39.es/ecma262/#sec-number.min_safe_integer - - $({ target: 'Number', stat: true, @@ -9120,16 +8056,15 @@ $({ }); /***/ }), -/* 270 */ +/* 284 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var parseFloat = __webpack_require__(285); -var parseFloat = __webpack_require__(271); // `Number.parseFloat` method +// `Number.parseFloat` method // https://tc39.es/ecma262/#sec-number.parseFloat -// eslint-disable-next-line es-x/no-number-parsefloat -- required for testing - - +// eslint-disable-next-line es/no-number-parsefloat -- required for testing $({ target: 'Number', stat: true, @@ -9139,31 +8074,27 @@ $({ }); /***/ }), -/* 271 */ +/* 285 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4); - var fails = __webpack_require__(7); - var uncurryThis = __webpack_require__(14); - -var toString = __webpack_require__(68); - -var trim = (__webpack_require__(259).trim); - -var whitespaces = __webpack_require__(260); - +var toString = __webpack_require__(69); +var trim = (__webpack_require__(273).trim); +var whitespaces = __webpack_require__(274); var charAt = uncurryThis(''.charAt); var $parseFloat = global.parseFloat; var Symbol = global.Symbol; var ITERATOR = Symbol && Symbol.iterator; -var FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity // MS Edge 18- broken with boxed symbols +var FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity +// MS Edge 18- broken with boxed symbols || ITERATOR && !fails(function () { $parseFloat(Object(ITERATOR)); -}); // `parseFloat` method -// https://tc39.es/ecma262/#sec-parsefloat-string +}); +// `parseFloat` method +// https://tc39.es/ecma262/#sec-parsefloat-string module.exports = FORCED ? function parseFloat(string) { var trimmedString = trim(toString(string)); var result = $parseFloat(trimmedString); @@ -9171,16 +8102,15 @@ module.exports = FORCED ? function parseFloat(string) { } : $parseFloat; /***/ }), -/* 272 */ +/* 286 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var parseInt = __webpack_require__(287); -var parseInt = __webpack_require__(273); // `Number.parseInt` method +// `Number.parseInt` method // https://tc39.es/ecma262/#sec-number.parseint -// eslint-disable-next-line es-x/no-number-parseint -- required for testing - - +// eslint-disable-next-line es/no-number-parseint -- required for testing $({ target: 'Number', stat: true, @@ -9190,58 +8120,47 @@ $({ }); /***/ }), -/* 273 */ +/* 287 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4); - var fails = __webpack_require__(7); - var uncurryThis = __webpack_require__(14); - -var toString = __webpack_require__(68); - -var trim = (__webpack_require__(259).trim); - -var whitespaces = __webpack_require__(260); - +var toString = __webpack_require__(69); +var trim = (__webpack_require__(273).trim); +var whitespaces = __webpack_require__(274); var $parseInt = global.parseInt; var Symbol = global.Symbol; var ITERATOR = Symbol && Symbol.iterator; var hex = /^[+-]?0x/i; var exec = uncurryThis(hex.exec); -var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22 // MS Edge 18- broken with boxed symbols +var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22 +// MS Edge 18- broken with boxed symbols || ITERATOR && !fails(function () { $parseInt(Object(ITERATOR)); -}); // `parseInt` method -// https://tc39.es/ecma262/#sec-parseint-string-radix +}); +// `parseInt` method +// https://tc39.es/ecma262/#sec-parseint-string-radix module.exports = FORCED ? function parseInt(string, radix) { var S = trim(toString(string)); return $parseInt(S, radix >>> 0 || (exec(hex, S) ? 16 : 10)); } : $parseInt; /***/ }), -/* 274 */ +/* 288 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var uncurryThis = __webpack_require__(14); - -var toIntegerOrInfinity = __webpack_require__(61); - -var thisNumberValue = __webpack_require__(258); - -var $repeat = __webpack_require__(214); - -var log10 = __webpack_require__(249); - +var toIntegerOrInfinity = __webpack_require__(62); +var thisNumberValue = __webpack_require__(272); +var $repeat = __webpack_require__(228); +var log10 = __webpack_require__(263); var fails = __webpack_require__(7); - var $RangeError = RangeError; var $String = String; var $isFinite = isFinite; @@ -9251,27 +8170,37 @@ var pow = Math.pow; var round = Math.round; var nativeToExponential = uncurryThis(1.0.toExponential); var repeat = uncurryThis($repeat); -var stringSlice = uncurryThis(''.slice); // Edge 17- +var stringSlice = uncurryThis(''.slice); -var ROUNDS_PROPERLY = nativeToExponential(-6.9e-11, 4) === '-6.9000e-11' // IE11- && Edge 14- -&& nativeToExponential(1.255, 2) === '1.25e+0' // FF86-, V8 ~ Chrome 49-50 -&& nativeToExponential(12345, 3) === '1.235e+4' // FF86-, V8 ~ Chrome 49-50 -&& nativeToExponential(25, 0) === '3e+1'; // IE8- +// Edge 17- +var ROUNDS_PROPERLY = nativeToExponential(-6.9e-11, 4) === '-6.9000e-11' +// IE11- && Edge 14- +&& nativeToExponential(1.255, 2) === '1.25e+0' +// FF86-, V8 ~ Chrome 49-50 +&& nativeToExponential(12345, 3) === '1.235e+4' +// FF86-, V8 ~ Chrome 49-50 +&& nativeToExponential(25, 0) === '3e+1'; -var THROWS_ON_INFINITY_FRACTION = fails(function () { - nativeToExponential(1, Infinity); -}) && fails(function () { - nativeToExponential(1, -Infinity); -}); // Safari <11 && FF <50 +// IE8- +var throwsOnInfinityFraction = function () { + return fails(function () { + nativeToExponential(1, Infinity); + }) && fails(function () { + nativeToExponential(1, -Infinity); + }); +}; -var PROPER_NON_FINITE_THIS_CHECK = !fails(function () { - nativeToExponential(Infinity, Infinity); -}) && !fails(function () { - nativeToExponential(NaN, Infinity); -}); -var FORCED = !ROUNDS_PROPERLY || !THROWS_ON_INFINITY_FRACTION || !PROPER_NON_FINITE_THIS_CHECK; // `Number.prototype.toExponential` method +// Safari <11 && FF <50 +var properNonFiniteThisCheck = function () { + return !fails(function () { + nativeToExponential(Infinity, Infinity); + nativeToExponential(NaN, Infinity); + }); +}; +var FORCED = !ROUNDS_PROPERLY || !throwsOnInfinityFraction() || !properNonFiniteThisCheck(); + +// `Number.prototype.toExponential` method // https://tc39.es/ecma262/#sec-number.prototype.toexponential - $({ target: 'Number', proto: true, @@ -9281,8 +8210,8 @@ $({ var x = thisNumberValue(this); if (fractionDigits === undefined) return nativeToExponential(x); var f = toIntegerOrInfinity(fractionDigits); - if (!$isFinite(x)) return String(x); // TODO: ES2018 increased the maximum number of fraction digits to 100, need to improve the implementation - + if (!$isFinite(x)) return String(x); + // TODO: ES2018 increased the maximum number of fraction digits to 100, need to improve the implementation if (f < 0 || f > 20) throw $RangeError('Incorrect fraction digits'); if (ROUNDS_PROPERLY) return nativeToExponential(x, f); var s = ''; @@ -9290,12 +8219,10 @@ $({ var e = 0; var c = ''; var d = ''; - if (x < 0) { s = '-'; x = -x; } - if (x === 0) { e = 0; m = repeat('0', f + 1); @@ -9307,23 +8234,18 @@ $({ var n = 0; var w = pow(10, e - f); n = round(x / w); - if (2 * x >= (2 * n + 1) * w) { n += 1; } - if (n >= pow(10, f + 1)) { n /= 10; e += 1; } - m = $String(n); } - if (f !== 0) { m = stringSlice(m, 0, 1) + '.' + stringSlice(m, 1); } - if (e === 0) { c = '+'; d = '0'; @@ -9331,103 +8253,84 @@ $({ c = e > 0 ? '+' : '-'; d = $String(abs(e)); } - m += 'e' + c + d; return s + m; } }); /***/ }), -/* 275 */ +/* 289 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var uncurryThis = __webpack_require__(14); - -var toIntegerOrInfinity = __webpack_require__(61); - -var thisNumberValue = __webpack_require__(258); - -var $repeat = __webpack_require__(214); - +var toIntegerOrInfinity = __webpack_require__(62); +var thisNumberValue = __webpack_require__(272); +var $repeat = __webpack_require__(228); var fails = __webpack_require__(7); - var $RangeError = RangeError; var $String = String; var floor = Math.floor; var repeat = uncurryThis($repeat); var stringSlice = uncurryThis(''.slice); var nativeToFixed = uncurryThis(1.0.toFixed); - var pow = function (x, n, acc) { return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); }; - var log = function (x) { var n = 0; var x2 = x; - while (x2 >= 4096) { n += 12; x2 /= 4096; } - while (x2 >= 2) { n += 1; x2 /= 2; } - return n; }; - var multiply = function (data, n, c) { var index = -1; var c2 = c; - while (++index < 6) { c2 += n * data[index]; data[index] = c2 % 1e7; c2 = floor(c2 / 1e7); } }; - var divide = function (data, n) { var index = 6; var c = 0; - while (--index >= 0) { c += data[index]; data[index] = floor(c / n); c = c % n * 1e7; } }; - var dataToString = function (data) { var index = 6; var s = ''; - while (--index >= 0) { if (s !== '' || index === 0 || data[index] !== 0) { var t = $String(data[index]); s = s === '' ? t : s + repeat('0', 7 - t.length) + t; } } - return s; }; - var FORCED = fails(function () { return nativeToFixed(0.00008, 3) !== '0.000' || nativeToFixed(0.9, 0) !== '1' || nativeToFixed(1.255, 2) !== '1.25' || nativeToFixed(1000000000000000128.0, 0) !== '1000000000000000128'; }) || !fails(function () { // V8 ~ Android 4.3- nativeToFixed({}); -}); // `Number.prototype.toFixed` method -// https://tc39.es/ecma262/#sec-number.prototype.tofixed +}); +// `Number.prototype.toFixed` method +// https://tc39.es/ecma262/#sec-number.prototype.tofixed $({ target: 'Number', proto: true, @@ -9439,41 +8342,35 @@ $({ var data = [0, 0, 0, 0, 0, 0]; var sign = ''; var result = '0'; - var e, z, j, k; // TODO: ES2018 increased the maximum number of fraction digits to 100, need to improve the implementation - - if (fractDigits < 0 || fractDigits > 20) throw $RangeError('Incorrect fraction digits'); // eslint-disable-next-line no-self-compare -- NaN check + var e, z, j, k; + // TODO: ES2018 increased the maximum number of fraction digits to 100, need to improve the implementation + if (fractDigits < 0 || fractDigits > 20) throw $RangeError('Incorrect fraction digits'); + // eslint-disable-next-line no-self-compare -- NaN check if (number != number) return 'NaN'; if (number <= -1e21 || number >= 1e21) return $String(number); - if (number < 0) { sign = '-'; number = -number; } - if (number > 1e-21) { e = log(number * pow(2, 69, 1)) - 69; z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1); z *= 0x10000000000000; e = 52 - e; - if (e > 0) { multiply(data, 0, z); j = fractDigits; - while (j >= 7) { multiply(data, 1e7, 0); j -= 7; } - multiply(data, pow(10, j, 1), 0); j = e - 1; - while (j >= 23) { divide(data, 1 << 23); j -= 23; } - divide(data, 1 << j); multiply(data, 1, 1); divide(data, 2); @@ -9484,33 +8381,27 @@ $({ result = dataToString(data) + repeat('0', fractDigits); } } - if (fractDigits > 0) { k = result.length; result = sign + (k <= fractDigits ? '0.' + repeat('0', fractDigits - k) + result : stringSlice(result, 0, k - fractDigits) + '.' + stringSlice(result, k - fractDigits)); } else { result = sign + result; } - return result; } }); /***/ }), -/* 276 */ +/* 290 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var uncurryThis = __webpack_require__(14); - var fails = __webpack_require__(7); - -var thisNumberValue = __webpack_require__(258); - +var thisNumberValue = __webpack_require__(272); var nativeToPrecision = uncurryThis(1.0.toPrecision); var FORCED = fails(function () { // IE7- @@ -9518,9 +8409,10 @@ var FORCED = fails(function () { }) || !fails(function () { // V8 ~ Android 4.3- nativeToPrecision({}); -}); // `Number.prototype.toPrecision` method -// https://tc39.es/ecma262/#sec-number.prototype.toprecision +}); +// `Number.prototype.toPrecision` method +// https://tc39.es/ecma262/#sec-number.prototype.toprecision $({ target: 'Number', proto: true, @@ -9532,16 +8424,15 @@ $({ }); /***/ }), -/* 277 */ +/* 291 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var assign = __webpack_require__(292); -var assign = __webpack_require__(278); // `Object.assign` method +// `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign -// eslint-disable-next-line es-x/no-object-assign -- required for testing - - +// eslint-disable-next-line es/no-object-assign -- required for testing $({ target: 'Object', stat: true, @@ -9552,37 +8443,30 @@ $({ }); /***/ }), -/* 278 */ +/* 292 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var DESCRIPTORS = __webpack_require__(6); - var uncurryThis = __webpack_require__(14); - var call = __webpack_require__(8); - var fails = __webpack_require__(7); - -var objectKeys = __webpack_require__(73); - -var getOwnPropertySymbolsModule = __webpack_require__(66); - +var objectKeys = __webpack_require__(74); +var getOwnPropertySymbolsModule = __webpack_require__(67); var propertyIsEnumerableModule = __webpack_require__(10); +var toObject = __webpack_require__(40); +var IndexedObject = __webpack_require__(13); -var toObject = __webpack_require__(39); - -var IndexedObject = __webpack_require__(13); // eslint-disable-next-line es-x/no-object-assign -- safe - - -var $assign = Object.assign; // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing - +// eslint-disable-next-line es/no-object-assign -- safe +var $assign = Object.assign; +// eslint-disable-next-line es/no-object-defineproperty -- required for testing var defineProperty = Object.defineProperty; -var concat = uncurryThis([].concat); // `Object.assign` method -// https://tc39.es/ecma262/#sec-object.assign +var concat = uncurryThis([].concat); +// `Object.assign` method +// https://tc39.es/ecma262/#sec-object.assign module.exports = !$assign || fails(function () { // should have correct order of operations (Edge bug) if (DESCRIPTORS && $assign({ @@ -9597,11 +8481,11 @@ module.exports = !$assign || fails(function () { } }), { b: 2 - })).b !== 1) return true; // should work with symbols and should have deterministic property order (V8 bug) - + })).b !== 1) return true; + // should work with symbols and should have deterministic property order (V8 bug) var A = {}; - var B = {}; // eslint-disable-next-line es-x/no-symbol -- safe - + var B = {}; + // eslint-disable-next-line es/no-symbol -- safe var symbol = Symbol(); var alphabet = 'abcdefghijklmnopqrst'; A[symbol] = 7; @@ -9616,36 +8500,31 @@ module.exports = !$assign || fails(function () { var index = 1; var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; var propertyIsEnumerable = propertyIsEnumerableModule.f; - while (argumentsLength > index) { var S = IndexedObject(arguments[index++]); var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S); var length = keys.length; var j = 0; var key; - while (length > j) { key = keys[j++]; if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key]; } } - return T; } : $assign; /***/ }), -/* 279 */ +/* 293 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove from `core-js@4` var $ = __webpack_require__(3); - var DESCRIPTORS = __webpack_require__(6); +var create = __webpack_require__(72); -var create = __webpack_require__(71); // `Object.create` method +// `Object.create` method // https://tc39.es/ecma262/#sec-object.create - - $({ target: 'Object', stat: true, @@ -9655,26 +8534,21 @@ $({ }); /***/ }), -/* 280 */ +/* 294 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var DESCRIPTORS = __webpack_require__(6); +var FORCED = __webpack_require__(295); +var aCallable = __webpack_require__(31); +var toObject = __webpack_require__(40); +var definePropertyModule = __webpack_require__(45); -var FORCED = __webpack_require__(281); - -var aCallable = __webpack_require__(30); - -var toObject = __webpack_require__(39); - -var definePropertyModule = __webpack_require__(44); // `Object.prototype.__defineGetter__` method +// `Object.prototype.__defineGetter__` method // https://tc39.es/ecma262/#sec-object.prototype.__defineGetter__ - - if (DESCRIPTORS) { $({ target: 'Object', @@ -9692,48 +8566,40 @@ if (DESCRIPTORS) { } /***/ }), -/* 281 */ +/* 295 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var IS_PURE = __webpack_require__(35); - +var IS_PURE = __webpack_require__(36); var global = __webpack_require__(4); - var fails = __webpack_require__(7); +var WEBKIT = __webpack_require__(192); -var WEBKIT = __webpack_require__(186); // Forced replacement object prototype accessors methods - - +// Forced replacement object prototype accessors methods module.exports = IS_PURE || !fails(function () { // This feature detection crashes old WebKit // https://github.com/zloirock/core-js/issues/232 if (WEBKIT && WEBKIT < 535) return; - var key = Math.random(); // In FF throws only define methods - // eslint-disable-next-line no-undef, no-useless-call, es-x/no-legacy-object-prototype-accessor-methods -- required for testing - - __defineSetter__.call(null, key, function () { - /* empty */ - }); - + var key = Math.random(); + // In FF throws only define methods + // eslint-disable-next-line no-undef, no-useless-call, es/no-legacy-object-prototype-accessor-methods -- required for testing + __defineSetter__.call(null, key, function () {/* empty */}); delete global[key]; }); /***/ }), -/* 282 */ +/* 296 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var DESCRIPTORS = __webpack_require__(6); +var defineProperties = (__webpack_require__(73).f); -var defineProperties = (__webpack_require__(72).f); // `Object.defineProperties` method +// `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties -// eslint-disable-next-line es-x/no-object-defineproperties -- safe - - +// eslint-disable-next-line es/no-object-defineproperties -- safe $({ target: 'Object', stat: true, @@ -9744,18 +8610,16 @@ $({ }); /***/ }), -/* 283 */ +/* 297 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var DESCRIPTORS = __webpack_require__(6); +var defineProperty = (__webpack_require__(45).f); -var defineProperty = (__webpack_require__(44).f); // `Object.defineProperty` method +// `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty -// eslint-disable-next-line es-x/no-object-defineproperty -- safe - - +// eslint-disable-next-line es/no-object-defineproperty -- safe $({ target: 'Object', stat: true, @@ -9766,26 +8630,21 @@ $({ }); /***/ }), -/* 284 */ +/* 298 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var DESCRIPTORS = __webpack_require__(6); +var FORCED = __webpack_require__(295); +var aCallable = __webpack_require__(31); +var toObject = __webpack_require__(40); +var definePropertyModule = __webpack_require__(45); -var FORCED = __webpack_require__(281); - -var aCallable = __webpack_require__(30); - -var toObject = __webpack_require__(39); - -var definePropertyModule = __webpack_require__(44); // `Object.prototype.__defineSetter__` method +// `Object.prototype.__defineSetter__` method // https://tc39.es/ecma262/#sec-object.prototype.__defineSetter__ - - if (DESCRIPTORS) { $({ target: 'Object', @@ -9803,15 +8662,14 @@ if (DESCRIPTORS) { } /***/ }), -/* 285 */ +/* 299 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var $entries = (__webpack_require__(300).entries); -var $entries = (__webpack_require__(286).entries); // `Object.entries` method +// `Object.entries` method // https://tc39.es/ecma262/#sec-object.entries - - $({ target: 'Object', stat: true @@ -9822,22 +8680,18 @@ $({ }); /***/ }), -/* 286 */ +/* 300 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(6); - var uncurryThis = __webpack_require__(14); - -var objectKeys = __webpack_require__(73); - +var objectKeys = __webpack_require__(74); var toIndexedObject = __webpack_require__(12); - var $propertyIsEnumerable = (__webpack_require__(10).f); - var propertyIsEnumerable = uncurryThis($propertyIsEnumerable); -var push = uncurryThis([].push); // `Object.{ entries, values }` methods implementation +var push = uncurryThis([].push); +// `Object.{ entries, values }` methods implementation var createMethod = function (TO_ENTRIES) { return function (it) { var O = toIndexedObject(it); @@ -9846,19 +8700,15 @@ var createMethod = function (TO_ENTRIES) { var i = 0; var result = []; var key; - while (length > i) { key = keys[i++]; - if (!DESCRIPTORS || propertyIsEnumerable(O, key)) { push(result, TO_ENTRIES ? [key, O[key]] : O[key]); } } - return result; }; }; - module.exports = { // `Object.entries` method // https://tc39.es/ecma262/#sec-object.entries @@ -9869,26 +8719,23 @@ module.exports = { }; /***/ }), -/* 287 */ +/* 301 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - -var FREEZING = __webpack_require__(232); - +var FREEZING = __webpack_require__(246); var fails = __webpack_require__(7); - var isObject = __webpack_require__(20); +var onFreeze = (__webpack_require__(243).onFreeze); -var onFreeze = (__webpack_require__(229).onFreeze); // eslint-disable-next-line es-x/no-object-freeze -- safe - - +// eslint-disable-next-line es/no-object-freeze -- safe var $freeze = Object.freeze; var FAILS_ON_PRIMITIVES = fails(function () { $freeze(1); -}); // `Object.freeze` method -// https://tc39.es/ecma262/#sec-object.freeze +}); +// `Object.freeze` method +// https://tc39.es/ecma262/#sec-object.freeze $({ target: 'Object', stat: true, @@ -9901,17 +8748,15 @@ $({ }); /***/ }), -/* 288 */ +/* 302 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var iterate = __webpack_require__(132); +var createProperty = __webpack_require__(78); -var iterate = __webpack_require__(126); - -var createProperty = __webpack_require__(77); // `Object.fromEntries` method +// `Object.fromEntries` method // https://github.com/tc39/proposal-object-from-entries - - $({ target: 'Object', stat: true @@ -9928,25 +8773,20 @@ $({ }); /***/ }), -/* 289 */ +/* 303 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var fails = __webpack_require__(7); - var toIndexedObject = __webpack_require__(12); - var nativeGetOwnPropertyDescriptor = (__webpack_require__(5).f); - var DESCRIPTORS = __webpack_require__(6); - -var FAILS_ON_PRIMITIVES = fails(function () { +var FORCED = !DESCRIPTORS || fails(function () { nativeGetOwnPropertyDescriptor(1); }); -var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES; // `Object.getOwnPropertyDescriptor` method -// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor +// `Object.getOwnPropertyDescriptor` method +// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor $({ target: 'Object', stat: true, @@ -9959,23 +8799,18 @@ $({ }); /***/ }), -/* 290 */ +/* 304 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var DESCRIPTORS = __webpack_require__(6); - -var ownKeys = __webpack_require__(56); - +var ownKeys = __webpack_require__(57); var toIndexedObject = __webpack_require__(12); - var getOwnPropertyDescriptorModule = __webpack_require__(5); +var createProperty = __webpack_require__(78); -var createProperty = __webpack_require__(77); // `Object.getOwnPropertyDescriptors` method +// `Object.getOwnPropertyDescriptors` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors - - $({ target: 'Object', stat: true, @@ -9988,32 +8823,29 @@ $({ var result = {}; var index = 0; var key, descriptor; - while (keys.length > index) { descriptor = getOwnPropertyDescriptor(O, key = keys[index++]); if (descriptor !== undefined) createProperty(result, key, descriptor); } - return result; } }); /***/ }), -/* 291 */ +/* 305 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var fails = __webpack_require__(7); +var getOwnPropertyNames = (__webpack_require__(76).f); -var getOwnPropertyNames = (__webpack_require__(75).f); // eslint-disable-next-line es-x/no-object-getownpropertynames -- required for testing - - +// eslint-disable-next-line es/no-object-getownpropertynames -- required for testing var FAILS_ON_PRIMITIVES = fails(function () { return !Object.getOwnPropertyNames(1); -}); // `Object.getOwnPropertyNames` method -// https://tc39.es/ecma262/#sec-object.getownpropertynames +}); +// `Object.getOwnPropertyNames` method +// https://tc39.es/ecma262/#sec-object.getownpropertynames $({ target: 'Object', stat: true, @@ -10023,24 +8855,20 @@ $({ }); /***/ }), -/* 292 */ +/* 306 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var fails = __webpack_require__(7); - -var toObject = __webpack_require__(39); - -var nativeGetPrototypeOf = __webpack_require__(124); - -var CORRECT_PROTOTYPE_GETTER = __webpack_require__(125); - +var toObject = __webpack_require__(40); +var nativeGetPrototypeOf = __webpack_require__(130); +var CORRECT_PROTOTYPE_GETTER = __webpack_require__(131); var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); -}); // `Object.getPrototypeOf` method -// https://tc39.es/ecma262/#sec-object.getprototypeof +}); +// `Object.getPrototypeOf` method +// https://tc39.es/ecma262/#sec-object.getprototypeof $({ target: 'Object', stat: true, @@ -10053,15 +8881,14 @@ $({ }); /***/ }), -/* 293 */ +/* 307 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var hasOwn = __webpack_require__(39); -var hasOwn = __webpack_require__(38); // `Object.hasOwn` method +// `Object.hasOwn` method // https://github.com/tc39/proposal-accessible-object-hasownproperty - - $({ target: 'Object', stat: true @@ -10070,15 +8897,14 @@ $({ }); /***/ }), -/* 294 */ +/* 308 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var is = __webpack_require__(309); -var is = __webpack_require__(295); // `Object.is` method +// `Object.is` method // https://tc39.es/ecma262/#sec-object.is - - $({ target: 'Object', stat: true @@ -10087,28 +8913,27 @@ $({ }); /***/ }), -/* 295 */ +/* 309 */ /***/ ((module) => { // `SameValue` abstract operation // https://tc39.es/ecma262/#sec-samevalue -// eslint-disable-next-line es-x/no-object-is -- safe +// eslint-disable-next-line es/no-object-is -- safe module.exports = Object.is || function is(x, y) { // eslint-disable-next-line no-self-compare -- NaN check return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; }; /***/ }), -/* 296 */ +/* 310 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var $isExtensible = __webpack_require__(244); -var $isExtensible = __webpack_require__(230); // `Object.isExtensible` method +// `Object.isExtensible` method // https://tc39.es/ecma262/#sec-object.isextensible -// eslint-disable-next-line es-x/no-object-isextensible -- safe - - +// eslint-disable-next-line es/no-object-isextensible -- safe $({ target: 'Object', stat: true, @@ -10118,30 +8943,27 @@ $({ }); /***/ }), -/* 297 */ +/* 311 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var fails = __webpack_require__(7); - var isObject = __webpack_require__(20); - var classof = __webpack_require__(15); +var ARRAY_BUFFER_NON_EXTENSIBLE = __webpack_require__(245); -var ARRAY_BUFFER_NON_EXTENSIBLE = __webpack_require__(231); // eslint-disable-next-line es-x/no-object-isfrozen -- safe - - +// eslint-disable-next-line es/no-object-isfrozen -- safe var $isFrozen = Object.isFrozen; -var FAILS_ON_PRIMITIVES = fails(function () { +var FORCED = ARRAY_BUFFER_NON_EXTENSIBLE || fails(function () { $isFrozen(1); -}); // `Object.isFrozen` method -// https://tc39.es/ecma262/#sec-object.isfrozen +}); +// `Object.isFrozen` method +// https://tc39.es/ecma262/#sec-object.isfrozen $({ target: 'Object', stat: true, - forced: FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE + forced: FORCED }, { isFrozen: function isFrozen(it) { if (!isObject(it)) return true; @@ -10151,30 +8973,27 @@ $({ }); /***/ }), -/* 298 */ +/* 312 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var fails = __webpack_require__(7); - var isObject = __webpack_require__(20); - var classof = __webpack_require__(15); +var ARRAY_BUFFER_NON_EXTENSIBLE = __webpack_require__(245); -var ARRAY_BUFFER_NON_EXTENSIBLE = __webpack_require__(231); // eslint-disable-next-line es-x/no-object-issealed -- safe - - +// eslint-disable-next-line es/no-object-issealed -- safe var $isSealed = Object.isSealed; -var FAILS_ON_PRIMITIVES = fails(function () { +var FORCED = ARRAY_BUFFER_NON_EXTENSIBLE || fails(function () { $isSealed(1); -}); // `Object.isSealed` method -// https://tc39.es/ecma262/#sec-object.issealed +}); +// `Object.isSealed` method +// https://tc39.es/ecma262/#sec-object.issealed $({ target: 'Object', stat: true, - forced: FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE + forced: FORCED }, { isSealed: function isSealed(it) { if (!isObject(it)) return true; @@ -10184,22 +9003,19 @@ $({ }); /***/ }), -/* 299 */ +/* 313 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - -var toObject = __webpack_require__(39); - -var nativeKeys = __webpack_require__(73); - +var toObject = __webpack_require__(40); +var nativeKeys = __webpack_require__(74); var fails = __webpack_require__(7); - var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); -}); // `Object.keys` method -// https://tc39.es/ecma262/#sec-object.keys +}); +// `Object.keys` method +// https://tc39.es/ecma262/#sec-object.keys $({ target: 'Object', stat: true, @@ -10211,28 +9027,22 @@ $({ }); /***/ }), -/* 300 */ +/* 314 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var DESCRIPTORS = __webpack_require__(6); - -var FORCED = __webpack_require__(281); - -var toObject = __webpack_require__(39); - +var FORCED = __webpack_require__(295); +var toObject = __webpack_require__(40); var toPropertyKey = __webpack_require__(18); +var getPrototypeOf = __webpack_require__(130); +var getOwnPropertyDescriptor = (__webpack_require__(5).f); -var getPrototypeOf = __webpack_require__(124); - -var getOwnPropertyDescriptor = (__webpack_require__(5).f); // `Object.prototype.__lookupGetter__` method +// `Object.prototype.__lookupGetter__` method // https://tc39.es/ecma262/#sec-object.prototype.__lookupGetter__ - - if (DESCRIPTORS) { $({ target: 'Object', @@ -10243,7 +9053,6 @@ if (DESCRIPTORS) { var O = toObject(this); var key = toPropertyKey(P); var desc; - do { if (desc = getOwnPropertyDescriptor(O, key)) return desc.get; } while (O = getPrototypeOf(O)); @@ -10252,28 +9061,22 @@ if (DESCRIPTORS) { } /***/ }), -/* 301 */ +/* 315 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var DESCRIPTORS = __webpack_require__(6); - -var FORCED = __webpack_require__(281); - -var toObject = __webpack_require__(39); - +var FORCED = __webpack_require__(295); +var toObject = __webpack_require__(40); var toPropertyKey = __webpack_require__(18); +var getPrototypeOf = __webpack_require__(130); +var getOwnPropertyDescriptor = (__webpack_require__(5).f); -var getPrototypeOf = __webpack_require__(124); - -var getOwnPropertyDescriptor = (__webpack_require__(5).f); // `Object.prototype.__lookupSetter__` method +// `Object.prototype.__lookupSetter__` method // https://tc39.es/ecma262/#sec-object.prototype.__lookupSetter__ - - if (DESCRIPTORS) { $({ target: 'Object', @@ -10284,7 +9087,6 @@ if (DESCRIPTORS) { var O = toObject(this); var key = toPropertyKey(P); var desc; - do { if (desc = getOwnPropertyDescriptor(O, key)) return desc.set; } while (O = getPrototypeOf(O)); @@ -10293,26 +9095,23 @@ if (DESCRIPTORS) { } /***/ }), -/* 302 */ +/* 316 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var isObject = __webpack_require__(20); +var onFreeze = (__webpack_require__(243).onFreeze); +var FREEZING = __webpack_require__(246); +var fails = __webpack_require__(7); -var onFreeze = (__webpack_require__(229).onFreeze); - -var FREEZING = __webpack_require__(232); - -var fails = __webpack_require__(7); // eslint-disable-next-line es-x/no-object-preventextensions -- safe - - +// eslint-disable-next-line es/no-object-preventextensions -- safe var $preventExtensions = Object.preventExtensions; var FAILS_ON_PRIMITIVES = fails(function () { $preventExtensions(1); -}); // `Object.preventExtensions` method -// https://tc39.es/ecma262/#sec-object.preventextensions +}); +// `Object.preventExtensions` method +// https://tc39.es/ecma262/#sec-object.preventextensions $({ target: 'Object', stat: true, @@ -10325,30 +9124,27 @@ $({ }); /***/ }), -/* 303 */ +/* 317 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var DESCRIPTORS = __webpack_require__(6); - -var defineBuiltInAccessor = __webpack_require__(304); - +var defineBuiltInAccessor = __webpack_require__(79); var isObject = __webpack_require__(20); +var toObject = __webpack_require__(40); +var requireObjectCoercible = __webpack_require__(16); -var toObject = __webpack_require__(39); - -var requireObjectCoercible = __webpack_require__(16); // eslint-disable-next-line es-x/no-object-getprototypeof -- safe - - -var getPrototypeOf = Object.getPrototypeOf; // eslint-disable-next-line es-x/no-object-setprototypeof -- safe - +// eslint-disable-next-line es/no-object-getprototypeof -- safe +var getPrototypeOf = Object.getPrototypeOf; +// eslint-disable-next-line es/no-object-setprototypeof -- safe var setPrototypeOf = Object.setPrototypeOf; var ObjectPrototype = Object.prototype; -var PROTO = '__proto__'; // `Object.prototype.__proto__` accessor -// https://tc39.es/ecma262/#sec-object.prototype.__proto__ +var PROTO = '__proto__'; +// `Object.prototype.__proto__` accessor +// https://tc39.es/ecma262/#sec-object.prototype.__proto__ if (DESCRIPTORS && getPrototypeOf && setPrototypeOf && !(PROTO in ObjectPrototype)) try { defineBuiltInAccessor(ObjectPrototype, PROTO, { configurable: true, @@ -10361,49 +9157,26 @@ if (DESCRIPTORS && getPrototypeOf && setPrototypeOf && !(PROTO in ObjectPrototyp setPrototypeOf(O, proto); } }); -} catch (error) { - /* empty */ -} +} catch (error) {/* empty */} /***/ }), -/* 304 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var makeBuiltIn = __webpack_require__(48); - -var defineProperty = __webpack_require__(44); - -module.exports = function (target, name, descriptor) { - if (descriptor.get) makeBuiltIn(descriptor.get, name, { - getter: true - }); - if (descriptor.set) makeBuiltIn(descriptor.set, name, { - setter: true - }); - return defineProperty.f(target, name, descriptor); -}; - -/***/ }), -/* 305 */ +/* 318 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var isObject = __webpack_require__(20); +var onFreeze = (__webpack_require__(243).onFreeze); +var FREEZING = __webpack_require__(246); +var fails = __webpack_require__(7); -var onFreeze = (__webpack_require__(229).onFreeze); - -var FREEZING = __webpack_require__(232); - -var fails = __webpack_require__(7); // eslint-disable-next-line es-x/no-object-seal -- safe - - +// eslint-disable-next-line es/no-object-seal -- safe var $seal = Object.seal; var FAILS_ON_PRIMITIVES = fails(function () { $seal(1); -}); // `Object.seal` method -// https://tc39.es/ecma262/#sec-object.seal +}); +// `Object.seal` method +// https://tc39.es/ecma262/#sec-object.seal $({ target: 'Object', stat: true, @@ -10416,15 +9189,14 @@ $({ }); /***/ }), -/* 306 */ +/* 319 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var setPrototypeOf = __webpack_require__(116); -var setPrototypeOf = __webpack_require__(112); // `Object.setPrototypeOf` method +// `Object.setPrototypeOf` method // https://tc39.es/ecma262/#sec-object.setprototypeof - - $({ target: 'Object', stat: true @@ -10433,17 +9205,15 @@ $({ }); /***/ }), -/* 307 */ +/* 320 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var TO_STRING_TAG_SUPPORT = __webpack_require__(70); +var TO_STRING_TAG_SUPPORT = __webpack_require__(71); +var defineBuiltIn = __webpack_require__(48); +var toString = __webpack_require__(321); -var defineBuiltIn = __webpack_require__(47); - -var toString = __webpack_require__(308); // `Object.prototype.toString` method +// `Object.prototype.toString` method // https://tc39.es/ecma262/#sec-object.prototype.tostring - - if (!TO_STRING_TAG_SUPPORT) { defineBuiltIn(Object.prototype, 'toString', toString, { unsafe: true @@ -10451,32 +9221,30 @@ if (!TO_STRING_TAG_SUPPORT) { } /***/ }), -/* 308 */ +/* 321 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var TO_STRING_TAG_SUPPORT = __webpack_require__(70); +var TO_STRING_TAG_SUPPORT = __webpack_require__(71); +var classof = __webpack_require__(70); -var classof = __webpack_require__(69); // `Object.prototype.toString` method implementation +// `Object.prototype.toString` method implementation // https://tc39.es/ecma262/#sec-object.prototype.tostring - - module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() { return '[object ' + classof(this) + ']'; }; /***/ }), -/* 309 */ +/* 322 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var $values = (__webpack_require__(300).values); -var $values = (__webpack_require__(286).values); // `Object.values` method +// `Object.values` method // https://tc39.es/ecma262/#sec-object.values - - $({ target: 'Object', stat: true @@ -10487,15 +9255,14 @@ $({ }); /***/ }), -/* 310 */ +/* 323 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var $parseFloat = __webpack_require__(285); -var $parseFloat = __webpack_require__(271); // `parseFloat` method +// `parseFloat` method // https://tc39.es/ecma262/#sec-parsefloat-string - - $({ global: true, forced: parseFloat != $parseFloat @@ -10504,15 +9271,14 @@ $({ }); /***/ }), -/* 311 */ +/* 324 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var $parseInt = __webpack_require__(287); -var $parseInt = __webpack_require__(273); // `parseInt` method +// `parseInt` method // https://tc39.es/ecma262/#sec-parseint-string-radix - - $({ global: true, forced: parseInt != $parseInt @@ -10521,75 +9287,47 @@ $({ }); /***/ }), -/* 312 */ +/* 325 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove this module from `core-js@4` since it's split to modules listed below -__webpack_require__(313); - -__webpack_require__(328); - -__webpack_require__(330); - -__webpack_require__(331); - -__webpack_require__(332); - -__webpack_require__(333); +__webpack_require__(326); +__webpack_require__(341); +__webpack_require__(343); +__webpack_require__(344); +__webpack_require__(345); +__webpack_require__(346); /***/ }), -/* 313 */ +/* 326 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - -var IS_PURE = __webpack_require__(35); - -var IS_NODE = __webpack_require__(177); - +var IS_PURE = __webpack_require__(36); +var IS_NODE = __webpack_require__(183); var global = __webpack_require__(4); - var call = __webpack_require__(8); - -var defineBuiltIn = __webpack_require__(47); - -var setPrototypeOf = __webpack_require__(112); - -var setToStringTag = __webpack_require__(82); - -var setSpecies = __webpack_require__(188); - -var aCallable = __webpack_require__(30); - +var defineBuiltIn = __webpack_require__(48); +var setPrototypeOf = __webpack_require__(116); +var setToStringTag = __webpack_require__(84); +var setSpecies = __webpack_require__(194); +var aCallable = __webpack_require__(31); var isCallable = __webpack_require__(21); - var isObject = __webpack_require__(20); - -var anInstance = __webpack_require__(197); - -var speciesConstructor = __webpack_require__(203); - -var task = (__webpack_require__(314).set); - -var microtask = __webpack_require__(317); - -var hostReportErrors = __webpack_require__(320); - -var perform = __webpack_require__(321); - -var Queue = __webpack_require__(322); - -var InternalStateModule = __webpack_require__(51); - -var NativePromiseConstructor = __webpack_require__(323); - -var PromiseConstructorDetection = __webpack_require__(324); - -var newPromiseCapabilityModule = __webpack_require__(327); - +var anInstance = __webpack_require__(211); +var speciesConstructor = __webpack_require__(217); +var task = (__webpack_require__(327).set); +var microtask = __webpack_require__(330); +var hostReportErrors = __webpack_require__(334); +var perform = __webpack_require__(335); +var Queue = __webpack_require__(331); +var InternalStateModule = __webpack_require__(52); +var NativePromiseConstructor = __webpack_require__(336); +var PromiseConstructorDetection = __webpack_require__(337); +var newPromiseCapabilityModule = __webpack_require__(340); var PROMISE = 'Promise'; var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR; var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT; @@ -10612,13 +9350,13 @@ var FULFILLED = 1; var REJECTED = 2; var HANDLED = 1; var UNHANDLED = 2; -var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen; // helpers +var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen; +// helpers var isThenable = function (it) { var then; return isObject(it) && isCallable(then = it.then) ? then : false; }; - var callReaction = function (reaction, state) { var value = state.value; var ok = state.state == FULFILLED; @@ -10627,24 +9365,20 @@ var callReaction = function (reaction, state) { var reject = reaction.reject; var domain = reaction.domain; var result, then, exited; - try { if (handler) { if (!ok) { if (state.rejection === UNHANDLED) onHandleUnhandled(state); state.rejection = HANDLED; } - if (handler === true) result = value;else { if (domain) domain.enter(); result = handler(value); // can throw - if (domain) { domain.exit(); exited = true; } } - if (result === reaction.promise) { reject(TypeError('Promise-chain cycle')); } else if (then = isThenable(result)) { @@ -10656,26 +9390,21 @@ var callReaction = function (reaction, state) { reject(error); } }; - var notify = function (state, isReject) { if (state.notified) return; state.notified = true; microtask(function () { var reactions = state.reactions; var reaction; - while (reaction = reactions.get()) { callReaction(reaction, state); } - state.notified = false; if (isReject && !state.rejection) onUnhandled(state); }); }; - var dispatchEvent = function (name, promise, reason) { var event, handler; - if (DISPATCH_EVENT) { event = document.createEvent('Event'); event.promise = promise; @@ -10686,50 +9415,42 @@ var dispatchEvent = function (name, promise, reason) { promise: promise, reason: reason }; - if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason); }; - var onUnhandled = function (state) { call(task, global, function () { var promise = state.facade; var value = state.value; var IS_UNHANDLED = isUnhandled(state); var result; - if (IS_UNHANDLED) { result = perform(function () { if (IS_NODE) { process.emit('unhandledRejection', value, promise); } else dispatchEvent(UNHANDLED_REJECTION, promise, value); - }); // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should - + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED; if (result.error) throw result.value; } }); }; - var isUnhandled = function (state) { return state.rejection !== HANDLED && !state.parent; }; - var onHandleUnhandled = function (state) { call(task, global, function () { var promise = state.facade; - if (IS_NODE) { process.emit('rejectionHandled', promise); } else dispatchEvent(REJECTION_HANDLED, promise, state.value); }); }; - var bind = function (fn, state, unwrap) { return function (value) { fn(state, value, unwrap); }; }; - var internalReject = function (state, value, unwrap) { if (state.done) return; state.done = true; @@ -10738,22 +9459,18 @@ var internalReject = function (state, value, unwrap) { state.state = REJECTED; notify(state, true); }; - var internalResolve = function (state, value, unwrap) { if (state.done) return; state.done = true; if (unwrap) state = unwrap; - try { if (state.facade === value) throw TypeError("Promise can't be resolved itself"); var then = isThenable(value); - if (then) { microtask(function () { var wrapper = { done: false }; - try { call(then, value, bind(internalResolve, wrapper, state), bind(internalReject, wrapper, state)); } catch (error) { @@ -10770,9 +9487,9 @@ var internalResolve = function (state, value, unwrap) { done: false }, error, state); } -}; // constructor polyfill - +}; +// constructor polyfill if (FORCED_PROMISE_CONSTRUCTOR) { // 25.4.3.1 Promise(executor) PromiseConstructor = function Promise(executor) { @@ -10780,16 +9497,15 @@ if (FORCED_PROMISE_CONSTRUCTOR) { aCallable(executor); call(Internal, this); var state = getInternalPromiseState(this); - try { executor(bind(internalResolve, state), bind(internalReject, state)); } catch (error) { internalReject(state, error); } }; + PromisePrototype = PromiseConstructor.prototype; - PromisePrototype = PromiseConstructor.prototype; // eslint-disable-next-line no-unused-vars -- required for `.length` - + // eslint-disable-next-line no-unused-vars -- required for `.length` Internal = function Promise(executor) { setInternalState(this, { type: PROMISE, @@ -10801,10 +9517,10 @@ if (FORCED_PROMISE_CONSTRUCTOR) { state: PENDING, value: undefined }); - }; // `Promise.prototype.then` method + }; + + // `Promise.prototype.then` method // https://tc39.es/ecma262/#sec-promise.prototype.then - - Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) { var state = getInternalPromiseState(this); var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor)); @@ -10817,7 +9533,6 @@ if (FORCED_PROMISE_CONSTRUCTOR) { }); return reaction.promise; }); - OwnPromiseCapability = function () { var promise = new Internal(); var state = getInternalPromiseState(promise); @@ -10825,40 +9540,35 @@ if (FORCED_PROMISE_CONSTRUCTOR) { this.resolve = bind(internalResolve, state); this.reject = bind(internalReject, state); }; - newPromiseCapabilityModule.f = newPromiseCapability = function (C) { return C === PromiseConstructor || C === PromiseWrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C); }; - if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) { nativeThen = NativePromisePrototype.then; - if (!NATIVE_PROMISE_SUBCLASSING) { // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) { var that = this; return new PromiseConstructor(function (resolve, reject) { call(nativeThen, that, resolve, reject); - }).then(onFulfilled, onRejected); // https://github.com/zloirock/core-js/issues/640 + }).then(onFulfilled, onRejected); + // https://github.com/zloirock/core-js/issues/640 }, { unsafe: true }); - } // make `.constructor === Promise` work for native promise-based APIs - + } + // make `.constructor === Promise` work for native promise-based APIs try { delete NativePromisePrototype.constructor; - } catch (error) { - /* empty */ - } // make `instanceof Promise` work for native promise-based APIs - + } catch (error) {/* empty */} + // make `instanceof Promise` work for native promise-based APIs if (setPrototypeOf) { setPrototypeOf(NativePromisePrototype, PromisePrototype); } } } - $({ global: true, constructor: true, @@ -10871,33 +9581,21 @@ setToStringTag(PromiseConstructor, PROMISE, false, true); setSpecies(PROMISE); /***/ }), -/* 314 */ +/* 327 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4); - -var apply = __webpack_require__(93); - -var bind = __webpack_require__(84); - +var apply = __webpack_require__(96); +var bind = __webpack_require__(86); var isCallable = __webpack_require__(21); - -var hasOwn = __webpack_require__(38); - +var hasOwn = __webpack_require__(39); var fails = __webpack_require__(7); - -var html = __webpack_require__(74); - -var arraySlice = __webpack_require__(94); - -var createElement = __webpack_require__(42); - -var validateArgumentsLength = __webpack_require__(315); - -var IS_IOS = __webpack_require__(316); - -var IS_NODE = __webpack_require__(177); - +var html = __webpack_require__(75); +var arraySlice = __webpack_require__(97); +var createElement = __webpack_require__(43); +var validateArgumentsLength = __webpack_require__(328); +var IS_IOS = __webpack_require__(329); +var IS_NODE = __webpack_require__(183); var set = global.setImmediate; var clear = global.clearImmediate; var process = global.process; @@ -10908,15 +9606,11 @@ var String = global.String; var counter = 0; var queue = {}; var ONREADYSTATECHANGE = 'onreadystatechange'; -var location, defer, channel, port; - -try { +var $location, defer, channel, port; +fails(function () { // Deno throws a ReferenceError on `location` access without `--location` flag - location = global.location; -} catch (error) { - /* empty */ -} - + $location = global.location; +}); var run = function (id) { if (hasOwn(queue, id)) { var fn = queue[id]; @@ -10924,244 +9618,234 @@ var run = function (id) { fn(); } }; - var runner = function (id) { return function () { run(id); }; }; - -var listener = function (event) { +var eventListener = function (event) { run(event.data); }; - -var post = function (id) { +var globalPostMessageDefer = function (id) { // old engines have not location.origin - global.postMessage(String(id), location.protocol + '//' + location.host); -}; // Node.js 0.9+ & IE10+ has setImmediate, otherwise: - + global.postMessage(String(id), $location.protocol + '//' + $location.host); +}; +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: if (!set || !clear) { set = function setImmediate(handler) { validateArgumentsLength(arguments.length, 1); var fn = isCallable(handler) ? handler : Function(handler); var args = arraySlice(arguments, 1); - queue[++counter] = function () { apply(fn, undefined, args); }; - defer(counter); return counter; }; - clear = function clearImmediate(id) { delete queue[id]; - }; // Node.js 0.8- - - + }; + // Node.js 0.8- if (IS_NODE) { defer = function (id) { process.nextTick(runner(id)); - }; // Sphere (JS game engine) Dispatch API - + }; + // Sphere (JS game engine) Dispatch API } else if (Dispatch && Dispatch.now) { defer = function (id) { Dispatch.now(runner(id)); - }; // Browsers with MessageChannel, includes WebWorkers + }; + // Browsers with MessageChannel, includes WebWorkers // except iOS - https://github.com/zloirock/core-js/issues/624 - } else if (MessageChannel && !IS_IOS) { channel = new MessageChannel(); port = channel.port2; - channel.port1.onmessage = listener; - defer = bind(port.postMessage, port); // Browsers with postMessage, skip WebWorkers + channel.port1.onmessage = eventListener; + defer = bind(port.postMessage, port); + // Browsers with postMessage, skip WebWorkers // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' - } else if (global.addEventListener && isCallable(global.postMessage) && !global.importScripts && location && location.protocol !== 'file:' && !fails(post)) { - defer = post; - global.addEventListener('message', listener, false); // IE8- + } else if (global.addEventListener && isCallable(global.postMessage) && !global.importScripts && $location && $location.protocol !== 'file:' && !fails(globalPostMessageDefer)) { + defer = globalPostMessageDefer; + global.addEventListener('message', eventListener, false); + // IE8- } else if (ONREADYSTATECHANGE in createElement('script')) { defer = function (id) { html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () { html.removeChild(this); run(id); }; - }; // Rest old browsers - + }; + // Rest old browsers } else { defer = function (id) { setTimeout(runner(id), 0); }; } } - module.exports = { set: set, clear: clear }; /***/ }), -/* 315 */ +/* 328 */ /***/ ((module) => { var $TypeError = TypeError; - module.exports = function (passed, required) { if (passed < required) throw $TypeError('Not enough arguments'); return passed; }; /***/ }), -/* 316 */ +/* 329 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var userAgent = __webpack_require__(28); +var userAgent = __webpack_require__(29); +// eslint-disable-next-line redos/no-vulnerable -- safe module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent); /***/ }), -/* 317 */ +/* 330 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4); - -var bind = __webpack_require__(84); - +var bind = __webpack_require__(86); var getOwnPropertyDescriptor = (__webpack_require__(5).f); - -var macrotask = (__webpack_require__(314).set); - -var IS_IOS = __webpack_require__(316); - -var IS_IOS_PEBBLE = __webpack_require__(318); - -var IS_WEBOS_WEBKIT = __webpack_require__(319); - -var IS_NODE = __webpack_require__(177); - +var macrotask = (__webpack_require__(327).set); +var Queue = __webpack_require__(331); +var IS_IOS = __webpack_require__(329); +var IS_IOS_PEBBLE = __webpack_require__(332); +var IS_WEBOS_WEBKIT = __webpack_require__(333); +var IS_NODE = __webpack_require__(183); var MutationObserver = global.MutationObserver || global.WebKitMutationObserver; var document = global.document; var process = global.process; -var Promise = global.Promise; // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask` - +var Promise = global.Promise; +// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask` var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask'); -var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value; -var flush, head, last, notify, toggle, node, promise, then; // modern engines have queueMicrotask method +var microtask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value; +var notify, toggle, node, promise, then; -if (!queueMicrotask) { - flush = function () { +// modern engines have queueMicrotask method +if (!microtask) { + var queue = new Queue(); + var flush = function () { var parent, fn; if (IS_NODE && (parent = process.domain)) parent.exit(); - - while (head) { - fn = head.fn; - head = head.next; - - try { - fn(); - } catch (error) { - if (head) notify();else last = undefined; - throw error; - } + while (fn = queue.get()) try { + fn(); + } catch (error) { + if (queue.head) notify(); + throw error; } - - last = undefined; if (parent) parent.enter(); - }; // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339 + }; + + // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339 // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898 - - if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) { toggle = true; node = document.createTextNode(''); new MutationObserver(flush).observe(node, { characterData: true }); - notify = function () { node.data = toggle = !toggle; - }; // environments with maybe non-completely correct, but existent Promise - + }; + // environments with maybe non-completely correct, but existent Promise } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) { // Promise.resolve without an argument throws an error in LG WebOS 2 - promise = Promise.resolve(undefined); // workaround of WebKit ~ iOS Safari 10.1 bug - + promise = Promise.resolve(undefined); + // workaround of WebKit ~ iOS Safari 10.1 bug promise.constructor = Promise; then = bind(promise.then, promise); - notify = function () { then(flush); - }; // Node.js without promises - + }; + // Node.js without promises } else if (IS_NODE) { notify = function () { process.nextTick(flush); - }; // for other environments - macrotask based on: + }; + // for other environments - macrotask based on: // - setImmediate // - MessageChannel // - window.postMessage // - onreadystatechange // - setTimeout - } else { - // strange IE + webpack dev server bug - use .bind(global) + // `webpack` dev server bug on IE global methods - use bind(fn, global) macrotask = bind(macrotask, global); - notify = function () { macrotask(flush); }; } -} - -module.exports = queueMicrotask || function (fn) { - var task = { - fn: fn, - next: undefined + microtask = function (fn) { + if (!queue.head) notify(); + queue.add(fn); }; - if (last) last.next = task; +} +module.exports = microtask; - if (!head) { - head = task; - notify(); - } +/***/ }), +/* 331 */ +/***/ ((module) => { - last = task; +var Queue = function () { + this.head = null; + this.tail = null; }; +Queue.prototype = { + add: function (item) { + var entry = { + item: item, + next: null + }; + var tail = this.tail; + if (tail) tail.next = entry;else this.head = entry; + this.tail = entry; + }, + get: function () { + var entry = this.head; + if (entry) { + var next = this.head = entry.next; + if (next === null) this.tail = null; + return entry.item; + } + } +}; +module.exports = Queue; /***/ }), -/* 318 */ +/* 332 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var userAgent = __webpack_require__(28); - -var global = __webpack_require__(4); - -module.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined; +var userAgent = __webpack_require__(29); +module.exports = /ipad|iphone|ipod/i.test(userAgent) && typeof Pebble != 'undefined'; /***/ }), -/* 319 */ +/* 333 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var userAgent = __webpack_require__(28); - +var userAgent = __webpack_require__(29); module.exports = /web0s(?!.*chrome)/i.test(userAgent); /***/ }), -/* 320 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var global = __webpack_require__(4); +/* 334 */ +/***/ ((module) => { module.exports = function (a, b) { - var console = global.console; - - if (console && console.error) { + try { + // eslint-disable-next-line no-console -- safe arguments.length == 1 ? console.error(a) : console.error(a, b); - } + } catch (error) {/* empty */} }; /***/ }), -/* 321 */ +/* 335 */ /***/ ((module) => { module.exports = function (exec) { @@ -11179,105 +9863,56 @@ module.exports = function (exec) { }; /***/ }), -/* 322 */ -/***/ ((module) => { - -var Queue = function () { - this.head = null; - this.tail = null; -}; - -Queue.prototype = { - add: function (item) { - var entry = { - item: item, - next: null - }; - if (this.head) this.tail.next = entry;else this.head = entry; - this.tail = entry; - }, - get: function () { - var entry = this.head; - - if (entry) { - this.head = entry.next; - if (this.tail === entry) this.tail = null; - return entry.item; - } - } -}; -module.exports = Queue; - -/***/ }), -/* 323 */ +/* 336 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4); - module.exports = global.Promise; /***/ }), -/* 324 */ +/* 337 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4); - -var NativePromiseConstructor = __webpack_require__(323); - +var NativePromiseConstructor = __webpack_require__(336); var isCallable = __webpack_require__(21); - -var isForced = __webpack_require__(67); - -var inspectSource = __webpack_require__(50); - -var wellKnownSymbol = __webpack_require__(33); - -var IS_BROWSER = __webpack_require__(325); - -var IS_DENO = __webpack_require__(326); - -var IS_PURE = __webpack_require__(35); - -var V8_VERSION = __webpack_require__(27); - +var isForced = __webpack_require__(68); +var inspectSource = __webpack_require__(51); +var wellKnownSymbol = __webpack_require__(34); +var IS_BROWSER = __webpack_require__(338); +var IS_DENO = __webpack_require__(339); +var IS_PURE = __webpack_require__(36); +var V8_VERSION = __webpack_require__(28); var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; var SPECIES = wellKnownSymbol('species'); var SUBCLASSING = false; var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent); var FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () { var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor); - var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor); // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables + var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor); + // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 // We can't detect it synchronously, so just check versions - - if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true; // We need Promise#{ catch, finally } in the pure version for preventing prototype pollution - - if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true; // We can't use @@species feature detection in V8 since it causes + if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true; + // We need Promise#{ catch, finally } in the pure version for preventing prototype pollution + if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true; + // We can't use @@species feature detection in V8 since it causes // deoptimization and performance degradation // https://github.com/zloirock/core-js/issues/679 - if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) { // Detect correctness of subclassing with @@species support var promise = new NativePromiseConstructor(function (resolve) { resolve(1); }); - var FakePromise = function (exec) { - exec(function () { - /* empty */ - }, function () { - /* empty */ - }); + exec(function () {/* empty */}, function () {/* empty */}); }; - var constructor = promise.constructor = {}; constructor[SPECIES] = FakePromise; - SUBCLASSING = promise.then(function () { - /* empty */ - }) instanceof FakePromise; - if (!SUBCLASSING) return true; // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test + SUBCLASSING = promise.then(function () {/* empty */}) instanceof FakePromise; + if (!SUBCLASSING) return true; + // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test } - return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT; }); module.exports = { @@ -11287,33 +9922,29 @@ module.exports = { }; /***/ }), -/* 325 */ +/* 338 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var IS_DENO = __webpack_require__(326); - -var IS_NODE = __webpack_require__(177); - +var IS_DENO = __webpack_require__(339); +var IS_NODE = __webpack_require__(183); module.exports = !IS_DENO && !IS_NODE && typeof window == 'object' && typeof document == 'object'; /***/ }), -/* 326 */ +/* 339 */ /***/ ((module) => { /* global Deno -- Deno case */ module.exports = typeof Deno == 'object' && Deno && typeof Deno.version == 'object'; /***/ }), -/* 327 */ +/* 340 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var aCallable = __webpack_require__(30); - +var aCallable = __webpack_require__(31); var $TypeError = TypeError; - var PromiseCapability = function (C) { var resolve, reject; this.promise = new C(function ($$resolve, $$reject) { @@ -11323,37 +9954,31 @@ var PromiseCapability = function (C) { }); this.resolve = aCallable(resolve); this.reject = aCallable(reject); -}; // `NewPromiseCapability` abstract operation +}; + +// `NewPromiseCapability` abstract operation // https://tc39.es/ecma262/#sec-newpromisecapability - - module.exports.f = function (C) { return new PromiseCapability(C); }; /***/ }), -/* 328 */ +/* 341 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var call = __webpack_require__(8); +var aCallable = __webpack_require__(31); +var newPromiseCapabilityModule = __webpack_require__(340); +var perform = __webpack_require__(335); +var iterate = __webpack_require__(132); +var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(342); -var aCallable = __webpack_require__(30); - -var newPromiseCapabilityModule = __webpack_require__(327); - -var perform = __webpack_require__(321); - -var iterate = __webpack_require__(126); - -var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(329); // `Promise.all` method +// `Promise.all` method // https://tc39.es/ecma262/#sec-promise.all - - $({ target: 'Promise', stat: true, @@ -11388,45 +10013,34 @@ $({ }); /***/ }), -/* 329 */ +/* 342 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var NativePromiseConstructor = __webpack_require__(323); - -var checkCorrectnessOfIteration = __webpack_require__(159); - -var FORCED_PROMISE_CONSTRUCTOR = (__webpack_require__(324).CONSTRUCTOR); - +var NativePromiseConstructor = __webpack_require__(336); +var checkCorrectnessOfIteration = __webpack_require__(165); +var FORCED_PROMISE_CONSTRUCTOR = (__webpack_require__(337).CONSTRUCTOR); module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) { - NativePromiseConstructor.all(iterable).then(undefined, function () { - /* empty */ - }); + NativePromiseConstructor.all(iterable).then(undefined, function () {/* empty */}); }); /***/ }), -/* 330 */ +/* 343 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - -var IS_PURE = __webpack_require__(35); - -var FORCED_PROMISE_CONSTRUCTOR = (__webpack_require__(324).CONSTRUCTOR); - -var NativePromiseConstructor = __webpack_require__(323); - -var getBuiltIn = __webpack_require__(23); - +var IS_PURE = __webpack_require__(36); +var FORCED_PROMISE_CONSTRUCTOR = (__webpack_require__(337).CONSTRUCTOR); +var NativePromiseConstructor = __webpack_require__(336); +var getBuiltIn = __webpack_require__(24); var isCallable = __webpack_require__(21); +var defineBuiltIn = __webpack_require__(48); +var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; -var defineBuiltIn = __webpack_require__(47); - -var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; // `Promise.prototype.catch` method +// `Promise.prototype.catch` method // https://tc39.es/ecma262/#sec-promise.prototype.catch - $({ target: 'Promise', proto: true, @@ -11436,11 +10050,11 @@ $({ 'catch': function (onRejected) { return this.then(undefined, onRejected); } -}); // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then` +}); +// makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then` if (!IS_PURE && isCallable(NativePromiseConstructor)) { var method = getBuiltIn('Promise').prototype['catch']; - if (NativePromisePrototype['catch'] !== method) { defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true @@ -11449,28 +10063,22 @@ if (!IS_PURE && isCallable(NativePromiseConstructor)) { } /***/ }), -/* 331 */ +/* 344 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var call = __webpack_require__(8); +var aCallable = __webpack_require__(31); +var newPromiseCapabilityModule = __webpack_require__(340); +var perform = __webpack_require__(335); +var iterate = __webpack_require__(132); +var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(342); -var aCallable = __webpack_require__(30); - -var newPromiseCapabilityModule = __webpack_require__(327); - -var perform = __webpack_require__(321); - -var iterate = __webpack_require__(126); - -var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(329); // `Promise.race` method +// `Promise.race` method // https://tc39.es/ecma262/#sec-promise.race - - $({ target: 'Promise', stat: true, @@ -11492,22 +10100,19 @@ $({ }); /***/ }), -/* 332 */ +/* 345 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var call = __webpack_require__(8); +var newPromiseCapabilityModule = __webpack_require__(340); +var FORCED_PROMISE_CONSTRUCTOR = (__webpack_require__(337).CONSTRUCTOR); -var newPromiseCapabilityModule = __webpack_require__(327); - -var FORCED_PROMISE_CONSTRUCTOR = (__webpack_require__(324).CONSTRUCTOR); // `Promise.reject` method +// `Promise.reject` method // https://tc39.es/ecma262/#sec-promise.reject - - $({ target: 'Promise', stat: true, @@ -11521,28 +10126,23 @@ $({ }); /***/ }), -/* 333 */ +/* 346 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - -var getBuiltIn = __webpack_require__(23); - -var IS_PURE = __webpack_require__(35); - -var NativePromiseConstructor = __webpack_require__(323); - -var FORCED_PROMISE_CONSTRUCTOR = (__webpack_require__(324).CONSTRUCTOR); - -var promiseResolve = __webpack_require__(334); - +var getBuiltIn = __webpack_require__(24); +var IS_PURE = __webpack_require__(36); +var NativePromiseConstructor = __webpack_require__(336); +var FORCED_PROMISE_CONSTRUCTOR = (__webpack_require__(337).CONSTRUCTOR); +var promiseResolve = __webpack_require__(347); var PromiseConstructorWrapper = getBuiltIn('Promise'); -var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR; // `Promise.resolve` method -// https://tc39.es/ecma262/#sec-promise.resolve +var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR; +// `Promise.resolve` method +// https://tc39.es/ecma262/#sec-promise.resolve $({ target: 'Promise', stat: true, @@ -11554,15 +10154,12 @@ $({ }); /***/ }), -/* 334 */ +/* 347 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var anObject = __webpack_require__(46); - +var anObject = __webpack_require__(47); var isObject = __webpack_require__(20); - -var newPromiseCapability = __webpack_require__(327); - +var newPromiseCapability = __webpack_require__(340); module.exports = function (C, x) { anObject(C); if (isObject(x) && x.constructor === C) return x; @@ -11573,29 +10170,26 @@ module.exports = function (C, x) { }; /***/ }), -/* 335 */ +/* 348 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var call = __webpack_require__(8); +var aCallable = __webpack_require__(31); +var newPromiseCapabilityModule = __webpack_require__(340); +var perform = __webpack_require__(335); +var iterate = __webpack_require__(132); +var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(342); -var aCallable = __webpack_require__(30); - -var newPromiseCapabilityModule = __webpack_require__(327); - -var perform = __webpack_require__(321); - -var iterate = __webpack_require__(126); // `Promise.allSettled` method +// `Promise.allSettled` method // https://tc39.es/ecma262/#sec-promise.allsettled - - $({ target: 'Promise', - stat: true + stat: true, + forced: PROMISE_STATICS_INCORRECT_ITERATION }, { allSettled: function allSettled(iterable) { var C = this; @@ -11637,32 +10231,28 @@ $({ }); /***/ }), -/* 336 */ +/* 349 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var call = __webpack_require__(8); +var aCallable = __webpack_require__(31); +var getBuiltIn = __webpack_require__(24); +var newPromiseCapabilityModule = __webpack_require__(340); +var perform = __webpack_require__(335); +var iterate = __webpack_require__(132); +var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(342); +var PROMISE_ANY_ERROR = 'No one promise resolved'; -var aCallable = __webpack_require__(30); - -var getBuiltIn = __webpack_require__(23); - -var newPromiseCapabilityModule = __webpack_require__(327); - -var perform = __webpack_require__(321); - -var iterate = __webpack_require__(126); - -var PROMISE_ANY_ERROR = 'No one promise resolved'; // `Promise.any` method +// `Promise.any` method // https://tc39.es/ecma262/#sec-promise.any - $({ target: 'Promise', - stat: true + stat: true, + forced: PROMISE_STATICS_INCORRECT_ITERATION }, { any: function any(iterable) { var C = this; @@ -11699,44 +10289,33 @@ $({ }); /***/ }), -/* 337 */ +/* 350 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - -var IS_PURE = __webpack_require__(35); - -var NativePromiseConstructor = __webpack_require__(323); - +var IS_PURE = __webpack_require__(36); +var NativePromiseConstructor = __webpack_require__(336); var fails = __webpack_require__(7); - -var getBuiltIn = __webpack_require__(23); - +var getBuiltIn = __webpack_require__(24); var isCallable = __webpack_require__(21); +var speciesConstructor = __webpack_require__(217); +var promiseResolve = __webpack_require__(347); +var defineBuiltIn = __webpack_require__(48); +var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; -var speciesConstructor = __webpack_require__(203); - -var promiseResolve = __webpack_require__(334); - -var defineBuiltIn = __webpack_require__(47); - -var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; // Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829 - +// Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829 var NON_GENERIC = !!NativePromiseConstructor && fails(function () { // eslint-disable-next-line unicorn/no-thenable -- required for testing NativePromisePrototype['finally'].call({ - then: function () { - /* empty */ - } - }, function () { - /* empty */ - }); -}); // `Promise.prototype.finally` method -// https://tc39.es/ecma262/#sec-promise.prototype.finally + then: function () {/* empty */} + }, function () {/* empty */}); +}); +// `Promise.prototype.finally` method +// https://tc39.es/ecma262/#sec-promise.prototype.finally $({ target: 'Promise', proto: true, @@ -11756,11 +10335,11 @@ $({ }); } : onFinally); } -}); // makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then` +}); +// makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then` if (!IS_PURE && isCallable(NativePromiseConstructor)) { var method = getBuiltIn('Promise').prototype['finally']; - if (NativePromisePrototype['finally'] !== method) { defineBuiltIn(NativePromisePrototype, 'finally', method, { unsafe: true @@ -11769,28 +10348,23 @@ if (!IS_PURE && isCallable(NativePromiseConstructor)) { } /***/ }), -/* 338 */ +/* 351 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var functionApply = __webpack_require__(96); +var aCallable = __webpack_require__(31); +var anObject = __webpack_require__(47); +var fails = __webpack_require__(7); -var functionApply = __webpack_require__(93); - -var aCallable = __webpack_require__(30); - -var anObject = __webpack_require__(46); - -var fails = __webpack_require__(7); // MS Edge argumentsList argument is optional - - +// MS Edge argumentsList argument is optional var OPTIONAL_ARGUMENTS_LIST = !fails(function () { - // eslint-disable-next-line es-x/no-reflect -- required for testing - Reflect.apply(function () { - /* empty */ - }); -}); // `Reflect.apply` method -// https://tc39.es/ecma262/#sec-reflect.apply + // eslint-disable-next-line es/no-reflect -- required for testing + Reflect.apply(function () {/* empty */}); +}); +// `Reflect.apply` method +// https://tc39.es/ecma262/#sec-reflect.apply $({ target: 'Reflect', stat: true, @@ -11802,47 +10376,32 @@ $({ }); /***/ }), -/* 339 */ +/* 352 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - -var getBuiltIn = __webpack_require__(23); - -var apply = __webpack_require__(93); - -var bind = __webpack_require__(221); - -var aConstructor = __webpack_require__(204); - -var anObject = __webpack_require__(46); - +var getBuiltIn = __webpack_require__(24); +var apply = __webpack_require__(96); +var bind = __webpack_require__(235); +var aConstructor = __webpack_require__(218); +var anObject = __webpack_require__(47); var isObject = __webpack_require__(20); - -var create = __webpack_require__(71); - +var create = __webpack_require__(72); var fails = __webpack_require__(7); - var nativeConstruct = getBuiltIn('Reflect', 'construct'); var ObjectPrototype = Object.prototype; -var push = [].push; // `Reflect.construct` method +var push = [].push; + +// `Reflect.construct` method // https://tc39.es/ecma262/#sec-reflect.construct // MS Edge supports only 2 arguments and argumentsList argument is optional // FF Nightly sets third argument as `new.target`, but does not create `this` from it - var NEW_TARGET_BUG = fails(function () { - function F() { - /* empty */ - } - - return !(nativeConstruct(function () { - /* empty */ - }, [], F) instanceof F); + function F() {/* empty */} + return !(nativeConstruct(function () {/* empty */}, [], F) instanceof F); }); var ARGS_BUG = !fails(function () { - nativeConstruct(function () { - /* empty */ - }); + nativeConstruct(function () {/* empty */}); }); var FORCED = NEW_TARGET_BUG || ARGS_BUG; $({ @@ -11851,40 +10410,31 @@ $({ forced: FORCED, sham: FORCED }, { - construct: function construct(Target, args - /* , newTarget */ - ) { + construct: function construct(Target, args /* , newTarget */) { aConstructor(Target); anObject(args); var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]); if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget); - if (Target == newTarget) { // w/o altered newTarget, optimization for 0-4 arguments switch (args.length) { case 0: return new Target(); - case 1: return new Target(args[0]); - case 2: return new Target(args[0], args[1]); - case 3: return new Target(args[0], args[1], args[2]); - case 4: return new Target(args[0], args[1], args[2], args[3]); - } // w/o altered newTarget, lot of arguments case - - + } + // w/o altered newTarget, lot of arguments case var $args = [null]; apply(push, $args, args); return new (apply(bind, Target, $args))(); - } // with altered newTarget, not support built-in constructors - - + } + // with altered newTarget, not support built-in constructors var proto = newTarget.prototype; var instance = create(isObject(proto) ? proto : ObjectPrototype); var result = apply(Target, instance, args); @@ -11893,32 +10443,28 @@ $({ }); /***/ }), -/* 340 */ +/* 353 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var DESCRIPTORS = __webpack_require__(6); - -var anObject = __webpack_require__(46); - +var anObject = __webpack_require__(47); var toPropertyKey = __webpack_require__(18); +var definePropertyModule = __webpack_require__(45); +var fails = __webpack_require__(7); -var definePropertyModule = __webpack_require__(44); - -var fails = __webpack_require__(7); // MS Edge has broken Reflect.defineProperty - throwing instead of returning false - - +// MS Edge has broken Reflect.defineProperty - throwing instead of returning false var ERROR_INSTEAD_OF_FALSE = fails(function () { - // eslint-disable-next-line es-x/no-reflect -- required for testing + // eslint-disable-next-line es/no-reflect -- required for testing Reflect.defineProperty(definePropertyModule.f({}, 1, { value: 1 }), 1, { value: 2 }); -}); // `Reflect.defineProperty` method -// https://tc39.es/ecma262/#sec-reflect.defineproperty +}); +// `Reflect.defineProperty` method +// https://tc39.es/ecma262/#sec-reflect.defineproperty $({ target: 'Reflect', stat: true, @@ -11929,7 +10475,6 @@ $({ anObject(target); var key = toPropertyKey(propertyKey); anObject(attributes); - try { definePropertyModule.f(target, key, attributes); return true; @@ -11940,17 +10485,15 @@ $({ }); /***/ }), -/* 341 */ +/* 354 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var anObject = __webpack_require__(47); +var getOwnPropertyDescriptor = (__webpack_require__(5).f); -var anObject = __webpack_require__(46); - -var getOwnPropertyDescriptor = (__webpack_require__(5).f); // `Reflect.deleteProperty` method +// `Reflect.deleteProperty` method // https://tc39.es/ecma262/#sec-reflect.deleteproperty - - $({ target: 'Reflect', stat: true @@ -11962,28 +10505,20 @@ $({ }); /***/ }), -/* 342 */ +/* 355 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var call = __webpack_require__(8); - var isObject = __webpack_require__(20); - -var anObject = __webpack_require__(46); - -var isDataDescriptor = __webpack_require__(343); - +var anObject = __webpack_require__(47); +var isDataDescriptor = __webpack_require__(356); var getOwnPropertyDescriptorModule = __webpack_require__(5); +var getPrototypeOf = __webpack_require__(130); -var getPrototypeOf = __webpack_require__(124); // `Reflect.get` method +// `Reflect.get` method // https://tc39.es/ecma262/#sec-reflect.get - - -function get(target, propertyKey -/* , receiver */ -) { +function get(target, propertyKey /* , receiver */) { var receiver = arguments.length < 3 ? target : arguments[2]; var descriptor, prototype; if (anObject(target) === receiver) return target[propertyKey]; @@ -11991,7 +10526,6 @@ function get(target, propertyKey if (descriptor) return isDataDescriptor(descriptor) ? descriptor.value : descriptor.get === undefined ? undefined : call(descriptor.get, receiver); if (isObject(prototype = getPrototypeOf(target))) return get(prototype, propertyKey, receiver); } - $({ target: 'Reflect', stat: true @@ -12000,29 +10534,25 @@ $({ }); /***/ }), -/* 343 */ +/* 356 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var hasOwn = __webpack_require__(38); - +var hasOwn = __webpack_require__(39); module.exports = function (descriptor) { return descriptor !== undefined && (hasOwn(descriptor, 'value') || hasOwn(descriptor, 'writable')); }; /***/ }), -/* 344 */ +/* 357 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var DESCRIPTORS = __webpack_require__(6); +var anObject = __webpack_require__(47); +var getOwnPropertyDescriptorModule = __webpack_require__(5); -var anObject = __webpack_require__(46); - -var getOwnPropertyDescriptorModule = __webpack_require__(5); // `Reflect.getOwnPropertyDescriptor` method +// `Reflect.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-reflect.getownpropertydescriptor - - $({ target: 'Reflect', stat: true, @@ -12034,19 +10564,16 @@ $({ }); /***/ }), -/* 345 */ +/* 358 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var anObject = __webpack_require__(47); +var objectGetPrototypeOf = __webpack_require__(130); +var CORRECT_PROTOTYPE_GETTER = __webpack_require__(131); -var anObject = __webpack_require__(46); - -var objectGetPrototypeOf = __webpack_require__(124); - -var CORRECT_PROTOTYPE_GETTER = __webpack_require__(125); // `Reflect.getPrototypeOf` method +// `Reflect.getPrototypeOf` method // https://tc39.es/ecma262/#sec-reflect.getprototypeof - - $({ target: 'Reflect', stat: true, @@ -12058,13 +10585,13 @@ $({ }); /***/ }), -/* 346 */ +/* 359 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var $ = __webpack_require__(3); // `Reflect.has` method +var $ = __webpack_require__(3); + +// `Reflect.has` method // https://tc39.es/ecma262/#sec-reflect.has - - $({ target: 'Reflect', stat: true @@ -12075,17 +10602,15 @@ $({ }); /***/ }), -/* 347 */ +/* 360 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var anObject = __webpack_require__(47); +var $isExtensible = __webpack_require__(244); -var anObject = __webpack_require__(46); - -var $isExtensible = __webpack_require__(230); // `Reflect.isExtensible` method +// `Reflect.isExtensible` method // https://tc39.es/ecma262/#sec-reflect.isextensible - - $({ target: 'Reflect', stat: true @@ -12097,15 +10622,14 @@ $({ }); /***/ }), -/* 348 */ +/* 361 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var ownKeys = __webpack_require__(57); -var ownKeys = __webpack_require__(56); // `Reflect.ownKeys` method +// `Reflect.ownKeys` method // https://tc39.es/ecma262/#sec-reflect.ownkeys - - $({ target: 'Reflect', stat: true @@ -12114,19 +10638,16 @@ $({ }); /***/ }), -/* 349 */ +/* 362 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var getBuiltIn = __webpack_require__(24); +var anObject = __webpack_require__(47); +var FREEZING = __webpack_require__(246); -var getBuiltIn = __webpack_require__(23); - -var anObject = __webpack_require__(46); - -var FREEZING = __webpack_require__(232); // `Reflect.preventExtensions` method +// `Reflect.preventExtensions` method // https://tc39.es/ecma262/#sec-reflect.preventextensions - - $({ target: 'Reflect', stat: true, @@ -12134,7 +10655,6 @@ $({ }, { preventExtensions: function preventExtensions(target) { anObject(target); - try { var objectPreventExtensions = getBuiltIn('Object', 'preventExtensions'); if (objectPreventExtensions) objectPreventExtensions(target); @@ -12146,49 +10666,34 @@ $({ }); /***/ }), -/* 350 */ +/* 363 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var call = __webpack_require__(8); - -var anObject = __webpack_require__(46); - +var anObject = __webpack_require__(47); var isObject = __webpack_require__(20); - -var isDataDescriptor = __webpack_require__(343); - +var isDataDescriptor = __webpack_require__(356); var fails = __webpack_require__(7); - -var definePropertyModule = __webpack_require__(44); - +var definePropertyModule = __webpack_require__(45); var getOwnPropertyDescriptorModule = __webpack_require__(5); +var getPrototypeOf = __webpack_require__(130); +var createPropertyDescriptor = __webpack_require__(11); -var getPrototypeOf = __webpack_require__(124); - -var createPropertyDescriptor = __webpack_require__(11); // `Reflect.set` method +// `Reflect.set` method // https://tc39.es/ecma262/#sec-reflect.set - - -function set(target, propertyKey, V -/* , receiver */ -) { +function set(target, propertyKey, V /* , receiver */) { var receiver = arguments.length < 4 ? target : arguments[3]; var ownDescriptor = getOwnPropertyDescriptorModule.f(anObject(target), propertyKey); var existingDescriptor, prototype, setter; - if (!ownDescriptor) { if (isObject(prototype = getPrototypeOf(target))) { return set(prototype, propertyKey, V, receiver); } - ownDescriptor = createPropertyDescriptor(0); } - if (isDataDescriptor(ownDescriptor)) { if (ownDescriptor.writable === false || !isObject(receiver)) return false; - if (existingDescriptor = getOwnPropertyDescriptorModule.f(receiver, propertyKey)) { if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; existingDescriptor.value = V; @@ -12199,21 +10704,17 @@ function set(target, propertyKey, V if (setter === undefined) return false; call(setter, receiver, V); } - return true; -} // MS Edge 17-18 Reflect.set allows setting the property to object +} + +// MS Edge 17-18 Reflect.set allows setting the property to object // with non-writable property on the prototype - - var MS_EDGE_BUG = fails(function () { - var Constructor = function () { - /* empty */ - }; - + var Constructor = function () {/* empty */}; var object = definePropertyModule.f(new Constructor(), 'a', { configurable: true - }); // eslint-disable-next-line es-x/no-reflect -- required for testing - + }); + // eslint-disable-next-line es/no-reflect -- required for testing return Reflect.set(Constructor.prototype, 'a', 1, object) !== false; }); $({ @@ -12225,19 +10726,16 @@ $({ }); /***/ }), -/* 351 */ +/* 364 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var anObject = __webpack_require__(47); +var aPossiblePrototype = __webpack_require__(118); +var objectSetPrototypeOf = __webpack_require__(116); -var anObject = __webpack_require__(46); - -var aPossiblePrototype = __webpack_require__(113); - -var objectSetPrototypeOf = __webpack_require__(112); // `Reflect.setPrototypeOf` method +// `Reflect.setPrototypeOf` method // https://tc39.es/ecma262/#sec-reflect.setprototypeof - - if (objectSetPrototypeOf) $({ target: 'Reflect', stat: true @@ -12245,7 +10743,6 @@ if (objectSetPrototypeOf) $({ setPrototypeOf: function setPrototypeOf(target, proto) { anObject(target); aPossiblePrototype(proto); - try { objectSetPrototypeOf(target, proto); return true; @@ -12256,70 +10753,47 @@ if (objectSetPrototypeOf) $({ }); /***/ }), -/* 352 */ +/* 365 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var global = __webpack_require__(4); - -var setToStringTag = __webpack_require__(82); - +var setToStringTag = __webpack_require__(84); $({ global: true }, { Reflect: {} -}); // Reflect[@@toStringTag] property -// https://tc39.es/ecma262/#sec-reflect-@@tostringtag +}); +// Reflect[@@toStringTag] property +// https://tc39.es/ecma262/#sec-reflect-@@tostringtag setToStringTag(global.Reflect, 'Reflect', true); /***/ }), -/* 353 */ +/* 366 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(6); - var global = __webpack_require__(4); - var uncurryThis = __webpack_require__(14); - -var isForced = __webpack_require__(67); - -var inheritIfRequired = __webpack_require__(115); - -var createNonEnumerableProperty = __webpack_require__(43); - -var getOwnPropertyNames = (__webpack_require__(57).f); - -var isPrototypeOf = __webpack_require__(24); - -var isRegExp = __webpack_require__(354); - -var toString = __webpack_require__(68); - -var getRegExpFlags = __webpack_require__(355); - -var stickyHelpers = __webpack_require__(357); - -var proxyAccessor = __webpack_require__(114); - -var defineBuiltIn = __webpack_require__(47); - +var isForced = __webpack_require__(68); +var inheritIfRequired = __webpack_require__(120); +var createNonEnumerableProperty = __webpack_require__(44); +var getOwnPropertyNames = (__webpack_require__(58).f); +var isPrototypeOf = __webpack_require__(25); +var isRegExp = __webpack_require__(367); +var toString = __webpack_require__(69); +var getRegExpFlags = __webpack_require__(368); +var stickyHelpers = __webpack_require__(370); +var proxyAccessor = __webpack_require__(119); +var defineBuiltIn = __webpack_require__(48); var fails = __webpack_require__(7); - -var hasOwn = __webpack_require__(38); - -var enforceInternalState = (__webpack_require__(51).enforce); - -var setSpecies = __webpack_require__(188); - -var wellKnownSymbol = __webpack_require__(33); - -var UNSUPPORTED_DOT_ALL = __webpack_require__(358); - -var UNSUPPORTED_NCG = __webpack_require__(359); - +var hasOwn = __webpack_require__(39); +var enforceInternalState = (__webpack_require__(52).enforce); +var setSpecies = __webpack_require__(194); +var wellKnownSymbol = __webpack_require__(34); +var UNSUPPORTED_DOT_ALL = __webpack_require__(371); +var UNSUPPORTED_NCG = __webpack_require__(372); var MATCH = wellKnownSymbol('match'); var NativeRegExp = global.RegExp; var RegExpPrototype = NativeRegExp.prototype; @@ -12328,36 +10802,33 @@ var exec = uncurryThis(RegExpPrototype.exec); var charAt = uncurryThis(''.charAt); var replace = uncurryThis(''.replace); var stringIndexOf = uncurryThis(''.indexOf); -var stringSlice = uncurryThis(''.slice); // TODO: Use only proper RegExpIdentifierName - +var stringSlice = uncurryThis(''.slice); +// TODO: Use only proper RegExpIdentifierName var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/; var re1 = /a/g; -var re2 = /a/g; // "new" should create a new object, old webkit bug +var re2 = /a/g; +// "new" should create a new object, old webkit bug var CORRECT_NEW = new NativeRegExp(re1) !== re1; var MISSED_STICKY = stickyHelpers.MISSED_STICKY; var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; var BASE_FORCED = DESCRIPTORS && (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG || fails(function () { - re2[MATCH] = false; // RegExp constructor can alter flags and IsRegExp works correct with @@match - + re2[MATCH] = false; + // RegExp constructor can alter flags and IsRegExp works correct with @@match return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i'; })); - var handleDotAll = function (string) { var length = string.length; var index = 0; var result = ''; var brackets = false; var chr; - for (; index <= length; index++) { chr = charAt(string, index); - if (chr === '\\') { result += chr + charAt(string, ++index); continue; } - if (!brackets && chr === '.') { result += '[\\s\\S]'; } else { @@ -12366,14 +10837,11 @@ var handleDotAll = function (string) { } else if (chr === ']') { brackets = false; } - result += chr; } } - return result; }; - var handleNCG = function (string) { var length = string.length; var index = 0; @@ -12385,10 +10853,8 @@ var handleNCG = function (string) { var groupid = 0; var groupname = ''; var chr; - for (; index <= length; index++) { chr = charAt(string, index); - if (chr === '\\') { chr = chr + charAt(string, ++index); } else if (chr === ']') { @@ -12397,37 +10863,31 @@ var handleNCG = function (string) { case chr === '[': brackets = true; break; - case chr === '(': if (exec(IS_NCG, stringSlice(string, index + 1))) { index += 2; ncg = true; } - result += chr; groupid++; continue; - case chr === '>' && ncg: if (groupname === '' || hasOwn(names, groupname)) { throw new SyntaxError('Invalid capture group name'); } - names[groupname] = true; named[named.length] = [groupname, groupid]; ncg = false; groupname = ''; continue; } - if (ncg) groupname += chr;else result += chr; } - return [result, named]; -}; // `RegExp` constructor +}; + +// `RegExp` constructor // https://tc39.es/ecma262/#sec-regexp-constructor - - if (isForced('RegExp', BASE_FORCED)) { var RegExpWrapper = function RegExp(pattern, flags) { var thisIsRegExp = isPrototypeOf(RegExpPrototype, this); @@ -12436,123 +10896,100 @@ if (isForced('RegExp', BASE_FORCED)) { var groups = []; var rawPattern = pattern; var rawFlags, dotAll, sticky, handled, result, state; - if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) { return pattern; } - if (patternIsRegExp || isPrototypeOf(RegExpPrototype, pattern)) { pattern = pattern.source; if (flagsAreUndefined) flags = getRegExpFlags(rawPattern); } - pattern = pattern === undefined ? '' : toString(pattern); flags = flags === undefined ? '' : toString(flags); rawPattern = pattern; - if (UNSUPPORTED_DOT_ALL && 'dotAll' in re1) { dotAll = !!flags && stringIndexOf(flags, 's') > -1; if (dotAll) flags = replace(flags, /s/g, ''); } - rawFlags = flags; - if (MISSED_STICKY && 'sticky' in re1) { sticky = !!flags && stringIndexOf(flags, 'y') > -1; if (sticky && UNSUPPORTED_Y) flags = replace(flags, /y/g, ''); } - if (UNSUPPORTED_NCG) { handled = handleNCG(pattern); pattern = handled[0]; groups = handled[1]; } - result = inheritIfRequired(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype, RegExpWrapper); - if (dotAll || sticky || groups.length) { state = enforceInternalState(result); - if (dotAll) { state.dotAll = true; state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags); } - if (sticky) state.sticky = true; if (groups.length) state.groups = groups; } - if (pattern !== rawPattern) try { // fails in old engines, but we have no alternatives for unsupported regex syntax createNonEnumerableProperty(result, 'source', rawPattern === '' ? '(?:)' : rawPattern); - } catch (error) { - /* empty */ - } + } catch (error) {/* empty */} return result; }; - for (var keys = getOwnPropertyNames(NativeRegExp), index = 0; keys.length > index;) { proxyAccessor(RegExpWrapper, NativeRegExp, keys[index++]); } - RegExpPrototype.constructor = RegExpWrapper; RegExpWrapper.prototype = RegExpPrototype; defineBuiltIn(global, 'RegExp', RegExpWrapper, { constructor: true }); -} // https://tc39.es/ecma262/#sec-get-regexp-@@species - +} +// https://tc39.es/ecma262/#sec-get-regexp-@@species setSpecies('RegExp'); /***/ }), -/* 354 */ +/* 367 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var isObject = __webpack_require__(20); - var classof = __webpack_require__(15); +var wellKnownSymbol = __webpack_require__(34); +var MATCH = wellKnownSymbol('match'); -var wellKnownSymbol = __webpack_require__(33); - -var MATCH = wellKnownSymbol('match'); // `IsRegExp` abstract operation +// `IsRegExp` abstract operation // https://tc39.es/ecma262/#sec-isregexp - module.exports = function (it) { var isRegExp; return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp'); }; /***/ }), -/* 355 */ +/* 368 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var call = __webpack_require__(8); - -var hasOwn = __webpack_require__(38); - -var isPrototypeOf = __webpack_require__(24); - -var regExpFlags = __webpack_require__(356); - +var hasOwn = __webpack_require__(39); +var isPrototypeOf = __webpack_require__(25); +var regExpFlags = __webpack_require__(369); var RegExpPrototype = RegExp.prototype; - module.exports = function (R) { var flags = R.flags; return flags === undefined && !('flags' in RegExpPrototype) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype, R) ? call(regExpFlags, R) : flags; }; /***/ }), -/* 356 */ +/* 369 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var anObject = __webpack_require__(46); // `RegExp.prototype.flags` getter implementation +var anObject = __webpack_require__(47); + +// `RegExp.prototype.flags` getter implementation // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags - - module.exports = function () { var that = anObject(this); var result = ''; @@ -12568,22 +11005,22 @@ module.exports = function () { }; /***/ }), -/* 357 */ +/* 370 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fails = __webpack_require__(7); +var global = __webpack_require__(4); -var global = __webpack_require__(4); // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError - - +// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError var $RegExp = global.RegExp; var UNSUPPORTED_Y = fails(function () { var re = $RegExp('a', 'y'); re.lastIndex = 2; return re.exec('abcd') != null; -}); // UC Browser bug -// https://github.com/zloirock/core-js/issues/1008 +}); +// UC Browser bug +// https://github.com/zloirock/core-js/issues/1008 var MISSED_STICKY = UNSUPPORTED_Y || fails(function () { return !$RegExp('a', 'y').sticky; }); @@ -12600,14 +11037,13 @@ module.exports = { }; /***/ }), -/* 358 */ +/* 371 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fails = __webpack_require__(7); +var global = __webpack_require__(4); -var global = __webpack_require__(4); // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError - - +// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError var $RegExp = global.RegExp; module.exports = fails(function () { var re = $RegExp('.', 's'); @@ -12615,14 +11051,13 @@ module.exports = fails(function () { }); /***/ }), -/* 359 */ +/* 372 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fails = __webpack_require__(7); +var global = __webpack_require__(4); -var global = __webpack_require__(4); // babel-minify and Closure Compiler transpiles RegExp('(?b)', 'g') -> /(?b)/g and it causes SyntaxError - - +// babel-minify and Closure Compiler transpiles RegExp('(?b)', 'g') -> /(?b)/g and it causes SyntaxError var $RegExp = global.RegExp; module.exports = fails(function () { var re = $RegExp('(?b)', 'g'); @@ -12630,52 +11065,46 @@ module.exports = fails(function () { }); /***/ }), -/* 360 */ +/* 373 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(6); - -var UNSUPPORTED_DOT_ALL = __webpack_require__(358); - +var UNSUPPORTED_DOT_ALL = __webpack_require__(371); var classof = __webpack_require__(15); - -var defineBuiltInAccessor = __webpack_require__(304); - -var getInternalState = (__webpack_require__(51).get); - +var defineBuiltInAccessor = __webpack_require__(79); +var getInternalState = (__webpack_require__(52).get); var RegExpPrototype = RegExp.prototype; -var $TypeError = TypeError; // `RegExp.prototype.dotAll` getter -// https://tc39.es/ecma262/#sec-get-regexp.prototype.dotall +var $TypeError = TypeError; +// `RegExp.prototype.dotAll` getter +// https://tc39.es/ecma262/#sec-get-regexp.prototype.dotall if (DESCRIPTORS && UNSUPPORTED_DOT_ALL) { defineBuiltInAccessor(RegExpPrototype, 'dotAll', { configurable: true, get: function dotAll() { - if (this === RegExpPrototype) return undefined; // We can't use InternalStateModule.getterFor because + if (this === RegExpPrototype) return undefined; + // We can't use InternalStateModule.getterFor because // we don't add metadata for regexps created by a literal. - if (classof(this) === 'RegExp') { return !!getInternalState(this).dotAll; } - throw $TypeError('Incompatible receiver, RegExp required'); } }); } /***/ }), -/* 361 */ +/* 374 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var exec = __webpack_require__(375); -var exec = __webpack_require__(362); // `RegExp.prototype.exec` method +// `RegExp.prototype.exec` method // https://tc39.es/ecma262/#sec-regexp.prototype.exec - - $({ target: 'RegExp', proto: true, @@ -12685,35 +11114,24 @@ $({ }); /***/ }), -/* 362 */ +/* 375 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; + /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */ - /* eslint-disable regexp/no-useless-quantifier -- testing */ - var call = __webpack_require__(8); - var uncurryThis = __webpack_require__(14); - -var toString = __webpack_require__(68); - -var regexpFlags = __webpack_require__(356); - -var stickyHelpers = __webpack_require__(357); - -var shared = __webpack_require__(34); - -var create = __webpack_require__(71); - -var getInternalState = (__webpack_require__(51).get); - -var UNSUPPORTED_DOT_ALL = __webpack_require__(358); - -var UNSUPPORTED_NCG = __webpack_require__(359); - +var toString = __webpack_require__(69); +var regexpFlags = __webpack_require__(369); +var stickyHelpers = __webpack_require__(370); +var shared = __webpack_require__(35); +var create = __webpack_require__(72); +var getInternalState = (__webpack_require__(52).get); +var UNSUPPORTED_DOT_ALL = __webpack_require__(371); +var UNSUPPORTED_NCG = __webpack_require__(372); var nativeReplace = shared('native-string-replace', String.prototype.replace); var nativeExec = RegExp.prototype.exec; var patchedExec = nativeExec; @@ -12721,7 +11139,6 @@ var charAt = uncurryThis(''.charAt); var indexOf = uncurryThis(''.indexOf); var replace = uncurryThis(''.replace); var stringSlice = uncurryThis(''.slice); - var UPDATES_LAST_INDEX_WRONG = function () { var re1 = /a/; var re2 = /b*/g; @@ -12729,12 +11146,11 @@ var UPDATES_LAST_INDEX_WRONG = function () { call(nativeExec, re2, 'a'); return re1.lastIndex !== 0 || re2.lastIndex !== 0; }(); +var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET; -var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET; // nonparticipating capturing group, copied from es5-shim's String#split patch. - +// nonparticipating capturing group, copied from es5-shim's String#split patch. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG; - if (PATCH) { patchedExec = function exec(string) { var re = this; @@ -12742,48 +11158,39 @@ if (PATCH) { var str = toString(string); var raw = state.raw; var result, reCopy, lastIndex, match, i, object, group; - if (raw) { raw.lastIndex = re.lastIndex; result = call(patchedExec, raw, str); re.lastIndex = raw.lastIndex; return result; } - var groups = state.groups; var sticky = UNSUPPORTED_Y && re.sticky; var flags = call(regexpFlags, re); var source = re.source; var charsAdded = 0; var strCopy = str; - if (sticky) { flags = replace(flags, 'y', ''); - if (indexOf(flags, 'g') === -1) { flags += 'g'; } - - strCopy = stringSlice(str, re.lastIndex); // Support anchored sticky behavior. - + strCopy = stringSlice(str, re.lastIndex); + // Support anchored sticky behavior. if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\n')) { source = '(?: ' + source + ')'; strCopy = ' ' + strCopy; charsAdded++; - } // ^(? + rx + ) is needed, in combination with some str slicing, to + } + // ^(? + rx + ) is needed, in combination with some str slicing, to // simulate the 'y' flag. - - reCopy = new RegExp('^(?:' + source + ')', flags); } - if (NPCG_INCLUDED) { reCopy = new RegExp('^' + source + '$(?!\\s)', flags); } - if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex; match = call(nativeExec, sticky ? reCopy : re, strCopy); - if (sticky) { if (match) { match.input = stringSlice(match.input, charsAdded); @@ -12794,7 +11201,6 @@ if (PATCH) { } else if (UPDATES_LAST_INDEX_WRONG && match) { re.lastIndex = re.global ? match.index + match[0].length : lastIndex; } - if (NPCG_INCLUDED && match && match.length > 1) { // Fix browsers whose `exec` methods don't consistently return `undefined` // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/ @@ -12804,55 +11210,44 @@ if (PATCH) { } }); } - if (match && groups) { match.groups = object = create(null); - for (i = 0; i < groups.length; i++) { group = groups[i]; object[group[0]] = match[group[1]]; } } - return match; }; } - module.exports = patchedExec; /***/ }), -/* 363 */ +/* 376 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4); - var DESCRIPTORS = __webpack_require__(6); +var defineBuiltInAccessor = __webpack_require__(79); +var regExpFlags = __webpack_require__(369); +var fails = __webpack_require__(7); -var defineBuiltInAccessor = __webpack_require__(304); - -var regExpFlags = __webpack_require__(356); - -var fails = __webpack_require__(7); // babel-minify and Closure Compiler transpiles RegExp('.', 'd') -> /./d and it causes SyntaxError - - +// babel-minify and Closure Compiler transpiles RegExp('.', 'd') -> /./d and it causes SyntaxError var RegExp = global.RegExp; var RegExpPrototype = RegExp.prototype; var FORCED = DESCRIPTORS && fails(function () { var INDICES_SUPPORT = true; - try { RegExp('.', 'd'); } catch (error) { INDICES_SUPPORT = false; } - - var O = {}; // modern V8 bug - + var O = {}; + // modern V8 bug var calls = ''; var expected = INDICES_SUPPORT ? 'dgimsy' : 'gimsy'; - var addGetter = function (key, chr) { - // eslint-disable-next-line es-x/no-object-defineproperty -- safe + // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty(O, key, { get: function () { calls += chr; @@ -12860,7 +11255,6 @@ var FORCED = DESCRIPTORS && fails(function () { } }); }; - var pairs = { dotAll: 's', global: 'g', @@ -12869,88 +11263,76 @@ var FORCED = DESCRIPTORS && fails(function () { sticky: 'y' }; if (INDICES_SUPPORT) pairs.hasIndices = 'd'; + for (var key in pairs) addGetter(key, pairs[key]); - for (var key in pairs) addGetter(key, pairs[key]); // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe - - + // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var result = Object.getOwnPropertyDescriptor(RegExpPrototype, 'flags').get.call(O); return result !== expected || calls !== expected; -}); // `RegExp.prototype.flags` getter -// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags +}); +// `RegExp.prototype.flags` getter +// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags if (FORCED) defineBuiltInAccessor(RegExpPrototype, 'flags', { configurable: true, get: regExpFlags }); /***/ }), -/* 364 */ +/* 377 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var DESCRIPTORS = __webpack_require__(6); - -var MISSED_STICKY = (__webpack_require__(357).MISSED_STICKY); - +var MISSED_STICKY = (__webpack_require__(370).MISSED_STICKY); var classof = __webpack_require__(15); - -var defineBuiltInAccessor = __webpack_require__(304); - -var getInternalState = (__webpack_require__(51).get); - +var defineBuiltInAccessor = __webpack_require__(79); +var getInternalState = (__webpack_require__(52).get); var RegExpPrototype = RegExp.prototype; -var $TypeError = TypeError; // `RegExp.prototype.sticky` getter -// https://tc39.es/ecma262/#sec-get-regexp.prototype.sticky +var $TypeError = TypeError; +// `RegExp.prototype.sticky` getter +// https://tc39.es/ecma262/#sec-get-regexp.prototype.sticky if (DESCRIPTORS && MISSED_STICKY) { defineBuiltInAccessor(RegExpPrototype, 'sticky', { configurable: true, get: function sticky() { - if (this === RegExpPrototype) return undefined; // We can't use InternalStateModule.getterFor because + if (this === RegExpPrototype) return; + // We can't use InternalStateModule.getterFor because // we don't add metadata for regexps created by a literal. - if (classof(this) === 'RegExp') { return !!getInternalState(this).sticky; } - throw $TypeError('Incompatible receiver, RegExp required'); } }); } /***/ }), -/* 365 */ +/* 378 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; - // TODO: Remove from `core-js@4` since it's moved to entry points -__webpack_require__(361); +// TODO: Remove from `core-js@4` since it's moved to entry points +__webpack_require__(374); var $ = __webpack_require__(3); - var call = __webpack_require__(8); - var isCallable = __webpack_require__(21); - -var anObject = __webpack_require__(46); - -var toString = __webpack_require__(68); - +var anObject = __webpack_require__(47); +var toString = __webpack_require__(69); var DELEGATES_TO_EXEC = function () { var execCalled = false; var re = /[ac]/; - re.exec = function () { execCalled = true; return /./.exec.apply(this, arguments); }; - return re.test('abc') === true && execCalled; }(); +var nativeTest = /./.test; -var nativeTest = /./.test; // `RegExp.prototype.test` method +// `RegExp.prototype.test` method // https://tc39.es/ecma262/#sec-regexp.prototype.test - $({ target: 'RegExp', proto: true, @@ -12969,24 +11351,18 @@ $({ }); /***/ }), -/* 366 */ +/* 379 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var PROPER_FUNCTION_NAME = (__webpack_require__(49).PROPER); - -var defineBuiltIn = __webpack_require__(47); - -var anObject = __webpack_require__(46); - -var $toString = __webpack_require__(68); - +var PROPER_FUNCTION_NAME = (__webpack_require__(50).PROPER); +var defineBuiltIn = __webpack_require__(48); +var anObject = __webpack_require__(47); +var $toString = __webpack_require__(69); var fails = __webpack_require__(7); - -var getRegExpFlags = __webpack_require__(355); - +var getRegExpFlags = __webpack_require__(368); var TO_STRING = 'toString'; var RegExpPrototype = RegExp.prototype; var nativeToString = RegExpPrototype[TO_STRING]; @@ -12995,11 +11371,12 @@ var NOT_GENERIC = fails(function () { source: 'a', flags: 'b' }) != '/a/b'; -}); // FF44- RegExp#toString has a wrong name +}); +// FF44- RegExp#toString has a wrong name +var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name != TO_STRING; -var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name != TO_STRING; // `RegExp.prototype.toString` method +// `RegExp.prototype.toString` method // https://tc39.es/ecma262/#sec-regexp.prototype.tostring - if (NOT_GENERIC || INCORRECT_NAME) { defineBuiltIn(RegExp.prototype, TO_STRING, function toString() { var R = anObject(this); @@ -13012,25 +11389,24 @@ if (NOT_GENERIC || INCORRECT_NAME) { } /***/ }), -/* 367 */ +/* 380 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove this module from `core-js@4` since it's replaced to module below -__webpack_require__(368); +__webpack_require__(381); /***/ }), -/* 368 */ +/* 381 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var collection = __webpack_require__(228); +var collection = __webpack_require__(242); +var collectionStrong = __webpack_require__(247); -var collectionStrong = __webpack_require__(233); // `Set` constructor +// `Set` constructor // https://tc39.es/ecma262/#sec-set-objects - - collection('Set', function (init) { return function Set() { return init(this, arguments.length ? arguments[0] : undefined); @@ -13038,31 +11414,26 @@ collection('Set', function (init) { }, collectionStrong); /***/ }), -/* 369 */ +/* 382 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var uncurryThis = __webpack_require__(14); - var requireObjectCoercible = __webpack_require__(16); - -var toIntegerOrInfinity = __webpack_require__(61); - -var toString = __webpack_require__(68); - +var toIntegerOrInfinity = __webpack_require__(62); +var toString = __webpack_require__(69); var fails = __webpack_require__(7); - var charAt = uncurryThis(''.charAt); var FORCED = fails(function () { - // eslint-disable-next-line es-x/no-array-string-prototype-at -- safe + // eslint-disable-next-line es/no-array-string-prototype-at -- safe return '𠮷'.at(-2) !== '\uD842'; -}); // `String.prototype.at` method -// https://github.com/tc39/proposal-relative-indexing-method +}); +// `String.prototype.at` method +// https://github.com/tc39/proposal-relative-indexing-method $({ target: 'String', proto: true, @@ -13078,18 +11449,17 @@ $({ }); /***/ }), -/* 370 */ +/* 383 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var codeAt = (__webpack_require__(384).codeAt); -var codeAt = (__webpack_require__(371).codeAt); // `String.prototype.codePointAt` method +// `String.prototype.codePointAt` method // https://tc39.es/ecma262/#sec-string.prototype.codepointat - - $({ target: 'String', proto: true @@ -13100,21 +11470,16 @@ $({ }); /***/ }), -/* 371 */ +/* 384 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(14); - -var toIntegerOrInfinity = __webpack_require__(61); - -var toString = __webpack_require__(68); - +var toIntegerOrInfinity = __webpack_require__(62); +var toString = __webpack_require__(69); var requireObjectCoercible = __webpack_require__(16); - var charAt = uncurryThis(''.charAt); var charCodeAt = uncurryThis(''.charCodeAt); var stringSlice = uncurryThis(''.slice); - var createMethod = function (CONVERT_TO_STRING) { return function ($this, pos) { var S = toString(requireObjectCoercible($this)); @@ -13126,7 +11491,6 @@ var createMethod = function (CONVERT_TO_STRING) { return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? charAt(S, position) : first : CONVERT_TO_STRING ? stringSlice(S, position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; }; }; - module.exports = { // `String.prototype.codePointAt` method // https://tc39.es/ecma262/#sec-string.prototype.codepointat @@ -13137,50 +11501,41 @@ module.exports = { }; /***/ }), -/* 372 */ +/* 385 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - -var uncurryThis = __webpack_require__(14); - +var uncurryThis = __webpack_require__(87); var getOwnPropertyDescriptor = (__webpack_require__(5).f); - -var toLength = __webpack_require__(64); - -var toString = __webpack_require__(68); - -var notARegExp = __webpack_require__(373); - +var toLength = __webpack_require__(65); +var toString = __webpack_require__(69); +var notARegExp = __webpack_require__(386); var requireObjectCoercible = __webpack_require__(16); +var correctIsRegExpLogic = __webpack_require__(387); +var IS_PURE = __webpack_require__(36); -var correctIsRegExpLogic = __webpack_require__(374); - -var IS_PURE = __webpack_require__(35); // eslint-disable-next-line es-x/no-string-prototype-endswith -- safe - - +// eslint-disable-next-line es/no-string-prototype-endswith -- safe var nativeEndsWith = uncurryThis(''.endsWith); var slice = uncurryThis(''.slice); var min = Math.min; -var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith'); // https://github.com/zloirock/core-js/pull/702 - +var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith'); +// https://github.com/zloirock/core-js/pull/702 var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () { var descriptor = getOwnPropertyDescriptor(String.prototype, 'endsWith'); return descriptor && !descriptor.writable; -}(); // `String.prototype.endsWith` method -// https://tc39.es/ecma262/#sec-string.prototype.endswith +}(); +// `String.prototype.endsWith` method +// https://tc39.es/ecma262/#sec-string.prototype.endswith $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, { - endsWith: function endsWith(searchString - /* , endPosition = @length */ - ) { + endsWith: function endsWith(searchString /* , endPosition = @length */) { var that = toString(requireObjectCoercible(this)); notARegExp(searchString); var endPosition = arguments.length > 1 ? arguments[1] : undefined; @@ -13192,65 +11547,55 @@ $({ }); /***/ }), -/* 373 */ +/* 386 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var isRegExp = __webpack_require__(354); - +var isRegExp = __webpack_require__(367); var $TypeError = TypeError; - module.exports = function (it) { if (isRegExp(it)) { throw $TypeError("The method doesn't accept regular expressions"); } - return it; }; /***/ }), -/* 374 */ +/* 387 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var wellKnownSymbol = __webpack_require__(33); - +var wellKnownSymbol = __webpack_require__(34); var MATCH = wellKnownSymbol('match'); - module.exports = function (METHOD_NAME) { var regexp = /./; - try { '/./'[METHOD_NAME](regexp); } catch (error1) { try { regexp[MATCH] = false; return '/./'[METHOD_NAME](regexp); - } catch (error2) { - /* empty */ - } + } catch (error2) {/* empty */} } - return false; }; /***/ }), -/* 375 */ +/* 388 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var uncurryThis = __webpack_require__(14); - -var toAbsoluteIndex = __webpack_require__(60); - +var toAbsoluteIndex = __webpack_require__(61); var $RangeError = RangeError; -var fromCharCode = String.fromCharCode; // eslint-disable-next-line es-x/no-string-fromcodepoint -- required for testing - +var fromCharCode = String.fromCharCode; +// eslint-disable-next-line es/no-string-fromcodepoint -- required for testing var $fromCodePoint = String.fromCodePoint; -var join = uncurryThis([].join); // length should be 1, old FF problem +var join = uncurryThis([].join); -var INCORRECT_LENGTH = !!$fromCodePoint && $fromCodePoint.length != 1; // `String.fromCodePoint` method +// length should be 1, old FF problem +var INCORRECT_LENGTH = !!$fromCodePoint && $fromCodePoint.length != 1; + +// `String.fromCodePoint` method // https://tc39.es/ecma262/#sec-string.fromcodepoint - $({ target: 'String', stat: true, @@ -13263,79 +11608,67 @@ $({ var length = arguments.length; var i = 0; var code; - while (length > i) { code = +arguments[i++]; if (toAbsoluteIndex(code, 0x10FFFF) !== code) throw $RangeError(code + ' is not a valid code point'); elements[i] = code < 0x10000 ? fromCharCode(code) : fromCharCode(((code -= 0x10000) >> 10) + 0xD800, code % 0x400 + 0xDC00); } - return join(elements, ''); } }); /***/ }), -/* 376 */ +/* 389 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var uncurryThis = __webpack_require__(14); - -var notARegExp = __webpack_require__(373); - +var notARegExp = __webpack_require__(386); var requireObjectCoercible = __webpack_require__(16); +var toString = __webpack_require__(69); +var correctIsRegExpLogic = __webpack_require__(387); +var stringIndexOf = uncurryThis(''.indexOf); -var toString = __webpack_require__(68); - -var correctIsRegExpLogic = __webpack_require__(374); - -var stringIndexOf = uncurryThis(''.indexOf); // `String.prototype.includes` method +// `String.prototype.includes` method // https://tc39.es/ecma262/#sec-string.prototype.includes - $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, { - includes: function includes(searchString - /* , position = 0 */ - ) { + includes: function includes(searchString /* , position = 0 */) { return !!~stringIndexOf(toString(requireObjectCoercible(this)), toString(notARegExp(searchString)), arguments.length > 1 ? arguments[1] : undefined); } }); /***/ }), -/* 377 */ +/* 390 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var charAt = (__webpack_require__(371).charAt); - -var toString = __webpack_require__(68); - -var InternalStateModule = __webpack_require__(51); - -var defineIterator = __webpack_require__(164); - -var createIterResultObject = __webpack_require__(167); - +var charAt = (__webpack_require__(384).charAt); +var toString = __webpack_require__(69); +var InternalStateModule = __webpack_require__(52); +var defineIterator = __webpack_require__(170); +var createIterResultObject = __webpack_require__(173); var STRING_ITERATOR = 'String Iterator'; var setInternalState = InternalStateModule.set; -var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); // `String.prototype[@@iterator]` method -// https://tc39.es/ecma262/#sec-string.prototype-@@iterator +var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); +// `String.prototype[@@iterator]` method +// https://tc39.es/ecma262/#sec-string.prototype-@@iterator defineIterator(String, 'String', function (iterated) { setInternalState(this, { type: STRING_ITERATOR, string: toString(iterated), index: 0 - }); // `%StringIteratorPrototype%.next` method + }); + // `%StringIteratorPrototype%.next` method // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next }, function next() { var state = getInternalState(this); @@ -13349,41 +11682,34 @@ defineIterator(String, 'String', function (iterated) { }); /***/ }), -/* 378 */ +/* 391 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var call = __webpack_require__(8); - -var fixRegExpWellKnownSymbolLogic = __webpack_require__(379); - -var anObject = __webpack_require__(46); - +var fixRegExpWellKnownSymbolLogic = __webpack_require__(392); +var anObject = __webpack_require__(47); var isNullOrUndefined = __webpack_require__(17); - -var toLength = __webpack_require__(64); - -var toString = __webpack_require__(68); - +var toLength = __webpack_require__(65); +var toString = __webpack_require__(69); var requireObjectCoercible = __webpack_require__(16); +var getMethod = __webpack_require__(30); +var advanceStringIndex = __webpack_require__(393); +var regExpExec = __webpack_require__(394); -var getMethod = __webpack_require__(29); - -var advanceStringIndex = __webpack_require__(380); - -var regExpExec = __webpack_require__(381); // @@match logic - - +// @@match logic fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) { - return [// `String.prototype.match` method + return [ + // `String.prototype.match` method // https://tc39.es/ecma262/#sec-string.prototype.match function match(regexp) { var O = requireObjectCoercible(this); var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH); return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O)); - }, // `RegExp.prototype[@@match]` method + }, + // `RegExp.prototype[@@match]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@match function (string) { var rx = anObject(this); @@ -13396,91 +11722,73 @@ fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNa var A = []; var n = 0; var result; - while ((result = regExpExec(rx, S)) !== null) { var matchStr = toString(result[0]); A[n] = matchStr; if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); n++; } - return n === 0 ? null : A; }]; }); /***/ }), -/* 379 */ +/* 392 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; - // TODO: Remove from `core-js@4` since it's moved to entry points -__webpack_require__(361); - -var uncurryThis = __webpack_require__(14); - -var defineBuiltIn = __webpack_require__(47); - -var regexpExec = __webpack_require__(362); +// TODO: Remove from `core-js@4` since it's moved to entry points +__webpack_require__(374); +var uncurryThis = __webpack_require__(87); +var defineBuiltIn = __webpack_require__(48); +var regexpExec = __webpack_require__(375); var fails = __webpack_require__(7); - -var wellKnownSymbol = __webpack_require__(33); - -var createNonEnumerableProperty = __webpack_require__(43); - +var wellKnownSymbol = __webpack_require__(34); +var createNonEnumerableProperty = __webpack_require__(44); var SPECIES = wellKnownSymbol('species'); var RegExpPrototype = RegExp.prototype; - module.exports = function (KEY, exec, FORCED, SHAM) { var SYMBOL = wellKnownSymbol(KEY); var DELEGATES_TO_SYMBOL = !fails(function () { // String methods call symbol-named RegEp methods var O = {}; - O[SYMBOL] = function () { return 7; }; - return ''[KEY](O) != 7; }); var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () { // Symbol-named RegExp methods call .exec var execCalled = false; var re = /a/; - if (KEY === 'split') { // We can't use real regex here since it causes deoptimization // and serious performance degradation in V8 // https://github.com/zloirock/core-js/issues/306 - re = {}; // RegExp[@@split] doesn't call the regex's exec method, but first creates + re = {}; + // RegExp[@@split] doesn't call the regex's exec method, but first creates // a new one. We need to return the patched regex when creating the new one. - re.constructor = {}; - re.constructor[SPECIES] = function () { return re; }; - re.flags = ''; re[SYMBOL] = /./[SYMBOL]; } - re.exec = function () { execCalled = true; return null; }; - re[SYMBOL](''); return !execCalled; }); - if (!DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC || FORCED) { var uncurriedNativeRegExpMethod = uncurryThis(/./[SYMBOL]); var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { var uncurriedNativeMethod = uncurryThis(nativeMethod); var $exec = regexp.exec; - if ($exec === regexpExec || $exec === RegExpPrototype.exec) { if (DELEGATES_TO_SYMBOL && !forceStringMethod) { // The native String method already delegates to @@method (this @@ -13491,13 +11799,11 @@ module.exports = function (KEY, exec, FORCED, SHAM) { value: uncurriedNativeRegExpMethod(regexp, str, arg2) }; } - return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) }; } - return { done: false }; @@ -13505,107 +11811,78 @@ module.exports = function (KEY, exec, FORCED, SHAM) { defineBuiltIn(String.prototype, KEY, methods[0]); defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]); } - if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true); }; /***/ }), -/* 380 */ +/* 393 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var charAt = (__webpack_require__(371).charAt); // `AdvanceStringIndex` abstract operation +var charAt = (__webpack_require__(384).charAt); + +// `AdvanceStringIndex` abstract operation // https://tc39.es/ecma262/#sec-advancestringindex - - module.exports = function (S, index, unicode) { return index + (unicode ? charAt(S, index).length : 1); }; /***/ }), -/* 381 */ +/* 394 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var call = __webpack_require__(8); - -var anObject = __webpack_require__(46); - +var anObject = __webpack_require__(47); var isCallable = __webpack_require__(21); - var classof = __webpack_require__(15); +var regexpExec = __webpack_require__(375); +var $TypeError = TypeError; -var regexpExec = __webpack_require__(362); - -var $TypeError = TypeError; // `RegExpExec` abstract operation +// `RegExpExec` abstract operation // https://tc39.es/ecma262/#sec-regexpexec - module.exports = function (R, S) { var exec = R.exec; - if (isCallable(exec)) { var result = call(exec, R, S); if (result !== null) anObject(result); return result; } - if (classof(R) === 'RegExp') return call(regexpExec, R, S); throw $TypeError('RegExp#exec called on incompatible receiver'); }; /***/ }), -/* 382 */ +/* 395 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -/* eslint-disable es-x/no-string-prototype-matchall -- safe */ +/* eslint-disable es/no-string-prototype-matchall -- safe */ var $ = __webpack_require__(3); - var call = __webpack_require__(8); - -var uncurryThis = __webpack_require__(14); - -var createIteratorConstructor = __webpack_require__(165); - -var createIterResultObject = __webpack_require__(167); - +var uncurryThis = __webpack_require__(87); +var createIteratorConstructor = __webpack_require__(171); +var createIterResultObject = __webpack_require__(173); var requireObjectCoercible = __webpack_require__(16); - -var toLength = __webpack_require__(64); - -var toString = __webpack_require__(68); - -var anObject = __webpack_require__(46); - +var toLength = __webpack_require__(65); +var toString = __webpack_require__(69); +var anObject = __webpack_require__(47); var isNullOrUndefined = __webpack_require__(17); - var classof = __webpack_require__(15); - -var isRegExp = __webpack_require__(354); - -var getRegExpFlags = __webpack_require__(355); - -var getMethod = __webpack_require__(29); - -var defineBuiltIn = __webpack_require__(47); - +var isRegExp = __webpack_require__(367); +var getRegExpFlags = __webpack_require__(368); +var getMethod = __webpack_require__(30); +var defineBuiltIn = __webpack_require__(48); var fails = __webpack_require__(7); - -var wellKnownSymbol = __webpack_require__(33); - -var speciesConstructor = __webpack_require__(203); - -var advanceStringIndex = __webpack_require__(380); - -var regExpExec = __webpack_require__(381); - -var InternalStateModule = __webpack_require__(51); - -var IS_PURE = __webpack_require__(35); - +var wellKnownSymbol = __webpack_require__(34); +var speciesConstructor = __webpack_require__(217); +var advanceStringIndex = __webpack_require__(393); +var regExpExec = __webpack_require__(394); +var InternalStateModule = __webpack_require__(52); +var IS_PURE = __webpack_require__(36); var MATCH_ALL = wellKnownSymbol('matchAll'); var REGEXP_STRING = 'RegExp String'; var REGEXP_STRING_ITERATOR = REGEXP_STRING + ' Iterator'; @@ -13633,21 +11910,17 @@ var $RegExpStringIterator = createIteratorConstructor(function RegExpStringItera var R = state.regexp; var S = state.string; var match = regExpExec(R, S); - if (match === null) { state.done = true; return createIterResultObject(undefined, true); } - if (state.global) { if (toString(match[0]) === '') R.lastIndex = advanceStringIndex(S, toLength(R.lastIndex), state.unicode); return createIterResultObject(match, false); } - state.done = true; return createIterResultObject(match, false); }); - var $matchAll = function (string) { var R = anObject(this); var S = toString(string); @@ -13659,10 +11932,10 @@ var $matchAll = function (string) { fullUnicode = !!~stringIndexOf(flags, 'u'); matcher.lastIndex = toLength(R.lastIndex); return new $RegExpStringIterator(matcher, S, $global, fullUnicode); -}; // `String.prototype.matchAll` method +}; + +// `String.prototype.matchAll` method // https://tc39.es/ecma262/#sec-string.prototype.matchall - - $({ target: 'String', proto: true, @@ -13671,19 +11944,16 @@ $({ matchAll: function matchAll(regexp) { var O = requireObjectCoercible(this); var flags, S, matcher, rx; - if (!isNullOrUndefined(regexp)) { if (isRegExp(regexp)) { flags = toString(requireObjectCoercible(getRegExpFlags(regexp))); if (!~stringIndexOf(flags, 'g')) throw $TypeError('`.matchAll` does not allow non-global regexes'); } - if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll(O, regexp); matcher = getMethod(regexp, MATCH_ALL); if (matcher === undefined && IS_PURE && classof(regexp) == 'RegExp') matcher = $matchAll; if (matcher) return call(matcher, regexp, O); } else if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll(O, regexp); - S = toString(O); rx = new RegExp(regexp, 'g'); return IS_PURE ? call($matchAll, rx, S) : rx[MATCH_ALL](S); @@ -13692,88 +11962,74 @@ $({ IS_PURE || MATCH_ALL in RegExpPrototype || defineBuiltIn(RegExpPrototype, MATCH_ALL, $matchAll); /***/ }), -/* 383 */ +/* 396 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var $padEnd = (__webpack_require__(227).end); +var WEBKIT_BUG = __webpack_require__(397); -var $padEnd = (__webpack_require__(213).end); - -var WEBKIT_BUG = __webpack_require__(384); // `String.prototype.padEnd` method +// `String.prototype.padEnd` method // https://tc39.es/ecma262/#sec-string.prototype.padend - - $({ target: 'String', proto: true, forced: WEBKIT_BUG }, { - padEnd: function padEnd(maxLength - /* , fillString = ' ' */ - ) { + padEnd: function padEnd(maxLength /* , fillString = ' ' */) { return $padEnd(this, maxLength, arguments.length > 1 ? arguments[1] : undefined); } }); /***/ }), -/* 384 */ +/* 397 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // https://github.com/zloirock/core-js/issues/280 -var userAgent = __webpack_require__(28); - +var userAgent = __webpack_require__(29); module.exports = /Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent); /***/ }), -/* 385 */ +/* 398 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var $padStart = (__webpack_require__(227).start); +var WEBKIT_BUG = __webpack_require__(397); -var $padStart = (__webpack_require__(213).start); - -var WEBKIT_BUG = __webpack_require__(384); // `String.prototype.padStart` method +// `String.prototype.padStart` method // https://tc39.es/ecma262/#sec-string.prototype.padstart - - $({ target: 'String', proto: true, forced: WEBKIT_BUG }, { - padStart: function padStart(maxLength - /* , fillString = ' ' */ - ) { + padStart: function padStart(maxLength /* , fillString = ' ' */) { return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined); } }); /***/ }), -/* 386 */ +/* 399 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var uncurryThis = __webpack_require__(14); - var toIndexedObject = __webpack_require__(12); - -var toObject = __webpack_require__(39); - -var toString = __webpack_require__(68); - -var lengthOfArrayLike = __webpack_require__(63); - +var toObject = __webpack_require__(40); +var toString = __webpack_require__(69); +var lengthOfArrayLike = __webpack_require__(64); var push = uncurryThis([].push); -var join = uncurryThis([].join); // `String.raw` method -// https://tc39.es/ecma262/#sec-string.raw +var join = uncurryThis([].join); +// `String.raw` method +// https://tc39.es/ecma262/#sec-string.raw $({ target: 'String', stat: true @@ -13781,11 +12037,11 @@ $({ raw: function raw(template) { var rawTemplate = toIndexedObject(toObject(template).raw); var literalSegments = lengthOfArrayLike(rawTemplate); + if (!literalSegments) return ''; var argumentsLength = arguments.length; var elements = []; var i = 0; - - while (literalSegments > i) { + while (true) { push(elements, toString(rawTemplate[i++])); if (i === literalSegments) return join(elements, ''); if (i < argumentsLength) push(elements, toString(arguments[i])); @@ -13794,15 +12050,14 @@ $({ }); /***/ }), -/* 387 */ +/* 400 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var repeat = __webpack_require__(228); -var repeat = __webpack_require__(214); // `String.prototype.repeat` method +// `String.prototype.repeat` method // https://tc39.es/ecma262/#sec-string.prototype.repeat - - $({ target: 'String', proto: true @@ -13811,46 +12066,29 @@ $({ }); /***/ }), -/* 388 */ +/* 401 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var apply = __webpack_require__(93); - +var apply = __webpack_require__(96); var call = __webpack_require__(8); - var uncurryThis = __webpack_require__(14); - -var fixRegExpWellKnownSymbolLogic = __webpack_require__(379); - +var fixRegExpWellKnownSymbolLogic = __webpack_require__(392); var fails = __webpack_require__(7); - -var anObject = __webpack_require__(46); - +var anObject = __webpack_require__(47); var isCallable = __webpack_require__(21); - var isNullOrUndefined = __webpack_require__(17); - -var toIntegerOrInfinity = __webpack_require__(61); - -var toLength = __webpack_require__(64); - -var toString = __webpack_require__(68); - +var toIntegerOrInfinity = __webpack_require__(62); +var toLength = __webpack_require__(65); +var toString = __webpack_require__(69); var requireObjectCoercible = __webpack_require__(16); - -var advanceStringIndex = __webpack_require__(380); - -var getMethod = __webpack_require__(29); - -var getSubstitution = __webpack_require__(389); - -var regExpExec = __webpack_require__(381); - -var wellKnownSymbol = __webpack_require__(33); - +var advanceStringIndex = __webpack_require__(393); +var getMethod = __webpack_require__(30); +var getSubstitution = __webpack_require__(402); +var regExpExec = __webpack_require__(394); +var wellKnownSymbol = __webpack_require__(34); var REPLACE = wellKnownSymbol('replace'); var max = Math.max; var min = Math.min; @@ -13858,72 +12096,65 @@ var concat = uncurryThis([].concat); var push = uncurryThis([].push); var stringIndexOf = uncurryThis(''.indexOf); var stringSlice = uncurryThis(''.slice); - var maybeToString = function (it) { return it === undefined ? it : String(it); -}; // IE <= 11 replaces $0 with the whole match, as if it was $& +}; + +// IE <= 11 replaces $0 with the whole match, as if it was $& // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0 - - var REPLACE_KEEPS_$0 = function () { // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing return 'a'.replace(/./, '$0') === '$0'; -}(); // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string - +}(); +// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = function () { if (/./[REPLACE]) { return /./[REPLACE]('a', '$0') === ''; } - return false; }(); - var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { var re = /./; - re.exec = function () { var result = []; result.groups = { a: '7' }; return result; - }; // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive - - + }; + // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive return ''.replace(re, '$') !== '7'; -}); // @@replace logic +}); +// @@replace logic fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) { var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0'; - return [// `String.prototype.replace` method + return [ + // `String.prototype.replace` method // https://tc39.es/ecma262/#sec-string.prototype.replace function replace(searchValue, replaceValue) { var O = requireObjectCoercible(this); var replacer = isNullOrUndefined(searchValue) ? undefined : getMethod(searchValue, REPLACE); return replacer ? call(replacer, searchValue, O, replaceValue) : call(nativeReplace, toString(O), searchValue, replaceValue); - }, // `RegExp.prototype[@@replace]` method + }, + // `RegExp.prototype[@@replace]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace function (string, replaceValue) { var rx = anObject(this); var S = toString(string); - if (typeof replaceValue == 'string' && stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 && stringIndexOf(replaceValue, '$<') === -1) { var res = maybeCallNative(nativeReplace, rx, S, replaceValue); if (res.done) return res.value; } - var functionalReplace = isCallable(replaceValue); if (!functionalReplace) replaceValue = toString(replaceValue); var global = rx.global; - if (global) { var fullUnicode = rx.unicode; rx.lastIndex = 0; } - var results = []; - while (true) { var result = regExpExec(rx, S); if (result === null) break; @@ -13932,24 +12163,20 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa var matchStr = toString(result[0]); if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); } - var accumulatedResult = ''; var nextSourcePosition = 0; - for (var i = 0; i < results.length; i++) { result = results[i]; var matched = toString(result[0]); var position = max(min(toIntegerOrInfinity(result.index), S.length), 0); - var captures = []; // NOTE: This is equivalent to + var captures = []; + // NOTE: This is equivalent to // captures = result.slice(1).map(maybeToString) // but for some reason `nativeSlice.call(result, 1, result.length)` (called in // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. - for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j])); - var namedCaptures = result.groups; - if (functionalReplace) { var replacerArgs = concat([matched], captures, position, S); if (namedCaptures !== undefined) push(replacerArgs, namedCaptures); @@ -13957,130 +12184,103 @@ fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa } else { replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); } - if (position >= nextSourcePosition) { accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement; nextSourcePosition = position + matched.length; } } - return accumulatedResult + stringSlice(S, nextSourcePosition); }]; }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE); /***/ }), -/* 389 */ +/* 402 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(14); - -var toObject = __webpack_require__(39); - +var toObject = __webpack_require__(40); var floor = Math.floor; var charAt = uncurryThis(''.charAt); var replace = uncurryThis(''.replace); var stringSlice = uncurryThis(''.slice); +// eslint-disable-next-line redos/no-vulnerable -- safe var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g; -var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g; // `GetSubstitution` abstract operation -// https://tc39.es/ecma262/#sec-getsubstitution +var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g; +// `GetSubstitution` abstract operation +// https://tc39.es/ecma262/#sec-getsubstitution module.exports = function (matched, str, position, captures, namedCaptures, replacement) { var tailPos = position + matched.length; var m = captures.length; var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; - if (namedCaptures !== undefined) { namedCaptures = toObject(namedCaptures); symbols = SUBSTITUTION_SYMBOLS; } - return replace(replacement, symbols, function (match, ch) { var capture; - switch (charAt(ch, 0)) { case '$': return '$'; - case '&': return matched; - case '`': return stringSlice(str, 0, position); - case "'": return stringSlice(str, tailPos); - case '<': capture = namedCaptures[stringSlice(ch, 1, -1)]; break; - default: // \d\d? var n = +ch; if (n === 0) return match; - if (n > m) { var f = floor(n / 10); if (f === 0) return match; if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1); return match; } - capture = captures[n - 1]; } - return capture === undefined ? '' : capture; }); }; /***/ }), -/* 390 */ +/* 403 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var call = __webpack_require__(8); - var uncurryThis = __webpack_require__(14); - var requireObjectCoercible = __webpack_require__(16); - var isCallable = __webpack_require__(21); - var isNullOrUndefined = __webpack_require__(17); - -var isRegExp = __webpack_require__(354); - -var toString = __webpack_require__(68); - -var getMethod = __webpack_require__(29); - -var getRegExpFlags = __webpack_require__(355); - -var getSubstitution = __webpack_require__(389); - -var wellKnownSymbol = __webpack_require__(33); - -var IS_PURE = __webpack_require__(35); - +var isRegExp = __webpack_require__(367); +var toString = __webpack_require__(69); +var getMethod = __webpack_require__(30); +var getRegExpFlags = __webpack_require__(368); +var getSubstitution = __webpack_require__(402); +var wellKnownSymbol = __webpack_require__(34); +var IS_PURE = __webpack_require__(36); var REPLACE = wellKnownSymbol('replace'); var $TypeError = TypeError; var indexOf = uncurryThis(''.indexOf); var replace = uncurryThis(''.replace); var stringSlice = uncurryThis(''.slice); var max = Math.max; - var stringIndexOf = function (string, searchValue, fromIndex) { if (fromIndex > string.length) return -1; if (searchValue === '') return fromIndex; return indexOf(string, searchValue, fromIndex); -}; // `String.prototype.replaceAll` method +}; + +// `String.prototype.replaceAll` method // https://tc39.es/ecma262/#sec-string.prototype.replaceall - - $({ target: 'String', proto: true @@ -14091,24 +12291,19 @@ $({ var position = 0; var endOfLastMatch = 0; var result = ''; - if (!isNullOrUndefined(searchValue)) { IS_REG_EXP = isRegExp(searchValue); - if (IS_REG_EXP) { flags = toString(requireObjectCoercible(getRegExpFlags(searchValue))); if (!~indexOf(flags, 'g')) throw $TypeError('`.replaceAll` does not allow non-global regexes'); } - replacer = getMethod(searchValue, REPLACE); - if (replacer) { return call(replacer, searchValue, O, replaceValue); } else if (IS_PURE && IS_REG_EXP) { return replace(toString(O), searchValue, replaceValue); } } - string = toString(O); searchString = toString(searchValue); functionalReplace = isCallable(replaceValue); @@ -14116,56 +12311,47 @@ $({ searchLength = searchString.length; advanceBy = max(1, searchLength); position = stringIndexOf(string, searchString, 0); - while (position !== -1) { replacement = functionalReplace ? toString(replaceValue(searchString, position, string)) : getSubstitution(searchString, string, position, [], undefined, replaceValue); result += stringSlice(string, endOfLastMatch, position) + replacement; endOfLastMatch = position + searchLength; position = stringIndexOf(string, searchString, position + advanceBy); } - if (endOfLastMatch < string.length) { result += stringSlice(string, endOfLastMatch); } - return result; } }); /***/ }), -/* 391 */ +/* 404 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var call = __webpack_require__(8); - -var fixRegExpWellKnownSymbolLogic = __webpack_require__(379); - -var anObject = __webpack_require__(46); - +var fixRegExpWellKnownSymbolLogic = __webpack_require__(392); +var anObject = __webpack_require__(47); var isNullOrUndefined = __webpack_require__(17); - var requireObjectCoercible = __webpack_require__(16); +var sameValue = __webpack_require__(309); +var toString = __webpack_require__(69); +var getMethod = __webpack_require__(30); +var regExpExec = __webpack_require__(394); -var sameValue = __webpack_require__(295); - -var toString = __webpack_require__(68); - -var getMethod = __webpack_require__(29); - -var regExpExec = __webpack_require__(381); // @@search logic - - +// @@search logic fixRegExpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCallNative) { - return [// `String.prototype.search` method + return [ + // `String.prototype.search` method // https://tc39.es/ecma262/#sec-string.prototype.search function search(regexp) { var O = requireObjectCoercible(this); var searcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, SEARCH); return searcher ? call(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString(O)); - }, // `RegExp.prototype[@@search]` method + }, + // `RegExp.prototype[@@search]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@search function (string) { var rx = anObject(this); @@ -14181,97 +12367,77 @@ fixRegExpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCal }); /***/ }), -/* 392 */ +/* 405 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var apply = __webpack_require__(93); - +var apply = __webpack_require__(96); var call = __webpack_require__(8); - var uncurryThis = __webpack_require__(14); - -var fixRegExpWellKnownSymbolLogic = __webpack_require__(379); - -var anObject = __webpack_require__(46); - +var fixRegExpWellKnownSymbolLogic = __webpack_require__(392); +var anObject = __webpack_require__(47); var isNullOrUndefined = __webpack_require__(17); - -var isRegExp = __webpack_require__(354); - +var isRegExp = __webpack_require__(367); var requireObjectCoercible = __webpack_require__(16); - -var speciesConstructor = __webpack_require__(203); - -var advanceStringIndex = __webpack_require__(380); - -var toLength = __webpack_require__(64); - -var toString = __webpack_require__(68); - -var getMethod = __webpack_require__(29); - -var arraySlice = __webpack_require__(76); - -var callRegExpExec = __webpack_require__(381); - -var regexpExec = __webpack_require__(362); - -var stickyHelpers = __webpack_require__(357); - +var speciesConstructor = __webpack_require__(217); +var advanceStringIndex = __webpack_require__(393); +var toLength = __webpack_require__(65); +var toString = __webpack_require__(69); +var getMethod = __webpack_require__(30); +var arraySlice = __webpack_require__(77); +var callRegExpExec = __webpack_require__(394); +var regexpExec = __webpack_require__(375); +var stickyHelpers = __webpack_require__(370); var fails = __webpack_require__(7); - var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; var MAX_UINT32 = 0xFFFFFFFF; var min = Math.min; var $push = [].push; var exec = uncurryThis(/./.exec); var push = uncurryThis($push); -var stringSlice = uncurryThis(''.slice); // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec -// Weex JS has frozen built-in prototypes, so use try / catch wrapper +var stringSlice = uncurryThis(''.slice); +// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec +// Weex JS has frozen built-in prototypes, so use try / catch wrapper var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () { // eslint-disable-next-line regexp/no-empty-group -- required for testing var re = /(?:)/; var originalExec = re.exec; - re.exec = function () { return originalExec.apply(this, arguments); }; - var result = 'ab'.split(re); return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b'; -}); // @@split logic +}); +// @@split logic fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) { var internalSplit; - - if ('abbc'.split(/(b)*/)[1] == 'c' || // eslint-disable-next-line regexp/no-empty-group -- required for testing - 'test'.split(/(?:)/, -1).length != 4 || 'ab'.split(/(?:ab)*/).length != 2 || '.'.split(/(.?)(.?)/).length != 4 || // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing + if ('abbc'.split(/(b)*/)[1] == 'c' || + // eslint-disable-next-line regexp/no-empty-group -- required for testing + 'test'.split(/(?:)/, -1).length != 4 || 'ab'.split(/(?:ab)*/).length != 2 || '.'.split(/(.?)(.?)/).length != 4 || + // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing '.'.split(/()()/).length > 1 || ''.split(/.?/).length) { // based on es5-shim implementation, need to rework it internalSplit = function (separator, limit) { var string = toString(requireObjectCoercible(this)); var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; if (lim === 0) return []; - if (separator === undefined) return [string]; // If `separator` is not a regex, use native split - + if (separator === undefined) return [string]; + // If `separator` is not a regex, use native split if (!isRegExp(separator)) { return call(nativeSplit, string, separator, lim); } - var output = []; var flags = (separator.ignoreCase ? 'i' : '') + (separator.multiline ? 'm' : '') + (separator.unicode ? 'u' : '') + (separator.sticky ? 'y' : ''); - var lastLastIndex = 0; // Make `global` and avoid `lastIndex` issues by working with a copy - + var lastLastIndex = 0; + // Make `global` and avoid `lastIndex` issues by working with a copy var separatorCopy = new RegExp(separator.source, flags + 'g'); var match, lastIndex, lastLength; - while (match = call(regexpExec, separatorCopy, string)) { lastIndex = separatorCopy.lastIndex; - if (lastIndex > lastLastIndex) { push(output, stringSlice(string, lastLastIndex, match.index)); if (match.length > 1 && match.index < string.length) apply($push, output, arraySlice(match, 1)); @@ -14279,30 +12445,29 @@ fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa lastLastIndex = lastIndex; if (output.length >= lim) break; } - if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop } if (lastLastIndex === string.length) { if (lastLength || !exec(separatorCopy, '')) push(output, ''); } else push(output, stringSlice(string, lastLastIndex)); - return output.length > lim ? arraySlice(output, 0, lim) : output; - }; // Chakra, V8 - + }; + // Chakra, V8 } else if ('0'.split(undefined, 0).length) { internalSplit = function (separator, limit) { return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit); }; } else internalSplit = nativeSplit; - - return [// `String.prototype.split` method + return [ + // `String.prototype.split` method // https://tc39.es/ecma262/#sec-string.prototype.split function split(separator, limit) { var O = requireObjectCoercible(this); var splitter = isNullOrUndefined(separator) ? undefined : getMethod(separator, SPLIT); return splitter ? call(splitter, separator, O, limit) : call(internalSplit, toString(O), separator, limit); - }, // `RegExp.prototype[@@split]` method + }, + // `RegExp.prototype[@@split]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@split // // NOTE: This cannot be properly polyfilled in engines that don't support @@ -14314,9 +12479,10 @@ fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa if (res.done) return res.value; var C = speciesConstructor(rx, RegExp); var unicodeMatching = rx.unicode; - var flags = (rx.ignoreCase ? 'i' : '') + (rx.multiline ? 'm' : '') + (rx.unicode ? 'u' : '') + (UNSUPPORTED_Y ? 'g' : 'y'); // ^(? + rx + ) is needed, in combination with some S slicing, to - // simulate the 'y' flag. + var flags = (rx.ignoreCase ? 'i' : '') + (rx.multiline ? 'm' : '') + (rx.unicode ? 'u' : '') + (UNSUPPORTED_Y ? 'g' : 'y'); + // ^(? + rx + ) is needed, in combination with some S slicing, to + // simulate the 'y' flag. var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags); var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; if (lim === 0) return []; @@ -14324,77 +12490,63 @@ fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa var p = 0; var q = 0; var A = []; - while (q < S.length) { splitter.lastIndex = UNSUPPORTED_Y ? 0 : q; var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S); var e; - if (z === null || (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p) { q = advanceStringIndex(S, q, unicodeMatching); } else { push(A, stringSlice(S, p, q)); if (A.length === lim) return A; - for (var i = 1; i <= z.length - 1; i++) { push(A, z[i]); if (A.length === lim) return A; } - q = p = e; } } - push(A, stringSlice(S, p)); return A; }]; }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y); /***/ }), -/* 393 */ +/* 406 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - -var uncurryThis = __webpack_require__(14); - +var uncurryThis = __webpack_require__(87); var getOwnPropertyDescriptor = (__webpack_require__(5).f); - -var toLength = __webpack_require__(64); - -var toString = __webpack_require__(68); - -var notARegExp = __webpack_require__(373); - +var toLength = __webpack_require__(65); +var toString = __webpack_require__(69); +var notARegExp = __webpack_require__(386); var requireObjectCoercible = __webpack_require__(16); +var correctIsRegExpLogic = __webpack_require__(387); +var IS_PURE = __webpack_require__(36); -var correctIsRegExpLogic = __webpack_require__(374); - -var IS_PURE = __webpack_require__(35); // eslint-disable-next-line es-x/no-string-prototype-startswith -- safe - - +// eslint-disable-next-line es/no-string-prototype-startswith -- safe var nativeStartsWith = uncurryThis(''.startsWith); var stringSlice = uncurryThis(''.slice); var min = Math.min; -var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith'); // https://github.com/zloirock/core-js/pull/702 - +var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith'); +// https://github.com/zloirock/core-js/pull/702 var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () { var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith'); return descriptor && !descriptor.writable; -}(); // `String.prototype.startsWith` method -// https://tc39.es/ecma262/#sec-string.prototype.startswith +}(); +// `String.prototype.startsWith` method +// https://tc39.es/ecma262/#sec-string.prototype.startswith $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, { - startsWith: function startsWith(searchString - /* , position = 0 */ - ) { + startsWith: function startsWith(searchString /* , position = 0 */) { var that = toString(requireObjectCoercible(this)); notARegExp(searchString); var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length)); @@ -14404,29 +12556,26 @@ $({ }); /***/ }), -/* 394 */ +/* 407 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var uncurryThis = __webpack_require__(14); - var requireObjectCoercible = __webpack_require__(16); - -var toIntegerOrInfinity = __webpack_require__(61); - -var toString = __webpack_require__(68); - +var toIntegerOrInfinity = __webpack_require__(62); +var toString = __webpack_require__(69); var stringSlice = uncurryThis(''.slice); var max = Math.max; -var min = Math.min; // eslint-disable-next-line unicorn/prefer-string-slice, es-x/no-string-prototype-substr -- required for testing +var min = Math.min; -var FORCED = !''.substr || 'ab'.substr(-1) !== 'b'; // `String.prototype.substr` method +// eslint-disable-next-line unicorn/prefer-string-slice -- required for testing +var FORCED = !''.substr || 'ab'.substr(-1) !== 'b'; + +// `String.prototype.substr` method // https://tc39.es/ecma262/#sec-string.prototype.substr - $({ target: 'String', proto: true, @@ -14447,20 +12596,18 @@ $({ }); /***/ }), -/* 395 */ +/* 408 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var $trim = (__webpack_require__(273).trim); +var forcedStringTrimMethod = __webpack_require__(409); -var $trim = (__webpack_require__(259).trim); - -var forcedStringTrimMethod = __webpack_require__(396); // `String.prototype.trim` method +// `String.prototype.trim` method // https://tc39.es/ecma262/#sec-string.prototype.trim - - $({ target: 'String', proto: true, @@ -14472,18 +12619,16 @@ $({ }); /***/ }), -/* 396 */ +/* 409 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var PROPER_FUNCTION_NAME = (__webpack_require__(49).PROPER); - +var PROPER_FUNCTION_NAME = (__webpack_require__(50).PROPER); var fails = __webpack_require__(7); +var whitespaces = __webpack_require__(274); +var non = '\u200B\u0085\u180E'; -var whitespaces = __webpack_require__(260); - -var non = '\u200B\u0085\u180E'; // check that a method works with the correct list +// check that a method works with the correct list // of whitespaces and has a correct name - module.exports = function (METHOD_NAME) { return fails(function () { return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() !== non || PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME; @@ -14491,19 +12636,17 @@ module.exports = function (METHOD_NAME) { }; /***/ }), -/* 397 */ +/* 410 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove this line from `core-js@4` -__webpack_require__(398); - +__webpack_require__(411); var $ = __webpack_require__(3); +var trimEnd = __webpack_require__(412); -var trimEnd = __webpack_require__(399); // `String.prototype.trimEnd` method +// `String.prototype.trimEnd` method // https://tc39.es/ecma262/#sec-string.prototype.trimend -// eslint-disable-next-line es-x/no-string-prototype-trimstart-trimend -- safe - - +// eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe $({ target: 'String', proto: true, @@ -14514,16 +12657,15 @@ $({ }); /***/ }), -/* 398 */ +/* 411 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var trimEnd = __webpack_require__(412); -var trimEnd = __webpack_require__(399); // `String.prototype.trimRight` method +// `String.prototype.trimRight` method // https://tc39.es/ecma262/#sec-string.prototype.trimend -// eslint-disable-next-line es-x/no-string-prototype-trimleft-trimright -- safe - - +// eslint-disable-next-line es/no-string-prototype-trimleft-trimright -- safe $({ target: 'String', proto: true, @@ -14534,37 +12676,35 @@ $({ }); /***/ }), -/* 399 */ +/* 412 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var $trimEnd = (__webpack_require__(259).end); +var $trimEnd = (__webpack_require__(273).end); +var forcedStringTrimMethod = __webpack_require__(409); -var forcedStringTrimMethod = __webpack_require__(396); // `String.prototype.{ trimEnd, trimRight }` method +// `String.prototype.{ trimEnd, trimRight }` method // https://tc39.es/ecma262/#sec-string.prototype.trimend // https://tc39.es/ecma262/#String.prototype.trimright - - module.exports = forcedStringTrimMethod('trimEnd') ? function trimEnd() { - return $trimEnd(this); // eslint-disable-next-line es-x/no-string-prototype-trimstart-trimend -- safe + return $trimEnd(this); + // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe } : ''.trimEnd; /***/ }), -/* 400 */ +/* 413 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove this line from `core-js@4` -__webpack_require__(401); - +__webpack_require__(414); var $ = __webpack_require__(3); +var trimStart = __webpack_require__(415); -var trimStart = __webpack_require__(402); // `String.prototype.trimStart` method +// `String.prototype.trimStart` method // https://tc39.es/ecma262/#sec-string.prototype.trimstart -// eslint-disable-next-line es-x/no-string-prototype-trimstart-trimend -- safe - - +// eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe $({ target: 'String', proto: true, @@ -14575,16 +12715,15 @@ $({ }); /***/ }), -/* 401 */ +/* 414 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); +var trimStart = __webpack_require__(415); -var trimStart = __webpack_require__(402); // `String.prototype.trimLeft` method +// `String.prototype.trimLeft` method // https://tc39.es/ecma262/#sec-string.prototype.trimleft -// eslint-disable-next-line es-x/no-string-prototype-trimleft-trimright -- safe - - +// eslint-disable-next-line es/no-string-prototype-trimleft-trimright -- safe $({ target: 'String', proto: true, @@ -14595,38 +12734,36 @@ $({ }); /***/ }), -/* 402 */ +/* 415 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var $trimStart = (__webpack_require__(259).start); +var $trimStart = (__webpack_require__(273).start); +var forcedStringTrimMethod = __webpack_require__(409); -var forcedStringTrimMethod = __webpack_require__(396); // `String.prototype.{ trimStart, trimLeft }` method +// `String.prototype.{ trimStart, trimLeft }` method // https://tc39.es/ecma262/#sec-string.prototype.trimstart // https://tc39.es/ecma262/#String.prototype.trimleft - - module.exports = forcedStringTrimMethod('trimStart') ? function trimStart() { - return $trimStart(this); // eslint-disable-next-line es-x/no-string-prototype-trimstart-trimend -- safe + return $trimStart(this); + // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe } : ''.trimStart; /***/ }), -/* 403 */ +/* 416 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var createHTML = __webpack_require__(417); +var forcedStringHTMLMethod = __webpack_require__(418); -var createHTML = __webpack_require__(404); - -var forcedStringHTMLMethod = __webpack_require__(405); // `String.prototype.anchor` method +// `String.prototype.anchor` method // https://tc39.es/ecma262/#sec-string.prototype.anchor - - $({ target: 'String', proto: true, @@ -14638,19 +12775,17 @@ $({ }); /***/ }), -/* 404 */ +/* 417 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var uncurryThis = __webpack_require__(14); - var requireObjectCoercible = __webpack_require__(16); - -var toString = __webpack_require__(68); - +var toString = __webpack_require__(69); var quot = /"/g; -var replace = uncurryThis(''.replace); // `CreateHTML` abstract operation -// https://tc39.es/ecma262/#sec-createhtml +var replace = uncurryThis(''.replace); +// `CreateHTML` abstract operation +// https://tc39.es/ecma262/#sec-createhtml module.exports = function (string, tag, attribute, value) { var S = toString(requireObjectCoercible(string)); var p1 = '<' + tag; @@ -14659,13 +12794,13 @@ module.exports = function (string, tag, attribute, value) { }; /***/ }), -/* 405 */ +/* 418 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var fails = __webpack_require__(7); // check the existence of a method, lowercase +var fails = __webpack_require__(7); + +// check the existence of a method, lowercase // of a tag and escaping quotes in arguments - - module.exports = function (METHOD_NAME) { return fails(function () { var test = ''[METHOD_NAME]('"'); @@ -14674,20 +12809,18 @@ module.exports = function (METHOD_NAME) { }; /***/ }), -/* 406 */ +/* 419 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var createHTML = __webpack_require__(417); +var forcedStringHTMLMethod = __webpack_require__(418); -var createHTML = __webpack_require__(404); - -var forcedStringHTMLMethod = __webpack_require__(405); // `String.prototype.big` method +// `String.prototype.big` method // https://tc39.es/ecma262/#sec-string.prototype.big - - $({ target: 'String', proto: true, @@ -14699,20 +12832,18 @@ $({ }); /***/ }), -/* 407 */ +/* 420 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var createHTML = __webpack_require__(417); +var forcedStringHTMLMethod = __webpack_require__(418); -var createHTML = __webpack_require__(404); - -var forcedStringHTMLMethod = __webpack_require__(405); // `String.prototype.blink` method +// `String.prototype.blink` method // https://tc39.es/ecma262/#sec-string.prototype.blink - - $({ target: 'String', proto: true, @@ -14724,20 +12855,18 @@ $({ }); /***/ }), -/* 408 */ +/* 421 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var createHTML = __webpack_require__(417); +var forcedStringHTMLMethod = __webpack_require__(418); -var createHTML = __webpack_require__(404); - -var forcedStringHTMLMethod = __webpack_require__(405); // `String.prototype.bold` method +// `String.prototype.bold` method // https://tc39.es/ecma262/#sec-string.prototype.bold - - $({ target: 'String', proto: true, @@ -14749,20 +12878,18 @@ $({ }); /***/ }), -/* 409 */ +/* 422 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var createHTML = __webpack_require__(417); +var forcedStringHTMLMethod = __webpack_require__(418); -var createHTML = __webpack_require__(404); - -var forcedStringHTMLMethod = __webpack_require__(405); // `String.prototype.fixed` method +// `String.prototype.fixed` method // https://tc39.es/ecma262/#sec-string.prototype.fixed - - $({ target: 'String', proto: true, @@ -14774,20 +12901,18 @@ $({ }); /***/ }), -/* 410 */ +/* 423 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var createHTML = __webpack_require__(417); +var forcedStringHTMLMethod = __webpack_require__(418); -var createHTML = __webpack_require__(404); - -var forcedStringHTMLMethod = __webpack_require__(405); // `String.prototype.fontcolor` method +// `String.prototype.fontcolor` method // https://tc39.es/ecma262/#sec-string.prototype.fontcolor - - $({ target: 'String', proto: true, @@ -14799,20 +12924,18 @@ $({ }); /***/ }), -/* 411 */ +/* 424 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var createHTML = __webpack_require__(417); +var forcedStringHTMLMethod = __webpack_require__(418); -var createHTML = __webpack_require__(404); - -var forcedStringHTMLMethod = __webpack_require__(405); // `String.prototype.fontsize` method +// `String.prototype.fontsize` method // https://tc39.es/ecma262/#sec-string.prototype.fontsize - - $({ target: 'String', proto: true, @@ -14824,20 +12947,18 @@ $({ }); /***/ }), -/* 412 */ +/* 425 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var createHTML = __webpack_require__(417); +var forcedStringHTMLMethod = __webpack_require__(418); -var createHTML = __webpack_require__(404); - -var forcedStringHTMLMethod = __webpack_require__(405); // `String.prototype.italics` method +// `String.prototype.italics` method // https://tc39.es/ecma262/#sec-string.prototype.italics - - $({ target: 'String', proto: true, @@ -14849,20 +12970,18 @@ $({ }); /***/ }), -/* 413 */ +/* 426 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var createHTML = __webpack_require__(417); +var forcedStringHTMLMethod = __webpack_require__(418); -var createHTML = __webpack_require__(404); - -var forcedStringHTMLMethod = __webpack_require__(405); // `String.prototype.link` method +// `String.prototype.link` method // https://tc39.es/ecma262/#sec-string.prototype.link - - $({ target: 'String', proto: true, @@ -14874,20 +12993,18 @@ $({ }); /***/ }), -/* 414 */ +/* 427 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var createHTML = __webpack_require__(417); +var forcedStringHTMLMethod = __webpack_require__(418); -var createHTML = __webpack_require__(404); - -var forcedStringHTMLMethod = __webpack_require__(405); // `String.prototype.small` method +// `String.prototype.small` method // https://tc39.es/ecma262/#sec-string.prototype.small - - $({ target: 'String', proto: true, @@ -14899,20 +13016,18 @@ $({ }); /***/ }), -/* 415 */ +/* 428 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var createHTML = __webpack_require__(417); +var forcedStringHTMLMethod = __webpack_require__(418); -var createHTML = __webpack_require__(404); - -var forcedStringHTMLMethod = __webpack_require__(405); // `String.prototype.strike` method +// `String.prototype.strike` method // https://tc39.es/ecma262/#sec-string.prototype.strike - - $({ target: 'String', proto: true, @@ -14924,20 +13039,18 @@ $({ }); /***/ }), -/* 416 */ +/* 429 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var createHTML = __webpack_require__(417); +var forcedStringHTMLMethod = __webpack_require__(418); -var createHTML = __webpack_require__(404); - -var forcedStringHTMLMethod = __webpack_require__(405); // `String.prototype.sub` method +// `String.prototype.sub` method // https://tc39.es/ecma262/#sec-string.prototype.sub - - $({ target: 'String', proto: true, @@ -14949,20 +13062,18 @@ $({ }); /***/ }), -/* 417 */ +/* 430 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var createHTML = __webpack_require__(417); +var forcedStringHTMLMethod = __webpack_require__(418); -var createHTML = __webpack_require__(404); - -var forcedStringHTMLMethod = __webpack_require__(405); // `String.prototype.sup` method +// `String.prototype.sup` method // https://tc39.es/ecma262/#sec-string.prototype.sup - - $({ target: 'String', proto: true, @@ -14974,13 +13085,13 @@ $({ }); /***/ }), -/* 418 */ +/* 431 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var createTypedArrayConstructor = __webpack_require__(419); // `Float32Array` constructor +var createTypedArrayConstructor = __webpack_require__(432); + +// `Float32Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects - - createTypedArrayConstructor('Float32', function (init) { return function Float32Array(data, byteOffset, length) { return init(this, data, byteOffset, length); @@ -14988,72 +13099,43 @@ createTypedArrayConstructor('Float32', function (init) { }); /***/ }), -/* 419 */ +/* 432 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var global = __webpack_require__(4); - var call = __webpack_require__(8); - var DESCRIPTORS = __webpack_require__(6); - -var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = __webpack_require__(420); - -var ArrayBufferViewCore = __webpack_require__(201); - -var ArrayBufferModule = __webpack_require__(194); - -var anInstance = __webpack_require__(197); - +var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = __webpack_require__(433); +var ArrayBufferViewCore = __webpack_require__(215); +var ArrayBufferModule = __webpack_require__(208); +var anInstance = __webpack_require__(211); var createPropertyDescriptor = __webpack_require__(11); - -var createNonEnumerableProperty = __webpack_require__(43); - -var isIntegralNumber = __webpack_require__(265); - -var toLength = __webpack_require__(64); - -var toIndex = __webpack_require__(198); - -var toOffset = __webpack_require__(421); - +var createNonEnumerableProperty = __webpack_require__(44); +var isIntegralNumber = __webpack_require__(279); +var toLength = __webpack_require__(65); +var toIndex = __webpack_require__(212); +var toOffset = __webpack_require__(434); var toPropertyKey = __webpack_require__(18); - -var hasOwn = __webpack_require__(38); - -var classof = __webpack_require__(69); - +var hasOwn = __webpack_require__(39); +var classof = __webpack_require__(70); var isObject = __webpack_require__(20); - -var isSymbol = __webpack_require__(22); - -var create = __webpack_require__(71); - -var isPrototypeOf = __webpack_require__(24); - -var setPrototypeOf = __webpack_require__(112); - -var getOwnPropertyNames = (__webpack_require__(57).f); - -var typedArrayFrom = __webpack_require__(423); - -var forEach = (__webpack_require__(83).forEach); - -var setSpecies = __webpack_require__(188); - -var definePropertyModule = __webpack_require__(44); - +var isSymbol = __webpack_require__(23); +var create = __webpack_require__(72); +var isPrototypeOf = __webpack_require__(25); +var setPrototypeOf = __webpack_require__(116); +var getOwnPropertyNames = (__webpack_require__(58).f); +var typedArrayFrom = __webpack_require__(436); +var forEach = (__webpack_require__(85).forEach); +var setSpecies = __webpack_require__(194); +var defineBuiltInAccessor = __webpack_require__(79); +var definePropertyModule = __webpack_require__(45); var getOwnPropertyDescriptorModule = __webpack_require__(5); - -var InternalStateModule = __webpack_require__(51); - -var inheritIfRequired = __webpack_require__(115); - +var InternalStateModule = __webpack_require__(52); +var inheritIfRequired = __webpack_require__(120); var getInternalState = InternalStateModule.get; var setInternalState = InternalStateModule.set; var enforceInternalState = InternalStateModule.enforce; @@ -15072,52 +13154,43 @@ var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; var isTypedArray = ArrayBufferViewCore.isTypedArray; var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; var WRONG_LENGTH = 'Wrong length'; - var fromList = function (C, list) { aTypedArrayConstructor(C); var index = 0; var length = list.length; var result = new C(length); - while (length > index) result[index] = list[index++]; - return result; }; - var addGetter = function (it, key) { - nativeDefineProperty(it, key, { + defineBuiltInAccessor(it, key, { + configurable: true, get: function () { return getInternalState(this)[key]; } }); }; - var isArrayBuffer = function (it) { var klass; return isPrototypeOf(ArrayBufferPrototype, it) || (klass = classof(it)) == 'ArrayBuffer' || klass == 'SharedArrayBuffer'; }; - var isTypedArrayIndex = function (target, key) { return isTypedArray(target) && !isSymbol(key) && key in target && isIntegralNumber(+key) && key >= 0; }; - var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) { key = toPropertyKey(key); return isTypedArrayIndex(target, key) ? createPropertyDescriptor(2, target[key]) : nativeGetOwnPropertyDescriptor(target, key); }; - var wrappedDefineProperty = function defineProperty(target, key, descriptor) { key = toPropertyKey(key); - - if (isTypedArrayIndex(target, key) && isObject(descriptor) && hasOwn(descriptor, 'value') && !hasOwn(descriptor, 'get') && !hasOwn(descriptor, 'set') // TODO: add validation descriptor w/o calling accessors + if (isTypedArrayIndex(target, key) && isObject(descriptor) && hasOwn(descriptor, 'value') && !hasOwn(descriptor, 'get') && !hasOwn(descriptor, 'set') + // TODO: add validation descriptor w/o calling accessors && !descriptor.configurable && (!hasOwn(descriptor, 'writable') || descriptor.writable) && (!hasOwn(descriptor, 'enumerable') || descriptor.enumerable)) { target[key] = descriptor.value; return target; } - return nativeDefineProperty(target, key, descriptor); }; - if (DESCRIPTORS) { if (!NATIVE_ARRAY_BUFFER_VIEWS) { getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor; @@ -15127,7 +13200,6 @@ if (DESCRIPTORS) { addGetter(TypedArrayPrototype, 'byteLength'); addGetter(TypedArrayPrototype, 'length'); } - $({ target: 'Object', stat: true, @@ -15136,9 +13208,8 @@ if (DESCRIPTORS) { getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor, defineProperty: wrappedDefineProperty }); - module.exports = function (TYPE, wrapper, CLAMPED) { - var BYTES = TYPE.match(/\d+$/)[0] / 8; + var BYTES = TYPE.match(/\d+/)[0] / 8; var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array'; var GETTER = 'get' + TYPE; var SETTER = 'set' + TYPE; @@ -15146,18 +13217,15 @@ if (DESCRIPTORS) { var TypedArrayConstructor = NativeTypedArrayConstructor; var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype; var exported = {}; - var getter = function (that, index) { var data = getInternalState(that); return data.view[GETTER](index * BYTES + data.byteOffset, true); }; - var setter = function (that, index, value) { var data = getInternalState(that); if (CLAMPED) value = (value = round(value)) < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF; data.view[SETTER](index * BYTES + data.byteOffset, value, true); }; - var addElement = function (that, index) { nativeDefineProperty(that, index, { get: function () { @@ -15169,14 +13237,12 @@ if (DESCRIPTORS) { enumerable: true }); }; - if (!NATIVE_ARRAY_BUFFER_VIEWS) { TypedArrayConstructor = wrapper(function (that, data, offset, $length) { anInstance(that, TypedArrayConstructorPrototype); var index = 0; var byteOffset = 0; var buffer, byteLength, length; - if (!isObject(data)) { length = toIndex(data); byteLength = length * BYTES; @@ -15185,7 +13251,6 @@ if (DESCRIPTORS) { buffer = data; byteOffset = toOffset(offset, BYTES); var $len = data.byteLength; - if ($length === undefined) { if ($len % BYTES) throw RangeError(WRONG_LENGTH); byteLength = $len - byteOffset; @@ -15194,14 +13259,12 @@ if (DESCRIPTORS) { byteLength = toLength($length) * BYTES; if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH); } - length = byteLength / BYTES; } else if (isTypedArray(data)) { return fromList(TypedArrayConstructor, data); } else { return call(typedArrayFrom, TypedArrayConstructor, data); } - setInternalState(that, { buffer: buffer, byteOffset: byteOffset, @@ -15209,7 +13272,6 @@ if (DESCRIPTORS) { length: length, view: new DataView(buffer) }); - while (index < length) addElement(that, index++); }); if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray); @@ -15232,17 +13294,13 @@ if (DESCRIPTORS) { }); TypedArrayConstructor.prototype = TypedArrayConstructorPrototype; } - if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) { createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor); } - enforceInternalState(TypedArrayConstructorPrototype).TypedArrayConstructor = TypedArrayConstructor; - if (TYPED_ARRAY_TAG) { createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME); } - var FORCED = TypedArrayConstructor != NativeTypedArrayConstructor; exported[CONSTRUCTOR_NAME] = TypedArrayConstructor; $({ @@ -15251,34 +13309,25 @@ if (DESCRIPTORS) { forced: FORCED, sham: !NATIVE_ARRAY_BUFFER_VIEWS }, exported); - if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) { createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES); } - if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) { createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES); } - setSpecies(CONSTRUCTOR_NAME); }; -} else module.exports = function () { - /* empty */ -}; +} else module.exports = function () {/* empty */}; /***/ }), -/* 420 */ +/* 433 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* eslint-disable no-new -- required for testing */ var global = __webpack_require__(4); - var fails = __webpack_require__(7); - -var checkCorrectnessOfIteration = __webpack_require__(159); - -var NATIVE_ARRAY_BUFFER_VIEWS = (__webpack_require__(201).NATIVE_ARRAY_BUFFER_VIEWS); - +var checkCorrectnessOfIteration = __webpack_require__(165); +var NATIVE_ARRAY_BUFFER_VIEWS = (__webpack_require__(215).NATIVE_ARRAY_BUFFER_VIEWS); var ArrayBuffer = global.ArrayBuffer; var Int8Array = global.Int8Array; module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () { @@ -15296,13 +13345,11 @@ module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () { }); /***/ }), -/* 421 */ +/* 434 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var toPositiveInteger = __webpack_require__(422); - +var toPositiveInteger = __webpack_require__(435); var $RangeError = RangeError; - module.exports = function (it, BYTES) { var offset = toPositiveInteger(it); if (offset % BYTES) throw $RangeError('Wrong offset'); @@ -15310,13 +13357,11 @@ module.exports = function (it, BYTES) { }; /***/ }), -/* 422 */ +/* 435 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var toIntegerOrInfinity = __webpack_require__(61); - +var toIntegerOrInfinity = __webpack_require__(62); var $RangeError = RangeError; - module.exports = function (it) { var result = toIntegerOrInfinity(it); if (result < 0) throw $RangeError("The argument can't be less than 0"); @@ -15324,34 +13369,21 @@ module.exports = function (it) { }; /***/ }), -/* 423 */ +/* 436 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var bind = __webpack_require__(84); - +var bind = __webpack_require__(86); var call = __webpack_require__(8); - -var aConstructor = __webpack_require__(204); - -var toObject = __webpack_require__(39); - -var lengthOfArrayLike = __webpack_require__(63); - -var getIterator = __webpack_require__(129); - -var getIteratorMethod = __webpack_require__(130); - -var isArrayIteratorMethod = __webpack_require__(127); - -var isBigIntArray = __webpack_require__(424); - -var aTypedArrayConstructor = (__webpack_require__(201).aTypedArrayConstructor); - -var toBigInt = __webpack_require__(425); - -module.exports = function from(source -/* , mapfn, thisArg */ -) { +var aConstructor = __webpack_require__(218); +var toObject = __webpack_require__(40); +var lengthOfArrayLike = __webpack_require__(64); +var getIterator = __webpack_require__(135); +var getIteratorMethod = __webpack_require__(136); +var isArrayIteratorMethod = __webpack_require__(133); +var isBigIntArray = __webpack_require__(437); +var aTypedArrayConstructor = (__webpack_require__(215).aTypedArrayConstructor); +var toBigInt = __webpack_require__(438); +module.exports = function from(source /* , mapfn, thisArg */) { var C = aConstructor(this); var O = toObject(source); var argumentsLength = arguments.length; @@ -15359,72 +13391,62 @@ module.exports = function from(source var mapping = mapfn !== undefined; var iteratorMethod = getIteratorMethod(O); var i, length, result, thisIsBigIntArray, value, step, iterator, next; - if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) { iterator = getIterator(O, iteratorMethod); next = iterator.next; O = []; - while (!(step = call(next, iterator)).done) { O.push(step.value); } } - if (mapping && argumentsLength > 2) { mapfn = bind(mapfn, arguments[2]); } - length = lengthOfArrayLike(O); result = new (aTypedArrayConstructor(C))(length); thisIsBigIntArray = isBigIntArray(result); - for (i = 0; length > i; i++) { - value = mapping ? mapfn(O[i], i) : O[i]; // FF30- typed arrays doesn't properly convert objects to typed array values - + value = mapping ? mapfn(O[i], i) : O[i]; + // FF30- typed arrays doesn't properly convert objects to typed array values result[i] = thisIsBigIntArray ? toBigInt(value) : +value; } - return result; }; /***/ }), -/* 424 */ +/* 437 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var classof = __webpack_require__(69); - -var uncurryThis = __webpack_require__(14); - -var slice = uncurryThis(''.slice); - +var classof = __webpack_require__(70); module.exports = function (it) { - return slice(classof(it), 0, 3) === 'Big'; + var klass = classof(it); + return klass == 'BigInt64Array' || klass == 'BigUint64Array'; }; /***/ }), -/* 425 */ +/* 438 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var toPrimitive = __webpack_require__(19); +var $TypeError = TypeError; -var $TypeError = TypeError; // `ToBigInt` abstract operation +// `ToBigInt` abstract operation // https://tc39.es/ecma262/#sec-tobigint - module.exports = function (argument) { var prim = toPrimitive(argument, 'number'); - if (typeof prim == 'number') throw $TypeError("Can't convert number to bigint"); // eslint-disable-next-line es-x/no-bigint -- safe - + if (typeof prim == 'number') throw $TypeError("Can't convert number to bigint"); + // eslint-disable-next-line es/no-bigint -- safe return BigInt(prim); }; /***/ }), -/* 426 */ +/* 439 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var createTypedArrayConstructor = __webpack_require__(419); // `Float64Array` constructor +var createTypedArrayConstructor = __webpack_require__(432); + +// `Float64Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects - - createTypedArrayConstructor('Float64', function (init) { return function Float64Array(data, byteOffset, length) { return init(this, data, byteOffset, length); @@ -15432,13 +13454,13 @@ createTypedArrayConstructor('Float64', function (init) { }); /***/ }), -/* 427 */ +/* 440 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var createTypedArrayConstructor = __webpack_require__(419); // `Int8Array` constructor +var createTypedArrayConstructor = __webpack_require__(432); + +// `Int8Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects - - createTypedArrayConstructor('Int8', function (init) { return function Int8Array(data, byteOffset, length) { return init(this, data, byteOffset, length); @@ -15446,13 +13468,13 @@ createTypedArrayConstructor('Int8', function (init) { }); /***/ }), -/* 428 */ +/* 441 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var createTypedArrayConstructor = __webpack_require__(419); // `Int16Array` constructor +var createTypedArrayConstructor = __webpack_require__(432); + +// `Int16Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects - - createTypedArrayConstructor('Int16', function (init) { return function Int16Array(data, byteOffset, length) { return init(this, data, byteOffset, length); @@ -15460,13 +13482,13 @@ createTypedArrayConstructor('Int16', function (init) { }); /***/ }), -/* 429 */ +/* 442 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var createTypedArrayConstructor = __webpack_require__(419); // `Int32Array` constructor +var createTypedArrayConstructor = __webpack_require__(432); + +// `Int32Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects - - createTypedArrayConstructor('Int32', function (init) { return function Int32Array(data, byteOffset, length) { return init(this, data, byteOffset, length); @@ -15474,13 +13496,13 @@ createTypedArrayConstructor('Int32', function (init) { }); /***/ }), -/* 430 */ +/* 443 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var createTypedArrayConstructor = __webpack_require__(419); // `Uint8Array` constructor +var createTypedArrayConstructor = __webpack_require__(432); + +// `Uint8Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects - - createTypedArrayConstructor('Uint8', function (init) { return function Uint8Array(data, byteOffset, length) { return init(this, data, byteOffset, length); @@ -15488,13 +13510,13 @@ createTypedArrayConstructor('Uint8', function (init) { }); /***/ }), -/* 431 */ +/* 444 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var createTypedArrayConstructor = __webpack_require__(419); // `Uint8ClampedArray` constructor +var createTypedArrayConstructor = __webpack_require__(432); + +// `Uint8ClampedArray` constructor // https://tc39.es/ecma262/#sec-typedarray-objects - - createTypedArrayConstructor('Uint8', function (init) { return function Uint8ClampedArray(data, byteOffset, length) { return init(this, data, byteOffset, length); @@ -15502,13 +13524,13 @@ createTypedArrayConstructor('Uint8', function (init) { }, true); /***/ }), -/* 432 */ +/* 445 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var createTypedArrayConstructor = __webpack_require__(419); // `Uint16Array` constructor +var createTypedArrayConstructor = __webpack_require__(432); + +// `Uint16Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects - - createTypedArrayConstructor('Uint16', function (init) { return function Uint16Array(data, byteOffset, length) { return init(this, data, byteOffset, length); @@ -15516,308 +13538,19 @@ createTypedArrayConstructor('Uint16', function (init) { }); /***/ }), -/* 433 */ +/* 446 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var createTypedArrayConstructor = __webpack_require__(419); // `Uint32Array` constructor +var createTypedArrayConstructor = __webpack_require__(432); + +// `Uint32Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects - - createTypedArrayConstructor('Uint32', function (init) { return function Uint32Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); -/***/ }), -/* 434 */ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var ArrayBufferViewCore = __webpack_require__(201); - -var lengthOfArrayLike = __webpack_require__(63); - -var toIntegerOrInfinity = __webpack_require__(61); - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.at` method -// https://github.com/tc39/proposal-relative-indexing-method - -exportTypedArrayMethod('at', function at(index) { - var O = aTypedArray(this); - var len = lengthOfArrayLike(O); - var relativeIndex = toIntegerOrInfinity(index); - var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex; - return k < 0 || k >= len ? undefined : O[k]; -}); - -/***/ }), -/* 435 */ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var uncurryThis = __webpack_require__(14); - -var ArrayBufferViewCore = __webpack_require__(201); - -var $ArrayCopyWithin = __webpack_require__(139); - -var u$ArrayCopyWithin = uncurryThis($ArrayCopyWithin); -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.copyWithin` method -// https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin - -exportTypedArrayMethod('copyWithin', function copyWithin(target, start -/* , end */ -) { - return u$ArrayCopyWithin(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined); -}); - -/***/ }), -/* 436 */ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var ArrayBufferViewCore = __webpack_require__(201); - -var $every = (__webpack_require__(83).every); - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.every` method -// https://tc39.es/ecma262/#sec-%typedarray%.prototype.every - -exportTypedArrayMethod('every', function every(callbackfn -/* , thisArg */ -) { - return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); -}); - -/***/ }), -/* 437 */ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var ArrayBufferViewCore = __webpack_require__(201); - -var $fill = __webpack_require__(144); - -var toBigInt = __webpack_require__(425); - -var classof = __webpack_require__(69); - -var call = __webpack_require__(8); - -var uncurryThis = __webpack_require__(14); - -var fails = __webpack_require__(7); - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -var slice = uncurryThis(''.slice); // V8 ~ Chrome < 59, Safari < 14.1, FF < 55, Edge <=18 - -var CONVERSION_BUG = fails(function () { - var count = 0; // eslint-disable-next-line es-x/no-typed-arrays -- safe - - new Int8Array(2).fill({ - valueOf: function () { - return count++; - } - }); - return count !== 1; -}); // `%TypedArray%.prototype.fill` method -// https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill - -exportTypedArrayMethod('fill', function fill(value -/* , start, end */ -) { - var length = arguments.length; - aTypedArray(this); - var actualValue = slice(classof(this), 0, 3) === 'Big' ? toBigInt(value) : +value; - return call($fill, this, actualValue, length > 1 ? arguments[1] : undefined, length > 2 ? arguments[2] : undefined); -}, CONVERSION_BUG); - -/***/ }), -/* 438 */ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var ArrayBufferViewCore = __webpack_require__(201); - -var $filter = (__webpack_require__(83).filter); - -var fromSpeciesAndList = __webpack_require__(439); - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.filter` method -// https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter - -exportTypedArrayMethod('filter', function filter(callbackfn -/* , thisArg */ -) { - var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); - return fromSpeciesAndList(this, list); -}); - -/***/ }), -/* 439 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var arrayFromConstructorAndList = __webpack_require__(440); - -var typedArraySpeciesConstructor = __webpack_require__(441); - -module.exports = function (instance, list) { - return arrayFromConstructorAndList(typedArraySpeciesConstructor(instance), list); -}; - -/***/ }), -/* 440 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var lengthOfArrayLike = __webpack_require__(63); - -module.exports = function (Constructor, list) { - var index = 0; - var length = lengthOfArrayLike(list); - var result = new Constructor(length); - - while (length > index) result[index] = list[index++]; - - return result; -}; - -/***/ }), -/* 441 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var ArrayBufferViewCore = __webpack_require__(201); - -var speciesConstructor = __webpack_require__(203); - -var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; -var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor; // a part of `TypedArraySpeciesCreate` abstract operation -// https://tc39.es/ecma262/#typedarray-species-create - -module.exports = function (originalArray) { - return aTypedArrayConstructor(speciesConstructor(originalArray, getTypedArrayConstructor(originalArray))); -}; - -/***/ }), -/* 442 */ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var ArrayBufferViewCore = __webpack_require__(201); - -var $find = (__webpack_require__(83).find); - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.find` method -// https://tc39.es/ecma262/#sec-%typedarray%.prototype.find - -exportTypedArrayMethod('find', function find(predicate -/* , thisArg */ -) { - return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); -}); - -/***/ }), -/* 443 */ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var ArrayBufferViewCore = __webpack_require__(201); - -var $findIndex = (__webpack_require__(83).findIndex); - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.findIndex` method -// https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex - -exportTypedArrayMethod('findIndex', function findIndex(predicate -/* , thisArg */ -) { - return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); -}); - -/***/ }), -/* 444 */ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var ArrayBufferViewCore = __webpack_require__(201); - -var $findLast = (__webpack_require__(149).findLast); - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.findLast` method -// https://github.com/tc39/proposal-array-find-from-last - -exportTypedArrayMethod('findLast', function findLast(predicate -/* , thisArg */ -) { - return $findLast(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); -}); - -/***/ }), -/* 445 */ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var ArrayBufferViewCore = __webpack_require__(201); - -var $findLastIndex = (__webpack_require__(149).findLastIndex); - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.findLastIndex` method -// https://github.com/tc39/proposal-array-find-from-last - -exportTypedArrayMethod('findLastIndex', function findLastIndex(predicate -/* , thisArg */ -) { - return $findLastIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); -}); - -/***/ }), -/* 446 */ -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var ArrayBufferViewCore = __webpack_require__(201); - -var $forEach = (__webpack_require__(83).forEach); - -var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.forEach` method -// https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach - -exportTypedArrayMethod('forEach', function forEach(callbackfn -/* , thisArg */ -) { - $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); -}); - /***/ }), /* 447 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { @@ -15825,15 +13558,21 @@ exportTypedArrayMethod('forEach', function forEach(callbackfn "use strict"; -var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = __webpack_require__(420); +var ArrayBufferViewCore = __webpack_require__(215); +var lengthOfArrayLike = __webpack_require__(64); +var toIntegerOrInfinity = __webpack_require__(62); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -var exportTypedArrayStaticMethod = (__webpack_require__(201).exportTypedArrayStaticMethod); - -var typedArrayFrom = __webpack_require__(423); // `%TypedArray%.from` method -// https://tc39.es/ecma262/#sec-%typedarray%.from - - -exportTypedArrayStaticMethod('from', typedArrayFrom, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS); +// `%TypedArray%.prototype.at` method +// https://github.com/tc39/proposal-relative-indexing-method +exportTypedArrayMethod('at', function at(index) { + var O = aTypedArray(this); + var len = lengthOfArrayLike(O); + var relativeIndex = toIntegerOrInfinity(index); + var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex; + return k < 0 || k >= len ? undefined : O[k]; +}); /***/ }), /* 448 */ @@ -15842,18 +13581,17 @@ exportTypedArrayStaticMethod('from', typedArrayFrom, TYPED_ARRAYS_CONSTRUCTORS_R "use strict"; -var ArrayBufferViewCore = __webpack_require__(201); - -var $includes = (__webpack_require__(59).includes); - +var uncurryThis = __webpack_require__(14); +var ArrayBufferViewCore = __webpack_require__(215); +var $ArrayCopyWithin = __webpack_require__(145); +var u$ArrayCopyWithin = uncurryThis($ArrayCopyWithin); var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.includes` method -// https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -exportTypedArrayMethod('includes', function includes(searchElement -/* , fromIndex */ -) { - return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); +// `%TypedArray%.prototype.copyWithin` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin +exportTypedArrayMethod('copyWithin', function copyWithin(target, start /* , end */) { + return u$ArrayCopyWithin(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined); }); /***/ }), @@ -15863,18 +13601,15 @@ exportTypedArrayMethod('includes', function includes(searchElement "use strict"; -var ArrayBufferViewCore = __webpack_require__(201); - -var $indexOf = (__webpack_require__(59).indexOf); - +var ArrayBufferViewCore = __webpack_require__(215); +var $every = (__webpack_require__(85).every); var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.indexOf` method -// https://tc39.es/ecma262/#sec-%typedarray%.prototype.indexof +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -exportTypedArrayMethod('indexOf', function indexOf(searchElement -/* , fromIndex */ -) { - return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); +// `%TypedArray%.prototype.every` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.every +exportTypedArrayMethod('every', function every(callbackfn /* , thisArg */) { + return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }); /***/ }), @@ -15884,18 +13619,237 @@ exportTypedArrayMethod('indexOf', function indexOf(searchElement "use strict"; -var global = __webpack_require__(4); - -var fails = __webpack_require__(7); - +var ArrayBufferViewCore = __webpack_require__(215); +var $fill = __webpack_require__(150); +var toBigInt = __webpack_require__(438); +var classof = __webpack_require__(70); +var call = __webpack_require__(8); var uncurryThis = __webpack_require__(14); +var fails = __webpack_require__(7); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; +var slice = uncurryThis(''.slice); -var ArrayBufferViewCore = __webpack_require__(201); +// V8 ~ Chrome < 59, Safari < 14.1, FF < 55, Edge <=18 +var CONVERSION_BUG = fails(function () { + var count = 0; + // eslint-disable-next-line es/no-typed-arrays -- safe + new Int8Array(2).fill({ + valueOf: function () { + return count++; + } + }); + return count !== 1; +}); -var ArrayIterators = __webpack_require__(163); +// `%TypedArray%.prototype.fill` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill +exportTypedArrayMethod('fill', function fill(value /* , start, end */) { + var length = arguments.length; + aTypedArray(this); + var actualValue = slice(classof(this), 0, 3) === 'Big' ? toBigInt(value) : +value; + return call($fill, this, actualValue, length > 1 ? arguments[1] : undefined, length > 2 ? arguments[2] : undefined); +}, CONVERSION_BUG); -var wellKnownSymbol = __webpack_require__(33); +/***/ }), +/* 451 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { +"use strict"; + + +var ArrayBufferViewCore = __webpack_require__(215); +var $filter = (__webpack_require__(85).filter); +var fromSpeciesAndList = __webpack_require__(452); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.filter` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter +exportTypedArrayMethod('filter', function filter(callbackfn /* , thisArg */) { + var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + return fromSpeciesAndList(this, list); +}); + +/***/ }), +/* 452 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var arrayFromConstructorAndList = __webpack_require__(199); +var typedArraySpeciesConstructor = __webpack_require__(453); +module.exports = function (instance, list) { + return arrayFromConstructorAndList(typedArraySpeciesConstructor(instance), list); +}; + +/***/ }), +/* 453 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var ArrayBufferViewCore = __webpack_require__(215); +var speciesConstructor = __webpack_require__(217); +var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; +var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor; + +// a part of `TypedArraySpeciesCreate` abstract operation +// https://tc39.es/ecma262/#typedarray-species-create +module.exports = function (originalArray) { + return aTypedArrayConstructor(speciesConstructor(originalArray, getTypedArrayConstructor(originalArray))); +}; + +/***/ }), +/* 454 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var ArrayBufferViewCore = __webpack_require__(215); +var $find = (__webpack_require__(85).find); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.find` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.find +exportTypedArrayMethod('find', function find(predicate /* , thisArg */) { + return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); +}); + +/***/ }), +/* 455 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var ArrayBufferViewCore = __webpack_require__(215); +var $findIndex = (__webpack_require__(85).findIndex); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.findIndex` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex +exportTypedArrayMethod('findIndex', function findIndex(predicate /* , thisArg */) { + return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); +}); + +/***/ }), +/* 456 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var ArrayBufferViewCore = __webpack_require__(215); +var $findLast = (__webpack_require__(155).findLast); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.findLast` method +// https://github.com/tc39/proposal-array-find-from-last +exportTypedArrayMethod('findLast', function findLast(predicate /* , thisArg */) { + return $findLast(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); +}); + +/***/ }), +/* 457 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var ArrayBufferViewCore = __webpack_require__(215); +var $findLastIndex = (__webpack_require__(155).findLastIndex); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.findLastIndex` method +// https://github.com/tc39/proposal-array-find-from-last +exportTypedArrayMethod('findLastIndex', function findLastIndex(predicate /* , thisArg */) { + return $findLastIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); +}); + +/***/ }), +/* 458 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var ArrayBufferViewCore = __webpack_require__(215); +var $forEach = (__webpack_require__(85).forEach); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.forEach` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach +exportTypedArrayMethod('forEach', function forEach(callbackfn /* , thisArg */) { + $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); +}); + +/***/ }), +/* 459 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = __webpack_require__(433); +var exportTypedArrayStaticMethod = (__webpack_require__(215).exportTypedArrayStaticMethod); +var typedArrayFrom = __webpack_require__(436); + +// `%TypedArray%.from` method +// https://tc39.es/ecma262/#sec-%typedarray%.from +exportTypedArrayStaticMethod('from', typedArrayFrom, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS); + +/***/ }), +/* 460 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var ArrayBufferViewCore = __webpack_require__(215); +var $includes = (__webpack_require__(60).includes); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.includes` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes +exportTypedArrayMethod('includes', function includes(searchElement /* , fromIndex */) { + return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); +}); + +/***/ }), +/* 461 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var ArrayBufferViewCore = __webpack_require__(215); +var $indexOf = (__webpack_require__(60).indexOf); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.indexOf` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.indexof +exportTypedArrayMethod('indexOf', function indexOf(searchElement /* , fromIndex */) { + return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); +}); + +/***/ }), +/* 462 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var global = __webpack_require__(4); +var fails = __webpack_require__(7); +var uncurryThis = __webpack_require__(14); +var ArrayBufferViewCore = __webpack_require__(215); +var ArrayIterators = __webpack_require__(169); +var wellKnownSymbol = __webpack_require__(34); var ITERATOR = wellKnownSymbol('iterator'); var Uint8Array = global.Uint8Array; var arrayValues = uncurryThis(ArrayIterators.values); @@ -15908,350 +13862,303 @@ var GENERIC = !fails(function () { TypedArrayPrototype[ITERATOR].call([1]); }); var ITERATOR_IS_VALUES = !!TypedArrayPrototype && TypedArrayPrototype.values && TypedArrayPrototype[ITERATOR] === TypedArrayPrototype.values && TypedArrayPrototype.values.name === 'values'; - var typedArrayValues = function values() { return arrayValues(aTypedArray(this)); -}; // `%TypedArray%.prototype.entries` method +}; + +// `%TypedArray%.prototype.entries` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.entries - - exportTypedArrayMethod('entries', function entries() { return arrayEntries(aTypedArray(this)); -}, GENERIC); // `%TypedArray%.prototype.keys` method +}, GENERIC); +// `%TypedArray%.prototype.keys` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.keys - exportTypedArrayMethod('keys', function keys() { return arrayKeys(aTypedArray(this)); -}, GENERIC); // `%TypedArray%.prototype.values` method +}, GENERIC); +// `%TypedArray%.prototype.values` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.values - exportTypedArrayMethod('values', typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: 'values' -}); // `%TypedArray%.prototype[@@iterator]` method +}); +// `%TypedArray%.prototype[@@iterator]` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype-@@iterator - exportTypedArrayMethod(ITERATOR, typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: 'values' }); /***/ }), -/* 451 */ +/* 463 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var ArrayBufferViewCore = __webpack_require__(201); - +var ArrayBufferViewCore = __webpack_require__(215); var uncurryThis = __webpack_require__(14); - var aTypedArray = ArrayBufferViewCore.aTypedArray; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -var $join = uncurryThis([].join); // `%TypedArray%.prototype.join` method -// https://tc39.es/ecma262/#sec-%typedarray%.prototype.join +var $join = uncurryThis([].join); +// `%TypedArray%.prototype.join` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.join exportTypedArrayMethod('join', function join(separator) { return $join(aTypedArray(this), separator); }); /***/ }), -/* 452 */ +/* 464 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var ArrayBufferViewCore = __webpack_require__(201); - -var apply = __webpack_require__(93); - -var $lastIndexOf = __webpack_require__(170); - +var ArrayBufferViewCore = __webpack_require__(215); +var apply = __webpack_require__(96); +var $lastIndexOf = __webpack_require__(176); var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.lastIndexOf` method -// https://tc39.es/ecma262/#sec-%typedarray%.prototype.lastindexof +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -exportTypedArrayMethod('lastIndexOf', function lastIndexOf(searchElement -/* , fromIndex */ -) { +// `%TypedArray%.prototype.lastIndexOf` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.lastindexof +exportTypedArrayMethod('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) { var length = arguments.length; return apply($lastIndexOf, aTypedArray(this), length > 1 ? [searchElement, arguments[1]] : [searchElement]); }); /***/ }), -/* 453 */ +/* 465 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var ArrayBufferViewCore = __webpack_require__(201); - -var $map = (__webpack_require__(83).map); - -var typedArraySpeciesConstructor = __webpack_require__(441); - +var ArrayBufferViewCore = __webpack_require__(215); +var $map = (__webpack_require__(85).map); +var typedArraySpeciesConstructor = __webpack_require__(453); var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.map` method -// https://tc39.es/ecma262/#sec-%typedarray%.prototype.map +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -exportTypedArrayMethod('map', function map(mapfn -/* , thisArg */ -) { +// `%TypedArray%.prototype.map` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.map +exportTypedArrayMethod('map', function map(mapfn /* , thisArg */) { return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) { return new (typedArraySpeciesConstructor(O))(length); }); }); /***/ }), -/* 454 */ +/* 466 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var ArrayBufferViewCore = __webpack_require__(201); - -var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = __webpack_require__(420); - +var ArrayBufferViewCore = __webpack_require__(215); +var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = __webpack_require__(433); var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; -var exportTypedArrayStaticMethod = ArrayBufferViewCore.exportTypedArrayStaticMethod; // `%TypedArray%.of` method -// https://tc39.es/ecma262/#sec-%typedarray%.of +var exportTypedArrayStaticMethod = ArrayBufferViewCore.exportTypedArrayStaticMethod; -exportTypedArrayStaticMethod('of', function - /* ...items */ -of() { +// `%TypedArray%.of` method +// https://tc39.es/ecma262/#sec-%typedarray%.of +exportTypedArrayStaticMethod('of', function of( /* ...items */ +) { var index = 0; var length = arguments.length; var result = new (aTypedArrayConstructor(this))(length); - while (length > index) result[index] = arguments[index++]; - return result; }, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS); /***/ }), -/* 455 */ +/* 467 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var ArrayBufferViewCore = __webpack_require__(201); - -var $reduce = (__webpack_require__(176).left); - +var ArrayBufferViewCore = __webpack_require__(215); +var $reduce = (__webpack_require__(182).left); var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.reduce` method -// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduce +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -exportTypedArrayMethod('reduce', function reduce(callbackfn -/* , initialValue */ -) { +// `%TypedArray%.prototype.reduce` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduce +exportTypedArrayMethod('reduce', function reduce(callbackfn /* , initialValue */) { var length = arguments.length; return $reduce(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : undefined); }); /***/ }), -/* 456 */ +/* 468 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var ArrayBufferViewCore = __webpack_require__(201); - -var $reduceRight = (__webpack_require__(176).right); - +var ArrayBufferViewCore = __webpack_require__(215); +var $reduceRight = (__webpack_require__(182).right); var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.reduceRight` method -// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -exportTypedArrayMethod('reduceRight', function reduceRight(callbackfn -/* , initialValue */ -) { +// `%TypedArray%.prototype.reduceRight` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright +exportTypedArrayMethod('reduceRight', function reduceRight(callbackfn /* , initialValue */) { var length = arguments.length; return $reduceRight(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : undefined); }); /***/ }), -/* 457 */ +/* 469 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var ArrayBufferViewCore = __webpack_require__(201); - +var ArrayBufferViewCore = __webpack_require__(215); var aTypedArray = ArrayBufferViewCore.aTypedArray; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -var floor = Math.floor; // `%TypedArray%.prototype.reverse` method -// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse +var floor = Math.floor; +// `%TypedArray%.prototype.reverse` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse exportTypedArrayMethod('reverse', function reverse() { var that = this; var length = aTypedArray(that).length; var middle = floor(length / 2); var index = 0; var value; - while (index < middle) { value = that[index]; that[index++] = that[--length]; that[length] = value; } - return that; }); /***/ }), -/* 458 */ +/* 470 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var global = __webpack_require__(4); - var call = __webpack_require__(8); - -var ArrayBufferViewCore = __webpack_require__(201); - -var lengthOfArrayLike = __webpack_require__(63); - -var toOffset = __webpack_require__(421); - -var toIndexedObject = __webpack_require__(39); - +var ArrayBufferViewCore = __webpack_require__(215); +var lengthOfArrayLike = __webpack_require__(64); +var toOffset = __webpack_require__(434); +var toIndexedObject = __webpack_require__(40); var fails = __webpack_require__(7); - var RangeError = global.RangeError; var Int8Array = global.Int8Array; var Int8ArrayPrototype = Int8Array && Int8Array.prototype; var $set = Int8ArrayPrototype && Int8ArrayPrototype.set; var aTypedArray = ArrayBufferViewCore.aTypedArray; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -var WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS = !fails(function () { - // eslint-disable-next-line es-x/no-typed-arrays -- required for testing +var WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS = !fails(function () { + // eslint-disable-next-line es/no-typed-arrays -- required for testing var array = new Uint8ClampedArray(2); call($set, array, { length: 1, 0: 3 }, 1); return array[1] !== 3; -}); // https://bugs.chromium.org/p/v8/issues/detail?id=11294 and other +}); -var TO_OBJECT_BUG = WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS && ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS && fails(function () { +// https://bugs.chromium.org/p/v8/issues/detail?id=11294 and other +var TO_OBJECT_BUG = WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS && ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS && fails(function () { var array = new Int8Array(2); array.set(1); array.set('2', 1); return array[0] !== 0 || array[1] !== 2; -}); // `%TypedArray%.prototype.set` method -// https://tc39.es/ecma262/#sec-%typedarray%.prototype.set +}); -exportTypedArrayMethod('set', function set(arrayLike -/* , offset */ -) { +// `%TypedArray%.prototype.set` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.set +exportTypedArrayMethod('set', function set(arrayLike /* , offset */) { aTypedArray(this); var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1); var src = toIndexedObject(arrayLike); - if (WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS) return call($set, this, src, offset); + if (WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS) return call($set, this, src, offset); var length = this.length; var len = lengthOfArrayLike(src); var index = 0; if (len + offset > length) throw RangeError('Wrong length'); - while (index < len) this[offset + index] = src[index++]; -}, !WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS || TO_OBJECT_BUG); +}, !WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS || TO_OBJECT_BUG); /***/ }), -/* 459 */ +/* 471 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var ArrayBufferViewCore = __webpack_require__(201); - -var typedArraySpeciesConstructor = __webpack_require__(441); - +var ArrayBufferViewCore = __webpack_require__(215); +var typedArraySpeciesConstructor = __webpack_require__(453); var fails = __webpack_require__(7); - -var arraySlice = __webpack_require__(94); - +var arraySlice = __webpack_require__(97); var aTypedArray = ArrayBufferViewCore.aTypedArray; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; var FORCED = fails(function () { - // eslint-disable-next-line es-x/no-typed-arrays -- required for testing + // eslint-disable-next-line es/no-typed-arrays -- required for testing new Int8Array(1).slice(); -}); // `%TypedArray%.prototype.slice` method -// https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice +}); +// `%TypedArray%.prototype.slice` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice exportTypedArrayMethod('slice', function slice(start, end) { var list = arraySlice(aTypedArray(this), start, end); var C = typedArraySpeciesConstructor(this); var index = 0; var length = list.length; var result = new C(length); - while (length > index) result[index] = list[index++]; - return result; }, FORCED); /***/ }), -/* 460 */ +/* 472 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var ArrayBufferViewCore = __webpack_require__(201); - -var $some = (__webpack_require__(83).some); - +var ArrayBufferViewCore = __webpack_require__(215); +var $some = (__webpack_require__(85).some); var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.some` method -// https://tc39.es/ecma262/#sec-%typedarray%.prototype.some +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -exportTypedArrayMethod('some', function some(callbackfn -/* , thisArg */ -) { +// `%TypedArray%.prototype.some` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.some +exportTypedArrayMethod('some', function some(callbackfn /* , thisArg */) { return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }); /***/ }), -/* 461 */ +/* 473 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var global = __webpack_require__(4); - -var uncurryThis = __webpack_require__(14); - +var uncurryThis = __webpack_require__(87); var fails = __webpack_require__(7); - -var aCallable = __webpack_require__(30); - -var internalSort = __webpack_require__(183); - -var ArrayBufferViewCore = __webpack_require__(201); - -var FF = __webpack_require__(184); - -var IE_OR_EDGE = __webpack_require__(185); - -var V8 = __webpack_require__(27); - -var WEBKIT = __webpack_require__(186); - +var aCallable = __webpack_require__(31); +var internalSort = __webpack_require__(189); +var ArrayBufferViewCore = __webpack_require__(215); +var FF = __webpack_require__(190); +var IE_OR_EDGE = __webpack_require__(191); +var V8 = __webpack_require__(28); +var WEBKIT = __webpack_require__(192); var aTypedArray = ArrayBufferViewCore.aTypedArray; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; var Uint16Array = global.Uint16Array; -var nativeSort = Uint16Array && uncurryThis(Uint16Array.prototype.sort); // WebKit +var nativeSort = Uint16Array && uncurryThis(Uint16Array.prototype.sort); +// WebKit var ACCEPT_INCORRECT_ARGUMENTS = !!nativeSort && !(fails(function () { nativeSort(new Uint16Array(2), null); }) && fails(function () { @@ -16266,36 +14173,32 @@ var STABLE_SORT = !!nativeSort && !fails(function () { var array = new Uint16Array(516); var expected = Array(516); var index, mod; - for (index = 0; index < 516; index++) { mod = index % 4; array[index] = 515 - index; expected[index] = index - 2 * mod + 3; } - nativeSort(array, function (a, b) { return (a / 4 | 0) - (b / 4 | 0); }); - for (index = 0; index < 516; index++) { if (array[index] !== expected[index]) return true; } }); - var getSortCompare = function (comparefn) { return function (x, y) { - if (comparefn !== undefined) return +comparefn(x, y) || 0; // eslint-disable-next-line no-self-compare -- NaN check - - if (y !== y) return -1; // eslint-disable-next-line no-self-compare -- NaN check - + if (comparefn !== undefined) return +comparefn(x, y) || 0; + // eslint-disable-next-line no-self-compare -- NaN check + if (y !== y) return -1; + // eslint-disable-next-line no-self-compare -- NaN check if (x !== x) return 1; if (x === 0 && y === 0) return 1 / x > 0 && 1 / y < 0 ? 1 : -1; return x > y; }; -}; // `%TypedArray%.prototype.sort` method +}; + +// `%TypedArray%.prototype.sort` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort - - exportTypedArrayMethod('sort', function sort(comparefn) { if (comparefn !== undefined) aCallable(comparefn); if (STABLE_SORT) return nativeSort(this, comparefn); @@ -16303,24 +14206,21 @@ exportTypedArrayMethod('sort', function sort(comparefn) { }, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS); /***/ }), -/* 462 */ +/* 474 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var ArrayBufferViewCore = __webpack_require__(201); - -var toLength = __webpack_require__(64); - -var toAbsoluteIndex = __webpack_require__(60); - -var typedArraySpeciesConstructor = __webpack_require__(441); - +var ArrayBufferViewCore = __webpack_require__(215); +var toLength = __webpack_require__(65); +var toAbsoluteIndex = __webpack_require__(61); +var typedArraySpeciesConstructor = __webpack_require__(453); var aTypedArray = ArrayBufferViewCore.aTypedArray; -var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.subarray` method -// https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; +// `%TypedArray%.prototype.subarray` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray exportTypedArrayMethod('subarray', function subarray(begin, end) { var O = aTypedArray(this); var length = O.length; @@ -16330,27 +14230,23 @@ exportTypedArrayMethod('subarray', function subarray(begin, end) { }); /***/ }), -/* 463 */ +/* 475 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var global = __webpack_require__(4); - -var apply = __webpack_require__(93); - -var ArrayBufferViewCore = __webpack_require__(201); - +var apply = __webpack_require__(96); +var ArrayBufferViewCore = __webpack_require__(215); var fails = __webpack_require__(7); - -var arraySlice = __webpack_require__(94); - +var arraySlice = __webpack_require__(97); var Int8Array = global.Int8Array; var aTypedArray = ArrayBufferViewCore.aTypedArray; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; -var $toLocaleString = [].toLocaleString; // iOS Safari 6.x fails here +var $toLocaleString = [].toLocaleString; +// iOS Safari 6.x fails here var TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () { $toLocaleString.call(new Int8Array(1)); }); @@ -16358,33 +14254,73 @@ var FORCED = fails(function () { return [1, 2].toLocaleString() != new Int8Array([1, 2]).toLocaleString(); }) || !fails(function () { Int8Array.prototype.toLocaleString.call([1, 2]); -}); // `%TypedArray%.prototype.toLocaleString` method -// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring +}); +// `%TypedArray%.prototype.toLocaleString` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring exportTypedArrayMethod('toLocaleString', function toLocaleString() { return apply($toLocaleString, TO_LOCALE_STRING_BUG ? arraySlice(aTypedArray(this)) : aTypedArray(this), arraySlice(arguments)); }, FORCED); /***/ }), -/* 464 */ +/* 476 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var exportTypedArrayMethod = (__webpack_require__(201).exportTypedArrayMethod); +var arrayToReversed = __webpack_require__(197); +var ArrayBufferViewCore = __webpack_require__(215); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; +var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor; -var fails = __webpack_require__(7); +// `%TypedArray%.prototype.toReversed` method +// https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toReversed +exportTypedArrayMethod('toReversed', function toReversed() { + return arrayToReversed(aTypedArray(this), getTypedArrayConstructor(this)); +}); -var global = __webpack_require__(4); +/***/ }), +/* 477 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { +"use strict"; + + +var ArrayBufferViewCore = __webpack_require__(215); var uncurryThis = __webpack_require__(14); +var aCallable = __webpack_require__(31); +var arrayFromConstructorAndList = __webpack_require__(199); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; +var sort = uncurryThis(ArrayBufferViewCore.TypedArrayPrototype.sort); +// `%TypedArray%.prototype.toSorted` method +// https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toSorted +exportTypedArrayMethod('toSorted', function toSorted(compareFn) { + if (compareFn !== undefined) aCallable(compareFn); + var O = aTypedArray(this); + var A = arrayFromConstructorAndList(getTypedArrayConstructor(O), O); + return sort(A, compareFn); +}); + +/***/ }), +/* 478 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var exportTypedArrayMethod = (__webpack_require__(215).exportTypedArrayMethod); +var fails = __webpack_require__(7); +var global = __webpack_require__(4); +var uncurryThis = __webpack_require__(14); var Uint8Array = global.Uint8Array; var Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {}; var arrayToString = [].toString; var join = uncurryThis([].join); - if (fails(function () { arrayToString.call({}); })) { @@ -16392,33 +14328,72 @@ if (fails(function () { return join(this); }; } +var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString; -var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString; // `%TypedArray%.prototype.toString` method +// `%TypedArray%.prototype.toString` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.tostring - exportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD); /***/ }), -/* 465 */ +/* 479 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var arrayWith = __webpack_require__(206); +var ArrayBufferViewCore = __webpack_require__(215); +var isBigIntArray = __webpack_require__(437); +var toIntegerOrInfinity = __webpack_require__(62); +var toBigInt = __webpack_require__(438); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; +var PROPER_ORDER = !!function () { + try { + // eslint-disable-next-line no-throw-literal, es/no-typed-arrays, es/no-array-prototype-with -- required for testing + new Int8Array(1)['with'](2, { + valueOf: function () { + throw 8; + } + }); + } catch (error) { + // some early implementations, like WebKit, does not follow the final semantic + // https://github.com/tc39/proposal-change-array-by-copy/pull/86 + return error === 8; + } +}(); + +// `%TypedArray%.prototype.with` method +// https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.with +exportTypedArrayMethod('with', { + 'with': function (index, value) { + var O = aTypedArray(this); + var relativeIndex = toIntegerOrInfinity(index); + var actualValue = isBigIntArray(O) ? toBigInt(value) : +value; + return arrayWith(O, getTypedArrayConstructor(O), relativeIndex, actualValue); + } +}['with'], !PROPER_ORDER); + +/***/ }), +/* 480 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var uncurryThis = __webpack_require__(14); - -var toString = __webpack_require__(68); - +var toString = __webpack_require__(69); var fromCharCode = String.fromCharCode; var charAt = uncurryThis(''.charAt); var exec = uncurryThis(/./.exec); var stringSlice = uncurryThis(''.slice); var hex2 = /^[\da-f]{2}$/i; -var hex4 = /^[\da-f]{4}$/i; // `unescape` method -// https://tc39.es/ecma262/#sec-unescape-string +var hex4 = /^[\da-f]{4}$/i; +// `unescape` method +// https://tc39.es/ecma262/#sec-unescape-string $({ global: true }, { @@ -16428,14 +14403,11 @@ $({ var length = str.length; var index = 0; var chr, part; - while (index < length) { chr = charAt(str, index++); - if (chr === '%') { if (charAt(str, index) === 'u') { part = stringSlice(str, index + 1, index + 5); - if (exec(hex4, part)) { result += fromCharCode(parseInt(part, 16)); index += 5; @@ -16443,7 +14415,6 @@ $({ } } else { part = stringSlice(str, index, index + 2); - if (exec(hex2, part)) { result += fromCharCode(parseInt(part, 16)); index += 2; @@ -16451,71 +14422,84 @@ $({ } } } - result += chr; } - return result; } }); /***/ }), -/* 466 */ +/* 481 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove this module from `core-js@4` since it's replaced to module below -__webpack_require__(467); +__webpack_require__(482); /***/ }), -/* 467 */ +/* 482 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; +var FREEZING = __webpack_require__(246); var global = __webpack_require__(4); - var uncurryThis = __webpack_require__(14); - -var defineBuiltIns = __webpack_require__(196); - -var InternalMetadataModule = __webpack_require__(229); - -var collection = __webpack_require__(228); - -var collectionWeak = __webpack_require__(468); - +var defineBuiltIns = __webpack_require__(210); +var InternalMetadataModule = __webpack_require__(243); +var collection = __webpack_require__(242); +var collectionWeak = __webpack_require__(483); var isObject = __webpack_require__(20); - -var isExtensible = __webpack_require__(230); - -var enforceInternalState = (__webpack_require__(51).enforce); - -var NATIVE_WEAK_MAP = __webpack_require__(52); - +var enforceInternalState = (__webpack_require__(52).enforce); +var fails = __webpack_require__(7); +var NATIVE_WEAK_MAP = __webpack_require__(53); +var $Object = Object; +// eslint-disable-next-line es/no-array-isarray -- safe +var isArray = Array.isArray; +// eslint-disable-next-line es/no-object-isextensible -- safe +var isExtensible = $Object.isExtensible; +// eslint-disable-next-line es/no-object-isfrozen -- safe +var isFrozen = $Object.isFrozen; +// eslint-disable-next-line es/no-object-issealed -- safe +var isSealed = $Object.isSealed; +// eslint-disable-next-line es/no-object-freeze -- safe +var freeze = $Object.freeze; +// eslint-disable-next-line es/no-object-seal -- safe +var seal = $Object.seal; +var FROZEN = {}; +var SEALED = {}; var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global; var InternalWeakMap; - var wrapper = function (init) { return function WeakMap() { return init(this, arguments.length ? arguments[0] : undefined); }; -}; // `WeakMap` constructor +}; + +// `WeakMap` constructor // https://tc39.es/ecma262/#sec-weakmap-constructor +var $WeakMap = collection('WeakMap', wrapper, collectionWeak); +var WeakMapPrototype = $WeakMap.prototype; +var nativeSet = uncurryThis(WeakMapPrototype.set); +// Chakra Edge bug: adding frozen arrays to WeakMap unfreeze them +var hasMSEdgeFreezingBug = function () { + return FREEZING && fails(function () { + var frozenArray = freeze([]); + nativeSet(new $WeakMap(), frozenArray, 1); + return !isFrozen(frozenArray); + }); +}; -var $WeakMap = collection('WeakMap', wrapper, collectionWeak); // IE11 WeakMap frozen keys fix +// IE11 WeakMap frozen keys fix // We can't use feature detection because it crash some old IE builds // https://github.com/zloirock/core-js/issues/485 - -if (NATIVE_WEAK_MAP && IS_IE11) { +if (NATIVE_WEAK_MAP) if (IS_IE11) { InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true); InternalMetadataModule.enable(); - var WeakMapPrototype = $WeakMap.prototype; var nativeDelete = uncurryThis(WeakMapPrototype['delete']); var nativeHas = uncurryThis(WeakMapPrototype.has); var nativeGet = uncurryThis(WeakMapPrototype.get); - var nativeSet = uncurryThis(WeakMapPrototype.set); defineBuiltIns(WeakMapPrototype, { 'delete': function (key) { if (isObject(key) && !isExtensible(key)) { @@ -16523,7 +14507,6 @@ if (NATIVE_WEAK_MAP && IS_IE11) { if (!state.frozen) state.frozen = new InternalWeakMap(); return nativeDelete(this, key) || state.frozen['delete'](key); } - return nativeDelete(this, key); }, has: function has(key) { @@ -16532,7 +14515,6 @@ if (NATIVE_WEAK_MAP && IS_IE11) { if (!state.frozen) state.frozen = new InternalWeakMap(); return nativeHas(this, key) || state.frozen.has(key); } - return nativeHas(this, key); }, get: function get(key) { @@ -16541,7 +14523,6 @@ if (NATIVE_WEAK_MAP && IS_IE11) { if (!state.frozen) state.frozen = new InternalWeakMap(); return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key); } - return nativeGet(this, key); }, set: function set(key, value) { @@ -16550,62 +14531,62 @@ if (NATIVE_WEAK_MAP && IS_IE11) { if (!state.frozen) state.frozen = new InternalWeakMap(); nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value); } else nativeSet(this, key, value); - + return this; + } + }); + // Chakra Edge frozen keys fix +} else if (hasMSEdgeFreezingBug()) { + defineBuiltIns(WeakMapPrototype, { + set: function set(key, value) { + var arrayIntegrityLevel; + if (isArray(key)) { + if (isFrozen(key)) arrayIntegrityLevel = FROZEN;else if (isSealed(key)) arrayIntegrityLevel = SEALED; + } + nativeSet(this, key, value); + if (arrayIntegrityLevel == FROZEN) freeze(key); + if (arrayIntegrityLevel == SEALED) seal(key); return this; } }); } /***/ }), -/* 468 */ +/* 483 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var uncurryThis = __webpack_require__(14); - -var defineBuiltIns = __webpack_require__(196); - -var getWeakData = (__webpack_require__(229).getWeakData); - -var anInstance = __webpack_require__(197); - -var anObject = __webpack_require__(46); - +var defineBuiltIns = __webpack_require__(210); +var getWeakData = (__webpack_require__(243).getWeakData); +var anInstance = __webpack_require__(211); +var anObject = __webpack_require__(47); var isNullOrUndefined = __webpack_require__(17); - var isObject = __webpack_require__(20); - -var iterate = __webpack_require__(126); - -var ArrayIterationModule = __webpack_require__(83); - -var hasOwn = __webpack_require__(38); - -var InternalStateModule = __webpack_require__(51); - +var iterate = __webpack_require__(132); +var ArrayIterationModule = __webpack_require__(85); +var hasOwn = __webpack_require__(39); +var InternalStateModule = __webpack_require__(52); var setInternalState = InternalStateModule.set; var internalStateGetterFor = InternalStateModule.getterFor; var find = ArrayIterationModule.find; var findIndex = ArrayIterationModule.findIndex; var splice = uncurryThis([].splice); -var id = 0; // fallback for uncaught frozen keys +var id = 0; -var uncaughtFrozenStore = function (store) { - return store.frozen || (store.frozen = new UncaughtFrozenStore()); +// fallback for uncaught frozen keys +var uncaughtFrozenStore = function (state) { + return state.frozen || (state.frozen = new UncaughtFrozenStore()); }; - var UncaughtFrozenStore = function () { this.entries = []; }; - var findUncaughtFrozen = function (store, key) { return find(store.entries, function (it) { return it[0] === key; }); }; - UncaughtFrozenStore.prototype = { get: function (key) { var entry = findUncaughtFrozen(this, key); @@ -16642,14 +14623,12 @@ module.exports = { }); var Prototype = Constructor.prototype; var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); - var define = function (that, key, value) { var state = getInternalState(that); var data = getWeakData(anObject(key), true); if (data === true) uncaughtFrozenStore(state).set(key, value);else data[state.id] = value; return that; }; - defineBuiltIns(Prototype, { // `{ WeakMap, WeakSet }.prototype.delete(key)` methods // https://tc39.es/ecma262/#sec-weakmap.prototype.delete @@ -16677,7 +14656,6 @@ module.exports = { // https://tc39.es/ecma262/#sec-weakmap.prototype.get get: function get(key) { var state = getInternalState(this); - if (isObject(key)) { var data = getWeakData(key); if (data === true) return uncaughtFrozenStore(state).get(key); @@ -16701,25 +14679,24 @@ module.exports = { }; /***/ }), -/* 469 */ +/* 484 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove this module from `core-js@4` since it's replaced to module below -__webpack_require__(470); +__webpack_require__(485); /***/ }), -/* 470 */ +/* 485 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var collection = __webpack_require__(228); +var collection = __webpack_require__(242); +var collectionWeak = __webpack_require__(483); -var collectionWeak = __webpack_require__(468); // `WeakSet` constructor +// `WeakSet` constructor // https://tc39.es/ecma262/#sec-weakset-constructor - - collection('WeakSet', function (init) { return function WeakSet() { return init(this, arguments.length ? arguments[0] : undefined); @@ -16727,28 +14704,22 @@ collection('WeakSet', function (init) { }, collectionWeak); /***/ }), -/* 471 */ +/* 486 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - -var getBuiltIn = __webpack_require__(23); - +var global = __webpack_require__(4); +var getBuiltIn = __webpack_require__(24); var uncurryThis = __webpack_require__(14); - +var call = __webpack_require__(8); var fails = __webpack_require__(7); - -var toString = __webpack_require__(68); - -var hasOwn = __webpack_require__(38); - -var validateArgumentsLength = __webpack_require__(315); - -var ctoi = (__webpack_require__(472).ctoi); - +var toString = __webpack_require__(69); +var hasOwn = __webpack_require__(39); +var validateArgumentsLength = __webpack_require__(328); +var ctoi = (__webpack_require__(487).ctoi); var disallowed = /[^\d+/a-z]/i; var whitespaces = /[\t\n\f\r ]+/g; -var finalEq = /[=]+$/; +var finalEq = /[=]{1,2}$/; var $atob = getBuiltIn('atob'); var fromCharCode = String.fromCharCode; var charAt = uncurryThis(''.charAt); @@ -16763,74 +14734,66 @@ var NO_ENCODING_CHECK = !fails(function () { var NO_ARG_RECEIVING_CHECK = !NO_SPACES_IGNORE && !NO_ENCODING_CHECK && !fails(function () { $atob(); }); -var WRONG_ARITY = !NO_SPACES_IGNORE && !NO_ENCODING_CHECK && $atob.length !== 1; // `atob` method -// https://html.spec.whatwg.org/multipage/webappapis.html#dom-atob +var WRONG_ARITY = !NO_SPACES_IGNORE && !NO_ENCODING_CHECK && $atob.length !== 1; +// `atob` method +// https://html.spec.whatwg.org/multipage/webappapis.html#dom-atob $({ global: true, + bind: true, enumerable: true, forced: NO_SPACES_IGNORE || NO_ENCODING_CHECK || NO_ARG_RECEIVING_CHECK || WRONG_ARITY }, { atob: function atob(data) { validateArgumentsLength(arguments.length, 1); - if (NO_ARG_RECEIVING_CHECK || WRONG_ARITY) return $atob(data); + // `webpack` dev server bug on IE global methods - use call(fn, global, ...) + if (NO_ARG_RECEIVING_CHECK || WRONG_ARITY) return call($atob, global, data); var string = replace(toString(data), whitespaces, ''); var output = ''; var position = 0; var bc = 0; var chr, bs; - if (string.length % 4 == 0) { string = replace(string, finalEq, ''); } - if (string.length % 4 == 1 || exec(disallowed, string)) { throw new (getBuiltIn('DOMException'))('The string is not correctly encoded', 'InvalidCharacterError'); } - while (chr = charAt(string, position++)) { if (hasOwn(ctoi, chr)) { bs = bc % 4 ? bs * 64 + ctoi[chr] : ctoi[chr]; if (bc++ % 4) output += fromCharCode(255 & bs >> (-2 * bc & 6)); } } - return output; } }); /***/ }), -/* 472 */ +/* 487 */ /***/ ((module) => { var itoc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; var ctoi = {}; - for (var index = 0; index < 66; index++) ctoi[itoc.charAt(index)] = index; - module.exports = { itoc: itoc, ctoi: ctoi }; /***/ }), -/* 473 */ +/* 488 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - -var getBuiltIn = __webpack_require__(23); - +var global = __webpack_require__(4); +var getBuiltIn = __webpack_require__(24); var uncurryThis = __webpack_require__(14); - +var call = __webpack_require__(8); var fails = __webpack_require__(7); - -var toString = __webpack_require__(68); - -var validateArgumentsLength = __webpack_require__(315); - -var itoc = (__webpack_require__(472).itoc); - +var toString = __webpack_require__(69); +var validateArgumentsLength = __webpack_require__(328); +var itoc = (__webpack_require__(487).itoc); var $btoa = getBuiltIn('btoa'); var charAt = uncurryThis(''.charAt); var charCodeAt = uncurryThis(''.charCodeAt); @@ -16840,52 +14803,46 @@ var NO_ARG_RECEIVING_CHECK = !!$btoa && !fails(function () { var WRONG_ARG_CONVERSION = !!$btoa && fails(function () { return $btoa(null) !== 'bnVsbA=='; }); -var WRONG_ARITY = !!$btoa && $btoa.length !== 1; // `btoa` method -// https://html.spec.whatwg.org/multipage/webappapis.html#dom-btoa +var WRONG_ARITY = !!$btoa && $btoa.length !== 1; +// `btoa` method +// https://html.spec.whatwg.org/multipage/webappapis.html#dom-btoa $({ global: true, + bind: true, enumerable: true, forced: NO_ARG_RECEIVING_CHECK || WRONG_ARG_CONVERSION || WRONG_ARITY }, { btoa: function btoa(data) { validateArgumentsLength(arguments.length, 1); - if (NO_ARG_RECEIVING_CHECK || WRONG_ARG_CONVERSION || WRONG_ARITY) return $btoa(toString(data)); + // `webpack` dev server bug on IE global methods - use call(fn, global, ...) + if (NO_ARG_RECEIVING_CHECK || WRONG_ARG_CONVERSION || WRONG_ARITY) return call($btoa, global, toString(data)); var string = toString(data); var output = ''; var position = 0; var map = itoc; var block, charCode; - while (charAt(string, position) || (map = '=', position % 1)) { charCode = charCodeAt(string, position += 3 / 4); - if (charCode > 0xFF) { throw new (getBuiltIn('DOMException'))('The string contains characters outside of the Latin1 range', 'InvalidCharacterError'); } - block = block << 8 | charCode; output += charAt(map, 63 & block >> 8 - position % 1 * 8); } - return output; } }); /***/ }), -/* 474 */ +/* 489 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4); - -var DOMIterables = __webpack_require__(475); - -var DOMTokenListPrototype = __webpack_require__(476); - -var forEach = __webpack_require__(155); - -var createNonEnumerableProperty = __webpack_require__(43); - +var DOMIterables = __webpack_require__(490); +var DOMTokenListPrototype = __webpack_require__(491); +var forEach = __webpack_require__(161); +var createNonEnumerableProperty = __webpack_require__(44); var handlePrototype = function (CollectionPrototype) { // some Chrome versions have non-configurable methods on DOMTokenList if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try { @@ -16894,17 +14851,15 @@ var handlePrototype = function (CollectionPrototype) { CollectionPrototype.forEach = forEach; } }; - for (var COLLECTION_NAME in DOMIterables) { if (DOMIterables[COLLECTION_NAME]) { handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype); } } - handlePrototype(DOMTokenListPrototype); /***/ }), -/* 475 */ +/* 490 */ /***/ ((module) => { // iterable DOM collections @@ -16944,36 +14899,28 @@ module.exports = { }; /***/ }), -/* 476 */ +/* 491 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList` -var documentCreateElement = __webpack_require__(42); - +var documentCreateElement = __webpack_require__(43); var classList = documentCreateElement('span').classList; var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype; module.exports = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype; /***/ }), -/* 477 */ +/* 492 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var global = __webpack_require__(4); - -var DOMIterables = __webpack_require__(475); - -var DOMTokenListPrototype = __webpack_require__(476); - -var ArrayIteratorMethods = __webpack_require__(163); - -var createNonEnumerableProperty = __webpack_require__(43); - -var wellKnownSymbol = __webpack_require__(33); - +var DOMIterables = __webpack_require__(490); +var DOMTokenListPrototype = __webpack_require__(491); +var ArrayIteratorMethods = __webpack_require__(169); +var createNonEnumerableProperty = __webpack_require__(44); +var wellKnownSymbol = __webpack_require__(34); var ITERATOR = wellKnownSymbol('iterator'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var ArrayValues = ArrayIteratorMethods.values; - var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) { if (CollectionPrototype) { // some Chrome versions have non-configurable methods on DOMTokenList @@ -16982,11 +14929,9 @@ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) { } catch (error) { CollectionPrototype[ITERATOR] = ArrayValues; } - if (!CollectionPrototype[TO_STRING_TAG]) { createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME); } - if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) { // some Chrome versions have non-configurable methods on DOMTokenList if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try { @@ -16997,83 +14942,59 @@ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) { } } }; - for (var COLLECTION_NAME in DOMIterables) { handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype, COLLECTION_NAME); } - handlePrototype(DOMTokenListPrototype, 'DOMTokenList'); /***/ }), -/* 478 */ +/* 493 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - -var tryNodeRequire = __webpack_require__(479); - -var getBuiltIn = __webpack_require__(23); - +var tryNodeRequire = __webpack_require__(494); +var getBuiltIn = __webpack_require__(24); var fails = __webpack_require__(7); - -var create = __webpack_require__(71); - +var create = __webpack_require__(72); var createPropertyDescriptor = __webpack_require__(11); - -var defineProperty = (__webpack_require__(44).f); - -var defineBuiltIn = __webpack_require__(47); - -var defineBuiltInAccessor = __webpack_require__(304); - -var hasOwn = __webpack_require__(38); - -var anInstance = __webpack_require__(197); - -var anObject = __webpack_require__(46); - -var errorToString = __webpack_require__(121); - -var normalizeStringArgument = __webpack_require__(116); - -var DOMExceptionConstants = __webpack_require__(480); - -var clearErrorStack = __webpack_require__(118); - -var InternalStateModule = __webpack_require__(51); - +var defineProperty = (__webpack_require__(45).f); +var defineBuiltIn = __webpack_require__(48); +var defineBuiltInAccessor = __webpack_require__(79); +var hasOwn = __webpack_require__(39); +var anInstance = __webpack_require__(211); +var anObject = __webpack_require__(47); +var errorToString = __webpack_require__(127); +var normalizeStringArgument = __webpack_require__(121); +var DOMExceptionConstants = __webpack_require__(495); +var clearErrorStack = __webpack_require__(124); +var InternalStateModule = __webpack_require__(52); var DESCRIPTORS = __webpack_require__(6); - -var IS_PURE = __webpack_require__(35); - +var IS_PURE = __webpack_require__(36); var DOM_EXCEPTION = 'DOMException'; var DATA_CLONE_ERR = 'DATA_CLONE_ERR'; -var Error = getBuiltIn('Error'); // NodeJS < 17.0 does not expose `DOMException` to global - +var Error = getBuiltIn('Error'); +// NodeJS < 17.0 does not expose `DOMException` to global var NativeDOMException = getBuiltIn(DOM_EXCEPTION) || function () { try { // NodeJS < 15.0 does not expose `MessageChannel` to global - var MessageChannel = getBuiltIn('MessageChannel') || tryNodeRequire('worker_threads').MessageChannel; // eslint-disable-next-line es-x/no-weak-map, unicorn/require-post-message-target-origin -- safe - + var MessageChannel = getBuiltIn('MessageChannel') || tryNodeRequire('worker_threads').MessageChannel; + // eslint-disable-next-line es/no-weak-map, unicorn/require-post-message-target-origin -- safe new MessageChannel().port1.postMessage(new WeakMap()); } catch (error) { if (error.name == DATA_CLONE_ERR && error.code == 25) return error.constructor; } }(); - var NativeDOMExceptionPrototype = NativeDOMException && NativeDOMException.prototype; var ErrorPrototype = Error.prototype; var setInternalState = InternalStateModule.set; var getInternalState = InternalStateModule.getterFor(DOM_EXCEPTION); var HAS_STACK = ('stack' in Error(DOM_EXCEPTION)); - var codeFor = function (name) { return hasOwn(DOMExceptionConstants, name) && DOMExceptionConstants[name].m ? DOMExceptionConstants[name].c : 0; }; - var $DOMException = function DOMException() { anInstance(this, DOMExceptionPrototype); var argumentsLength = arguments.length; @@ -17086,22 +15007,18 @@ var $DOMException = function DOMException() { message: message, code: code }); - if (!DESCRIPTORS) { this.name = name; this.message = message; this.code = code; } - if (HAS_STACK) { var error = Error(message); error.name = DOM_EXCEPTION; defineProperty(this, 'stack', createPropertyDescriptor(1, clearErrorStack(error.stack, 1))); } }; - var DOMExceptionPrototype = $DOMException.prototype = create(ErrorPrototype); - var createGetterDescriptor = function (get) { return { enumerable: true, @@ -17109,37 +15026,42 @@ var createGetterDescriptor = function (get) { get: get }; }; - var getterFor = function (key) { return createGetterDescriptor(function () { return getInternalState(this)[key]; }); }; - if (DESCRIPTORS) { + // `DOMException.prototype.code` getter defineBuiltInAccessor(DOMExceptionPrototype, 'code', getterFor('code')); + // `DOMException.prototype.message` getter defineBuiltInAccessor(DOMExceptionPrototype, 'message', getterFor('message')); + // `DOMException.prototype.name` getter defineBuiltInAccessor(DOMExceptionPrototype, 'name', getterFor('name')); } +defineProperty(DOMExceptionPrototype, 'constructor', createPropertyDescriptor(1, $DOMException)); -defineProperty(DOMExceptionPrototype, 'constructor', createPropertyDescriptor(1, $DOMException)); // FF36- DOMException is a function, but can't be constructed - +// FF36- DOMException is a function, but can't be constructed var INCORRECT_CONSTRUCTOR = fails(function () { return !(new NativeDOMException() instanceof Error); -}); // Safari 10.1 / Chrome 32- / IE8- DOMException.prototype.toString bugs +}); +// Safari 10.1 / Chrome 32- / IE8- DOMException.prototype.toString bugs var INCORRECT_TO_STRING = INCORRECT_CONSTRUCTOR || fails(function () { return ErrorPrototype.toString !== errorToString || String(new NativeDOMException(1, 2)) !== '2: 1'; -}); // Deno 1.6.3- DOMException.prototype.code just missed +}); +// Deno 1.6.3- DOMException.prototype.code just missed var INCORRECT_CODE = INCORRECT_CONSTRUCTOR || fails(function () { return new NativeDOMException(1, 'DataCloneError').code !== 25; -}); // Deno 1.6.3- DOMException constants just missed +}); +// Deno 1.6.3- DOMException constants just missed var MISSED_CONSTANTS = INCORRECT_CONSTRUCTOR || NativeDOMException[DATA_CLONE_ERR] !== 25 || NativeDOMExceptionPrototype[DATA_CLONE_ERR] !== 25; -var FORCED_CONSTRUCTOR = IS_PURE ? INCORRECT_TO_STRING || INCORRECT_CODE || MISSED_CONSTANTS : INCORRECT_CONSTRUCTOR; // `DOMException` constructor -// https://webidl.spec.whatwg.org/#idl-DOMException +var FORCED_CONSTRUCTOR = IS_PURE ? INCORRECT_TO_STRING || INCORRECT_CODE || MISSED_CONSTANTS : INCORRECT_CONSTRUCTOR; +// `DOMException` constructor +// https://webidl.spec.whatwg.org/#idl-DOMException $({ global: true, constructor: true, @@ -17149,48 +15071,42 @@ $({ }); var PolyfilledDOMException = getBuiltIn(DOM_EXCEPTION); var PolyfilledDOMExceptionPrototype = PolyfilledDOMException.prototype; - if (INCORRECT_TO_STRING && (IS_PURE || NativeDOMException === PolyfilledDOMException)) { defineBuiltIn(PolyfilledDOMExceptionPrototype, 'toString', errorToString); } - if (INCORRECT_CODE && DESCRIPTORS && NativeDOMException === PolyfilledDOMException) { defineBuiltInAccessor(PolyfilledDOMExceptionPrototype, 'code', createGetterDescriptor(function () { return codeFor(anObject(this).name); })); } +// `DOMException` constants for (var key in DOMExceptionConstants) if (hasOwn(DOMExceptionConstants, key)) { var constant = DOMExceptionConstants[key]; var constantName = constant.s; var descriptor = createPropertyDescriptor(6, constant.c); - if (!hasOwn(PolyfilledDOMException, constantName)) { defineProperty(PolyfilledDOMException, constantName, descriptor); } - if (!hasOwn(PolyfilledDOMExceptionPrototype, constantName)) { defineProperty(PolyfilledDOMExceptionPrototype, constantName, descriptor); } } /***/ }), -/* 479 */ +/* 494 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var IS_NODE = __webpack_require__(177); - +var IS_NODE = __webpack_require__(183); module.exports = function (name) { try { // eslint-disable-next-line no-new-func -- safe if (IS_NODE) return Function('return require("' + name + '")')(); - } catch (error) { - /* empty */ - } + } catch (error) {/* empty */} }; /***/ }), -/* 480 */ +/* 495 */ /***/ ((module) => { module.exports = { @@ -17322,42 +15238,28 @@ module.exports = { }; /***/ }), -/* 481 */ +/* 496 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); - var global = __webpack_require__(4); - -var getBuiltIn = __webpack_require__(23); - +var getBuiltIn = __webpack_require__(24); var createPropertyDescriptor = __webpack_require__(11); - -var defineProperty = (__webpack_require__(44).f); - -var hasOwn = __webpack_require__(38); - -var anInstance = __webpack_require__(197); - -var inheritIfRequired = __webpack_require__(115); - -var normalizeStringArgument = __webpack_require__(116); - -var DOMExceptionConstants = __webpack_require__(480); - -var clearErrorStack = __webpack_require__(118); - +var defineProperty = (__webpack_require__(45).f); +var hasOwn = __webpack_require__(39); +var anInstance = __webpack_require__(211); +var inheritIfRequired = __webpack_require__(120); +var normalizeStringArgument = __webpack_require__(121); +var DOMExceptionConstants = __webpack_require__(495); +var clearErrorStack = __webpack_require__(124); var DESCRIPTORS = __webpack_require__(6); - -var IS_PURE = __webpack_require__(35); - +var IS_PURE = __webpack_require__(36); var DOM_EXCEPTION = 'DOMException'; var Error = getBuiltIn('Error'); var NativeDOMException = getBuiltIn(DOM_EXCEPTION); - var $DOMException = function DOMException() { anInstance(this, DOMExceptionPrototype); var argumentsLength = arguments.length; @@ -17370,18 +15272,20 @@ var $DOMException = function DOMException() { inheritIfRequired(that, this, $DOMException); return that; }; - var DOMExceptionPrototype = $DOMException.prototype = NativeDOMException.prototype; var ERROR_HAS_STACK = ('stack' in Error(DOM_EXCEPTION)); -var DOM_EXCEPTION_HAS_STACK = ('stack' in new NativeDOMException(1, 2)); // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe +var DOM_EXCEPTION_HAS_STACK = ('stack' in new NativeDOMException(1, 2)); -var descriptor = NativeDOMException && DESCRIPTORS && Object.getOwnPropertyDescriptor(global, DOM_EXCEPTION); // Bun ~ 0.1.1 DOMException have incorrect descriptor and we can't redefine it +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe +var descriptor = NativeDOMException && DESCRIPTORS && Object.getOwnPropertyDescriptor(global, DOM_EXCEPTION); + +// Bun ~ 0.1.1 DOMException have incorrect descriptor and we can't redefine it // https://github.com/Jarred-Sumner/bun/issues/399 - var BUGGY_DESCRIPTOR = !!descriptor && !(descriptor.writable && descriptor.configurable); -var FORCED_CONSTRUCTOR = ERROR_HAS_STACK && !BUGGY_DESCRIPTOR && !DOM_EXCEPTION_HAS_STACK; // `DOMException` constructor patch for `.stack` where it's required -// https://webidl.spec.whatwg.org/#es-DOMException-specialness +var FORCED_CONSTRUCTOR = ERROR_HAS_STACK && !BUGGY_DESCRIPTOR && !DOM_EXCEPTION_HAS_STACK; +// `DOMException` constructor patch for `.stack` where it's required +// https://webidl.spec.whatwg.org/#es-DOMException-specialness $({ global: true, constructor: true, @@ -17392,16 +15296,13 @@ $({ }); var PolyfilledDOMException = getBuiltIn(DOM_EXCEPTION); var PolyfilledDOMExceptionPrototype = PolyfilledDOMException.prototype; - if (PolyfilledDOMExceptionPrototype.constructor !== PolyfilledDOMException) { if (!IS_PURE) { defineProperty(PolyfilledDOMExceptionPrototype, 'constructor', createPropertyDescriptor(1, PolyfilledDOMException)); } - for (var key in DOMExceptionConstants) if (hasOwn(DOMExceptionConstants, key)) { var constant = DOMExceptionConstants[key]; var constantName = constant.s; - if (!hasOwn(PolyfilledDOMException, constantName)) { defineProperty(PolyfilledDOMException, constantName, createPropertyDescriptor(6, constant.c)); } @@ -17409,37 +15310,34 @@ if (PolyfilledDOMExceptionPrototype.constructor !== PolyfilledDOMException) { } /***/ }), -/* 482 */ +/* 497 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var getBuiltIn = __webpack_require__(23); - -var setToStringTag = __webpack_require__(82); - +var getBuiltIn = __webpack_require__(24); +var setToStringTag = __webpack_require__(84); var DOM_EXCEPTION = 'DOMException'; + +// `DOMException.prototype[@@toStringTag]` property setToStringTag(getBuiltIn(DOM_EXCEPTION), DOM_EXCEPTION); /***/ }), -/* 483 */ +/* 498 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove this module from `core-js@4` since it's split to modules listed below -__webpack_require__(484); - -__webpack_require__(485); +__webpack_require__(499); +__webpack_require__(500); /***/ }), -/* 484 */ +/* 499 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var global = __webpack_require__(4); +var clearImmediate = (__webpack_require__(327).clear); -var clearImmediate = (__webpack_require__(314).clear); // `clearImmediate` method +// `clearImmediate` method // http://w3c.github.io/setImmediate/#si-clearImmediate - - $({ global: true, bind: true, @@ -17450,17 +15348,19 @@ $({ }); /***/ }), -/* 485 */ +/* 500 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var global = __webpack_require__(4); +var setTask = (__webpack_require__(327).set); +var schedulersFix = __webpack_require__(501); -var setImmediate = (__webpack_require__(314).set); // `setImmediate` method +// https://github.com/oven-sh/bun/issues/1633 +var setImmediate = global.setImmediate ? schedulersFix(setTask, false) : setTask; + +// `setImmediate` method // http://w3c.github.io/setImmediate/#si-setImmediate - - $({ global: true, bind: true, @@ -17471,24 +15371,63 @@ $({ }); /***/ }), -/* 486 */ +/* 501 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var global = __webpack_require__(4); +var apply = __webpack_require__(96); +var isCallable = __webpack_require__(21); +var ENGINE_IS_BUN = __webpack_require__(502); +var USER_AGENT = __webpack_require__(29); +var arraySlice = __webpack_require__(97); +var validateArgumentsLength = __webpack_require__(328); +var Function = global.Function; +// dirty IE9- and Bun 0.3.0- checks +var WRAP = /MSIE .\./.test(USER_AGENT) || ENGINE_IS_BUN && function () { + var version = global.Bun.version.split('.'); + return version.length < 3 || version[0] == 0 && (version[1] < 3 || version[1] == 3 && version[2] == 0); +}(); + +// IE9- / Bun 0.3.0- setTimeout / setInterval / setImmediate additional parameters fix +// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers +// https://github.com/oven-sh/bun/issues/1633 +module.exports = function (scheduler, hasTimeArg) { + var firstParamIndex = hasTimeArg ? 2 : 1; + return WRAP ? function (handler, timeout /* , ...arguments */) { + var boundArgs = validateArgumentsLength(arguments.length, 1) > firstParamIndex; + var fn = isCallable(handler) ? handler : Function(handler); + var params = boundArgs ? arraySlice(arguments, firstParamIndex) : []; + var callback = boundArgs ? function () { + apply(fn, this, params); + } : fn; + return hasTimeArg ? scheduler(callback, timeout) : scheduler(callback); + } : scheduler; +}; + +/***/ }), +/* 502 */ +/***/ ((module) => { + +/* global Bun -- Deno case */ +module.exports = typeof Bun == 'function' && Bun && typeof Bun.version == 'string'; + +/***/ }), +/* 503 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var global = __webpack_require__(4); +var microtask = __webpack_require__(330); +var aCallable = __webpack_require__(31); +var validateArgumentsLength = __webpack_require__(328); +var IS_NODE = __webpack_require__(183); +var process = global.process; -var microtask = __webpack_require__(317); - -var aCallable = __webpack_require__(30); - -var validateArgumentsLength = __webpack_require__(315); - -var IS_NODE = __webpack_require__(177); - -var process = global.process; // `queueMicrotask` method +// `queueMicrotask` method // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-queuemicrotask - $({ global: true, enumerable: true, @@ -17503,62 +15442,87 @@ $({ }); /***/ }), -/* 487 */ +/* 504 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { -var IS_PURE = __webpack_require__(35); +"use strict"; + var $ = __webpack_require__(3); - var global = __webpack_require__(4); +var defineBuiltInAccessor = __webpack_require__(79); +var DESCRIPTORS = __webpack_require__(6); +var $TypeError = TypeError; +// eslint-disable-next-line es/no-object-defineproperty -- safe +var defineProperty = Object.defineProperty; +var INCORRECT_VALUE = global.self !== global; -var getBuiltin = __webpack_require__(23); +// `self` getter +// https://html.spec.whatwg.org/multipage/window-object.html#dom-self +try { + if (DESCRIPTORS) { + // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe + var descriptor = Object.getOwnPropertyDescriptor(global, 'self'); + // some engines have `self`, but with incorrect descriptor + // https://github.com/denoland/deno/issues/15765 + if (INCORRECT_VALUE || !descriptor || !descriptor.get || !descriptor.enumerable) { + defineBuiltInAccessor(global, 'self', { + get: function self() { + return global; + }, + set: function self(value) { + if (this !== global) throw $TypeError('Illegal invocation'); + defineProperty(global, 'self', { + value: value, + writable: true, + configurable: true, + enumerable: true + }); + }, + configurable: true, + enumerable: true + }); + } + } else $({ + global: true, + simple: true, + forced: INCORRECT_VALUE + }, { + self: global + }); +} catch (error) {/* empty */} +/***/ }), +/* 505 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var IS_PURE = __webpack_require__(36); +var $ = __webpack_require__(3); +var global = __webpack_require__(4); +var getBuiltin = __webpack_require__(24); var uncurryThis = __webpack_require__(14); - var fails = __webpack_require__(7); - -var uid = __webpack_require__(40); - +var uid = __webpack_require__(41); var isCallable = __webpack_require__(21); - -var isConstructor = __webpack_require__(88); - +var isConstructor = __webpack_require__(91); var isNullOrUndefined = __webpack_require__(17); - var isObject = __webpack_require__(20); - -var isSymbol = __webpack_require__(22); - -var iterate = __webpack_require__(126); - -var anObject = __webpack_require__(46); - -var classof = __webpack_require__(69); - -var hasOwn = __webpack_require__(38); - -var createProperty = __webpack_require__(77); - -var createNonEnumerableProperty = __webpack_require__(43); - -var lengthOfArrayLike = __webpack_require__(63); - -var validateArgumentsLength = __webpack_require__(315); - -var getRegExpFlags = __webpack_require__(355); - -var ERROR_STACK_INSTALLABLE = __webpack_require__(119); - -var V8 = __webpack_require__(27); - -var IS_BROWSER = __webpack_require__(325); - -var IS_DENO = __webpack_require__(326); - -var IS_NODE = __webpack_require__(177); - +var isSymbol = __webpack_require__(23); +var iterate = __webpack_require__(132); +var anObject = __webpack_require__(47); +var classof = __webpack_require__(70); +var hasOwn = __webpack_require__(39); +var createProperty = __webpack_require__(78); +var createNonEnumerableProperty = __webpack_require__(44); +var lengthOfArrayLike = __webpack_require__(64); +var validateArgumentsLength = __webpack_require__(328); +var getRegExpFlags = __webpack_require__(368); +var MapHelpers = __webpack_require__(506); +var SetHelpers = __webpack_require__(507); +var ERROR_STACK_INSTALLABLE = __webpack_require__(125); +var PROPER_TRANSFER = __webpack_require__(508); var Object = global.Object; +var Array = global.Array; var Date = global.Date; var Error = global.Error; var EvalError = global.EvalError; @@ -17573,13 +15537,12 @@ var CompileError = WebAssembly && WebAssembly.CompileError || Error; var LinkError = WebAssembly && WebAssembly.LinkError || Error; var RuntimeError = WebAssembly && WebAssembly.RuntimeError || Error; var DOMException = getBuiltin('DOMException'); -var Set = getBuiltin('Set'); -var Map = getBuiltin('Map'); -var MapPrototype = Map.prototype; -var mapHas = uncurryThis(MapPrototype.has); -var mapGet = uncurryThis(MapPrototype.get); -var mapSet = uncurryThis(MapPrototype.set); -var setAdd = uncurryThis(Set.prototype.add); +var Map = MapHelpers.Map; +var mapHas = MapHelpers.has; +var mapGet = MapHelpers.get; +var mapSet = MapHelpers.set; +var Set = SetHelpers.Set; +var setAdd = SetHelpers.add; var objectKeys = getBuiltin('Object', 'keys'); var push = uncurryThis([].push); var thisBooleanValue = uncurryThis(true.valueOf); @@ -17589,7 +15552,6 @@ var thisTimeValue = uncurryThis(Date.prototype.getTime); var PERFORMANCE_MARK = uid('structuredClone'); var DATA_CLONE_ERROR = 'DataCloneError'; var TRANSFERRING = 'Transferring'; - var checkBasicSemantic = function (structuredCloneImplementation) { return !fails(function () { var set1 = new global.Set([7]); @@ -17598,7 +15560,6 @@ var checkBasicSemantic = function (structuredCloneImplementation) { return set2 == set1 || !set2.has(7) || typeof number != 'object' || number != 7; }) && structuredCloneImplementation; }; - var checkErrorsCloning = function (structuredCloneImplementation, $Error) { return !fails(function () { var error = new $Error(); @@ -17608,9 +15569,9 @@ var checkErrorsCloning = function (structuredCloneImplementation, $Error) { }); return !(test && test.a === test.b && test.a instanceof $Error && test.a.stack === error.stack); }); -}; // https://github.com/whatwg/html/pull/5749 - +}; +// https://github.com/whatwg/html/pull/5749 var checkNewErrorsCloningSemantic = function (structuredCloneImplementation) { return !fails(function () { var test = structuredCloneImplementation(new global.AggregateError([1], PERFORMANCE_MARK, { @@ -17618,7 +15579,9 @@ var checkNewErrorsCloningSemantic = function (structuredCloneImplementation) { })); return test.name != 'AggregateError' || test.errors[0] != 1 || test.message != PERFORMANCE_MARK || test.cause != 3; }); -}; // FF94+, Safari 15.4+, Chrome 98+, NodeJS 17.0+, Deno 1.13+ +}; + +// FF94+, Safari 15.4+, Chrome 98+, NodeJS 17.0+, Deno 1.13+ // FF<103 and Safari implementations can't clone errors // https://bugzilla.mozilla.org/show_bug.cgi?id=1556604 // FF103 can clone errors, but `.stack` of clone is an empty string @@ -17630,10 +15593,10 @@ var checkNewErrorsCloningSemantic = function (structuredCloneImplementation) { // NodeJS implementation can't clone DOMExceptions // https://github.com/nodejs/node/issues/41038 // only FF103+ supports new (html/5749) error cloning semantic - - var nativeStructuredClone = global.structuredClone; -var FORCED_REPLACEMENT = IS_PURE || !checkErrorsCloning(nativeStructuredClone, Error) || !checkErrorsCloning(nativeStructuredClone, DOMException) || !checkNewErrorsCloningSemantic(nativeStructuredClone); // Chrome 82+, Safari 14.1+, Deno 1.11+ +var FORCED_REPLACEMENT = IS_PURE || !checkErrorsCloning(nativeStructuredClone, Error) || !checkErrorsCloning(nativeStructuredClone, DOMException) || !checkNewErrorsCloningSemantic(nativeStructuredClone); + +// Chrome 82+, Safari 14.1+, Deno 1.11+ // Chrome 78-81 implementation swaps `.name` and `.message` of cloned `DOMException` // Chrome returns `null` if cloned object contains multiple references to one error // Safari 14.1 implementation doesn't clone some `RegExp` flags, so requires a workaround @@ -17644,133 +15607,107 @@ var FORCED_REPLACEMENT = IS_PURE || !checkErrorsCloning(nativeStructuredClone, E // and can't clone, for example, `RegExp` or some boxed primitives // https://github.com/nodejs/node/issues/40840 // no one of those implementations supports new (html/5749) error cloning semantic - var structuredCloneFromMark = !nativeStructuredClone && checkBasicSemantic(function (value) { return new PerformanceMark(PERFORMANCE_MARK, { detail: value }).detail; }); var nativeRestrictedStructuredClone = checkBasicSemantic(nativeStructuredClone) || structuredCloneFromMark; - var throwUncloneable = function (type) { throw new DOMException('Uncloneable type: ' + type, DATA_CLONE_ERROR); }; - var throwUnpolyfillable = function (type, action) { throw new DOMException((action || 'Cloning') + ' of ' + type + ' cannot be properly polyfilled in this engine', DATA_CLONE_ERROR); }; - +var tryNativeRestrictedStructuredClone = function (value, type) { + if (!nativeRestrictedStructuredClone) throwUnpolyfillable(type); + return nativeRestrictedStructuredClone(value); +}; var createDataTransfer = function () { var dataTransfer; - try { dataTransfer = new global.DataTransfer(); } catch (error) { try { dataTransfer = new global.ClipboardEvent('').clipboardData; - } catch (error2) { - /* empty */ - } + } catch (error2) {/* empty */} } - return dataTransfer && dataTransfer.items && dataTransfer.files ? dataTransfer : null; }; - var structuredCloneInternal = function (value, map) { if (isSymbol(value)) throwUncloneable('Symbol'); - if (!isObject(value)) return value; // effectively preserves circular references - + if (!isObject(value)) return value; + // effectively preserves circular references if (map) { if (mapHas(map, value)) return mapGet(map, value); } else map = new Map(); - var type = classof(value); var deep = false; - var C, name, cloned, dataTransfer, i, length, keys, key, source, target; - + var C, name, cloned, dataTransfer, i, length, keys, key, source, target, options; switch (type) { case 'Array': - cloned = []; + cloned = Array(lengthOfArrayLike(value)); deep = true; break; - case 'Object': cloned = {}; deep = true; break; - case 'Map': cloned = new Map(); deep = true; break; - case 'Set': cloned = new Set(); deep = true; break; - case 'RegExp': // in this block because of a Safari 14.1 bug // old FF does not clone regexes passed to the constructor, so get the source and flags directly cloned = new RegExp(value.source, getRegExpFlags(value)); break; - case 'Error': name = value.name; - switch (name) { case 'AggregateError': cloned = getBuiltin('AggregateError')([]); break; - case 'EvalError': cloned = EvalError(); break; - case 'RangeError': cloned = RangeError(); break; - case 'ReferenceError': cloned = ReferenceError(); break; - case 'SyntaxError': cloned = SyntaxError(); break; - case 'TypeError': cloned = TypeError(); break; - case 'URIError': cloned = URIError(); break; - case 'CompileError': cloned = CompileError(); break; - case 'LinkError': cloned = LinkError(); break; - case 'RuntimeError': cloned = RuntimeError(); break; - default: cloned = Error(); } - deep = true; break; - case 'DOMException': cloned = new DOMException(value.message, value.name); deep = true; break; - case 'DataView': case 'Int8Array': case 'Uint8Array': @@ -17783,40 +15720,41 @@ var structuredCloneInternal = function (value, map) { case 'Float64Array': case 'BigInt64Array': case 'BigUint64Array': - C = global[type]; // in some old engines like Safari 9, typeof C is 'object' + C = global[type]; + // in some old engines like Safari 9, typeof C is 'object' // on Uint8ClampedArray or some other constructors - if (!isObject(C)) throwUnpolyfillable(type); - cloned = new C( // this is safe, since arraybuffer cannot have circular references + cloned = new C( + // this is safe, since arraybuffer cannot have circular references structuredCloneInternal(value.buffer, map), value.byteOffset, type === 'DataView' ? value.byteLength : value.length); break; - case 'DOMQuad': try { cloned = new DOMQuad(structuredCloneInternal(value.p1, map), structuredCloneInternal(value.p2, map), structuredCloneInternal(value.p3, map), structuredCloneInternal(value.p4, map)); } catch (error) { - if (nativeRestrictedStructuredClone) { - cloned = nativeRestrictedStructuredClone(value); - } else throwUnpolyfillable(type); + cloned = tryNativeRestrictedStructuredClone(value, type); } - break; - + case 'File': + if (nativeRestrictedStructuredClone) try { + cloned = nativeRestrictedStructuredClone(value); + // NodeJS 20.0.0 bug, https://github.com/nodejs/node/issues/47612 + if (classof(cloned) !== type) cloned = undefined; + } catch (error) {/* empty */} + if (!cloned) try { + cloned = new File([value], value.name, value); + } catch (error) {/* empty */} + if (!cloned) throwUnpolyfillable(type); + break; case 'FileList': dataTransfer = createDataTransfer(); - if (dataTransfer) { for (i = 0, length = lengthOfArrayLike(value); i < length; i++) { dataTransfer.items.add(structuredCloneInternal(value[i], map)); } - cloned = dataTransfer.files; - } else if (nativeRestrictedStructuredClone) { - cloned = nativeRestrictedStructuredClone(value); - } else throwUnpolyfillable(type); - + } else cloned = tryNativeRestrictedStructuredClone(value, type); break; - case 'ImageData': // Safari 9 ImageData is a constructor, but typeof ImageData is 'object' try { @@ -17824,13 +15762,9 @@ var structuredCloneInternal = function (value, map) { colorSpace: value.colorSpace }); } catch (error) { - if (nativeRestrictedStructuredClone) { - cloned = nativeRestrictedStructuredClone(value); - } else throwUnpolyfillable(type); + cloned = tryNativeRestrictedStructuredClone(value, type); } - break; - default: if (nativeRestrictedStructuredClone) { cloned = nativeRestrictedStructuredClone(value); @@ -17839,38 +15773,35 @@ var structuredCloneInternal = function (value, map) { // can be a 3rd party polyfill cloned = Object(value.valueOf()); break; - case 'Boolean': cloned = Object(thisBooleanValue(value)); break; - case 'Number': cloned = Object(thisNumberValue(value)); break; - case 'String': cloned = Object(thisStringValue(value)); break; - case 'Date': cloned = new Date(thisTimeValue(value)); break; - case 'ArrayBuffer': - C = global.DataView; // `ArrayBuffer#slice` is not available in IE10 + C = global.DataView; + // `ArrayBuffer#slice` is not available in IE10 // `ArrayBuffer#slice` and `DataView` are not available in old FF - - if (!C && typeof value.slice != 'function') throwUnpolyfillable(type); // detached buffers throws in `DataView` and `.slice` - + if (!C && typeof value.slice != 'function') throwUnpolyfillable(type); + // detached buffers throws in `DataView` and `.slice` try { - if (typeof value.slice == 'function') { + if (typeof value.slice == 'function' && !value.resizable) { cloned = value.slice(0); } else { length = value.byteLength; - cloned = new ArrayBuffer(length); + options = 'maxByteLength' in value ? { + maxByteLength: value.maxByteLength + } : undefined; + cloned = new ArrayBuffer(length, options); source = new C(value); target = new C(cloned); - for (i = 0; i < length; i++) { target.setUint8(i, source.getUint8(i)); } @@ -17878,153 +15809,106 @@ var structuredCloneInternal = function (value, map) { } catch (error) { throw new DOMException('ArrayBuffer is detached', DATA_CLONE_ERROR); } - break; - case 'SharedArrayBuffer': // SharedArrayBuffer should use shared memory, we can't polyfill it, so return the original cloned = value; break; - case 'Blob': try { cloned = value.slice(0, value.size, value.type); } catch (error) { throwUnpolyfillable(type); } - break; - case 'DOMPoint': case 'DOMPointReadOnly': C = global[type]; - try { cloned = C.fromPoint ? C.fromPoint(value) : new C(value.x, value.y, value.z, value.w); } catch (error) { throwUnpolyfillable(type); } - break; - case 'DOMRect': case 'DOMRectReadOnly': C = global[type]; - try { cloned = C.fromRect ? C.fromRect(value) : new C(value.x, value.y, value.width, value.height); } catch (error) { throwUnpolyfillable(type); } - break; - case 'DOMMatrix': case 'DOMMatrixReadOnly': C = global[type]; - try { cloned = C.fromMatrix ? C.fromMatrix(value) : new C(value); } catch (error) { throwUnpolyfillable(type); } - break; - case 'AudioData': case 'VideoFrame': if (!isCallable(value.clone)) throwUnpolyfillable(type); - try { cloned = value.clone(); } catch (error) { throwUncloneable(type); } - break; - - case 'File': - try { - cloned = new File([value], value.name, value); - } catch (error) { - throwUnpolyfillable(type); - } - - break; - + case 'CropTarget': case 'CryptoKey': - case 'GPUCompilationMessage': + case 'FileSystemDirectoryHandle': + case 'FileSystemFileHandle': + case 'FileSystemHandle': case 'GPUCompilationInfo': + case 'GPUCompilationMessage': case 'ImageBitmap': case 'RTCCertificate': case 'WebAssembly.Module': throwUnpolyfillable(type); // break omitted - default: throwUncloneable(type); } - } - mapSet(map, value, cloned); if (deep) switch (type) { case 'Array': case 'Object': keys = objectKeys(value); - for (i = 0, length = lengthOfArrayLike(keys); i < length; i++) { key = keys[i]; createProperty(cloned, key, structuredCloneInternal(value[key], map)); } - break; - case 'Map': value.forEach(function (v, k) { mapSet(cloned, structuredCloneInternal(k, map), structuredCloneInternal(v, map)); }); break; - case 'Set': value.forEach(function (v) { setAdd(cloned, structuredCloneInternal(v, map)); }); break; - case 'Error': createNonEnumerableProperty(cloned, 'message', structuredCloneInternal(value.message, map)); - if (hasOwn(value, 'cause')) { createNonEnumerableProperty(cloned, 'cause', structuredCloneInternal(value.cause, map)); } - if (name == 'AggregateError') { cloned.errors = structuredCloneInternal(value.errors, map); } - // break omitted - case 'DOMException': if (ERROR_STACK_INSTALLABLE) { createNonEnumerableProperty(cloned, 'stack', structuredCloneInternal(value.stack, map)); } - } return cloned; }; - -var PROPER_TRANSFER = nativeStructuredClone && !fails(function () { - // prevent V8 ArrayBufferDetaching protector cell invalidation and performance degradation - // https://github.com/zloirock/core-js/issues/679 - if (IS_DENO && V8 > 92 || IS_NODE && V8 > 94 || IS_BROWSER && V8 > 97) return false; - var buffer = new ArrayBuffer(8); - var clone = nativeStructuredClone(buffer, { - transfer: [buffer] - }); - return buffer.byteLength != 0 || clone.byteLength != 8; -}); - var tryToTransfer = function (rawTransfer, map) { if (!isObject(rawTransfer)) throw TypeError('Transfer option cannot be converted to a sequence'); var transfer = []; @@ -18034,48 +15918,39 @@ var tryToTransfer = function (rawTransfer, map) { var i = 0; var length = lengthOfArrayLike(transfer); var value, type, C, transferredArray, transferred, canvas, context; - if (PROPER_TRANSFER) { transferredArray = nativeStructuredClone(transfer, { transfer: transfer }); - while (i < length) mapSet(map, transfer[i], transferredArray[i++]); } else while (i < length) { value = transfer[i++]; if (mapHas(map, value)) throw new DOMException('Duplicate transferable', DATA_CLONE_ERROR); type = classof(value); - switch (type) { case 'ImageBitmap': C = global.OffscreenCanvas; if (!isConstructor(C)) throwUnpolyfillable(type, TRANSFERRING); - try { canvas = new C(value.width, value.height); context = canvas.getContext('bitmaprenderer'); context.transferFromImageBitmap(value); transferred = canvas.transferToImageBitmap(); - } catch (error) { - /* empty */ - } - + } catch (error) {/* empty */} break; - case 'AudioData': case 'VideoFrame': if (!isCallable(value.clone) || !isCallable(value.close)) throwUnpolyfillable(type, TRANSFERRING); - try { transferred = value.clone(); value.close(); - } catch (error) { - /* empty */ - } - + } catch (error) {/* empty */} break; - case 'ArrayBuffer': + if (!isCallable(value.transfer)) throwUnpolyfillable(type, TRANSFERRING); + transferred = value.transfer(); + break; + case 'MediaSourceHandle': case 'MessagePort': case 'OffscreenCanvas': case 'ReadableStream': @@ -18083,55 +15958,107 @@ var tryToTransfer = function (rawTransfer, map) { case 'WritableStream': throwUnpolyfillable(type, TRANSFERRING); } - if (transferred === undefined) throw new DOMException('This object cannot be transferred: ' + type, DATA_CLONE_ERROR); mapSet(map, value, transferred); } }; +// `structuredClone` method +// https://html.spec.whatwg.org/multipage/structured-data.html#dom-structuredclone $({ global: true, enumerable: true, sham: !PROPER_TRANSFER, forced: FORCED_REPLACEMENT }, { - structuredClone: function structuredClone(value - /* , { transfer } */ - ) { + structuredClone: function structuredClone(value /* , { transfer } */) { var options = validateArgumentsLength(arguments.length, 1) > 1 && !isNullOrUndefined(arguments[1]) ? anObject(arguments[1]) : undefined; var transfer = options ? options.transfer : undefined; var map; - if (transfer !== undefined) { map = new Map(); tryToTransfer(transfer, map); } - return structuredCloneInternal(value, map); } }); /***/ }), -/* 488 */ +/* 506 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var uncurryThis = __webpack_require__(14); + +// eslint-disable-next-line es/no-map -- safe +var MapPrototype = Map.prototype; +module.exports = { + // eslint-disable-next-line es/no-map -- safe + Map: Map, + set: uncurryThis(MapPrototype.set), + get: uncurryThis(MapPrototype.get), + has: uncurryThis(MapPrototype.has), + remove: uncurryThis(MapPrototype['delete']), + proto: MapPrototype +}; + +/***/ }), +/* 507 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var uncurryThis = __webpack_require__(14); + +// eslint-disable-next-line es/no-set -- safe +var SetPrototype = Set.prototype; +module.exports = { + // eslint-disable-next-line es/no-set -- safe + Set: Set, + add: uncurryThis(SetPrototype.add), + has: uncurryThis(SetPrototype.has), + remove: uncurryThis(SetPrototype['delete']), + proto: SetPrototype +}; + +/***/ }), +/* 508 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var global = __webpack_require__(4); +var fails = __webpack_require__(7); +var V8 = __webpack_require__(28); +var IS_BROWSER = __webpack_require__(338); +var IS_DENO = __webpack_require__(339); +var IS_NODE = __webpack_require__(183); +var structuredClone = global.structuredClone; +module.exports = !!structuredClone && !fails(function () { + // prevent V8 ArrayBufferDetaching protector cell invalidation and performance degradation + // https://github.com/zloirock/core-js/issues/679 + if (IS_DENO && V8 > 92 || IS_NODE && V8 > 94 || IS_BROWSER && V8 > 97) return false; + var buffer = new ArrayBuffer(8); + var clone = structuredClone(buffer, { + transfer: [buffer] + }); + return buffer.byteLength != 0 || clone.byteLength != 8; +}); + +/***/ }), +/* 509 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove this module from `core-js@4` since it's split to modules listed below -__webpack_require__(489); - -__webpack_require__(491); +__webpack_require__(510); +__webpack_require__(511); /***/ }), -/* 489 */ +/* 510 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var global = __webpack_require__(4); +var schedulersFix = __webpack_require__(501); +var setInterval = schedulersFix(global.setInterval, true); -var setInterval = (__webpack_require__(490).setInterval); // ie9- setInterval additional parameters fix +// Bun / IE9- setInterval additional parameters fix // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval - - $({ global: true, bind: true, @@ -18141,61 +16068,16 @@ $({ }); /***/ }), -/* 490 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var global = __webpack_require__(4); - -var apply = __webpack_require__(93); - -var isCallable = __webpack_require__(21); - -var userAgent = __webpack_require__(28); - -var arraySlice = __webpack_require__(94); - -var validateArgumentsLength = __webpack_require__(315); - -var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check - -var Function = global.Function; - -var wrap = function (scheduler) { - return MSIE ? function (handler, timeout - /* , ...arguments */ - ) { - var boundArgs = validateArgumentsLength(arguments.length, 1) > 2; - var fn = isCallable(handler) ? handler : Function(handler); - var args = boundArgs ? arraySlice(arguments, 2) : undefined; - return scheduler(boundArgs ? function () { - apply(fn, this, args); - } : fn, timeout); - } : scheduler; -}; // ie9- setTimeout & setInterval additional parameters fix -// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers - - -module.exports = { - // `setTimeout` method - // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout - setTimeout: wrap(global.setTimeout), - // `setInterval` method - // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval - setInterval: wrap(global.setInterval) -}; - -/***/ }), -/* 491 */ +/* 511 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { var $ = __webpack_require__(3); - var global = __webpack_require__(4); +var schedulersFix = __webpack_require__(501); +var setTimeout = schedulersFix(global.setTimeout, true); -var setTimeout = (__webpack_require__(490).setTimeout); // ie9- setTimeout additional parameters fix +// Bun / IE9- setTimeout additional parameters fix // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout - - $({ global: true, bind: true, @@ -18205,61 +16087,41 @@ $({ }); /***/ }), -/* 492 */ +/* 512 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove this module from `core-js@4` since it's replaced to module below -__webpack_require__(493); +__webpack_require__(513); /***/ }), -/* 493 */ +/* 513 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; - // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` -__webpack_require__(377); +// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` +__webpack_require__(390); var $ = __webpack_require__(3); - var DESCRIPTORS = __webpack_require__(6); - -var USE_NATIVE_URL = __webpack_require__(494); - +var USE_NATIVE_URL = __webpack_require__(514); var global = __webpack_require__(4); - -var bind = __webpack_require__(84); - +var bind = __webpack_require__(86); var uncurryThis = __webpack_require__(14); - -var defineBuiltIn = __webpack_require__(47); - -var defineBuiltInAccessor = __webpack_require__(304); - -var anInstance = __webpack_require__(197); - -var hasOwn = __webpack_require__(38); - -var assign = __webpack_require__(278); - -var arrayFrom = __webpack_require__(157); - -var arraySlice = __webpack_require__(76); - -var codeAt = (__webpack_require__(371).codeAt); - -var toASCII = __webpack_require__(495); - -var $toString = __webpack_require__(68); - -var setToStringTag = __webpack_require__(82); - -var validateArgumentsLength = __webpack_require__(315); - -var URLSearchParamsModule = __webpack_require__(496); - -var InternalStateModule = __webpack_require__(51); - +var defineBuiltIn = __webpack_require__(48); +var defineBuiltInAccessor = __webpack_require__(79); +var anInstance = __webpack_require__(211); +var hasOwn = __webpack_require__(39); +var assign = __webpack_require__(292); +var arrayFrom = __webpack_require__(163); +var arraySlice = __webpack_require__(77); +var codeAt = (__webpack_require__(384).codeAt); +var toASCII = __webpack_require__(515); +var $toString = __webpack_require__(69); +var setToStringTag = __webpack_require__(84); +var validateArgumentsLength = __webpack_require__(328); +var URLSearchParamsModule = __webpack_require__(516); +var InternalStateModule = __webpack_require__(52); var setInternalState = InternalStateModule.set; var getInternalURLState = InternalStateModule.getterFor('URL'); var URLSearchParams = URLSearchParamsModule.URLSearchParams; @@ -18285,8 +16147,8 @@ var INVALID_AUTHORITY = 'Invalid authority'; var INVALID_SCHEME = 'Invalid scheme'; var INVALID_HOST = 'Invalid host'; var INVALID_PORT = 'Invalid port'; -var ALPHA = /[a-z]/i; // eslint-disable-next-line regexp/no-obscure-range -- safe - +var ALPHA = /[a-z]/i; +// eslint-disable-next-line regexp/no-obscure-range -- safe var ALPHANUMERIC = /[\d+-.a-z]/i; var DIGIT = /\d/; var HEX_START = /^0x/i; @@ -18294,87 +16156,72 @@ var OCT = /^[0-7]+$/; var DEC = /^\d+$/; var HEX = /^[\da-f]+$/i; /* eslint-disable regexp/no-control-character -- safe */ - var FORBIDDEN_HOST_CODE_POINT = /[\0\t\n\r #%/:<>?@[\\\]^|]/; var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\0\t\n\r #/:<>?@[\\\]^|]/; -var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u0020]+|[\u0000-\u0020]+$/g; +var LEADING_C0_CONTROL_OR_SPACE = /^[\u0000-\u0020]+/; +var TRAILING_C0_CONTROL_OR_SPACE = /(^|[^\u0000-\u0020])[\u0000-\u0020]+$/; var TAB_AND_NEW_LINE = /[\t\n\r]/g; /* eslint-enable regexp/no-control-character -- safe */ +var EOF; -var EOF; // https://url.spec.whatwg.org/#ipv4-number-parser - +// https://url.spec.whatwg.org/#ipv4-number-parser var parseIPv4 = function (input) { var parts = split(input, '.'); var partsLength, numbers, index, part, radix, number, ipv4; - if (parts.length && parts[parts.length - 1] == '') { parts.length--; } - partsLength = parts.length; if (partsLength > 4) return input; numbers = []; - for (index = 0; index < partsLength; index++) { part = parts[index]; if (part == '') return input; radix = 10; - if (part.length > 1 && charAt(part, 0) == '0') { radix = exec(HEX_START, part) ? 16 : 8; part = stringSlice(part, radix == 8 ? 1 : 2); } - if (part === '') { number = 0; } else { if (!exec(radix == 10 ? DEC : radix == 8 ? OCT : HEX, part)) return input; number = parseInt(part, radix); } - push(numbers, number); } - for (index = 0; index < partsLength; index++) { number = numbers[index]; - if (index == partsLength - 1) { if (number >= pow(256, 5 - partsLength)) return null; } else if (number > 255) return null; } - ipv4 = pop(numbers); - for (index = 0; index < numbers.length; index++) { ipv4 += numbers[index] * pow(256, 3 - index); } - return ipv4; -}; // https://url.spec.whatwg.org/#concept-ipv6-parser +}; + +// https://url.spec.whatwg.org/#concept-ipv6-parser // eslint-disable-next-line max-statements -- TODO - - var parseIPv6 = function (input) { var address = [0, 0, 0, 0, 0, 0, 0, 0]; var pieceIndex = 0; var compress = null; var pointer = 0; var value, length, numbersSeen, ipv4Piece, number, swaps, swap; - var chr = function () { return charAt(input, pointer); }; - if (chr() == ':') { if (charAt(input, 1) != ':') return; pointer += 2; pieceIndex++; compress = pieceIndex; } - while (chr()) { if (pieceIndex == 8) return; - if (chr() == ':') { if (compress !== null) return; pointer++; @@ -18382,80 +16229,64 @@ var parseIPv6 = function (input) { compress = pieceIndex; continue; } - value = length = 0; - while (length < 4 && exec(HEX, chr())) { value = value * 16 + parseInt(chr(), 16); pointer++; length++; } - if (chr() == '.') { if (length == 0) return; pointer -= length; if (pieceIndex > 6) return; numbersSeen = 0; - while (chr()) { ipv4Piece = null; - if (numbersSeen > 0) { if (chr() == '.' && numbersSeen < 4) pointer++;else return; } - if (!exec(DIGIT, chr())) return; - while (exec(DIGIT, chr())) { number = parseInt(chr(), 10); if (ipv4Piece === null) ipv4Piece = number;else if (ipv4Piece == 0) return;else ipv4Piece = ipv4Piece * 10 + number; if (ipv4Piece > 255) return; pointer++; } - address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece; numbersSeen++; if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++; } - if (numbersSeen != 4) return; break; } else if (chr() == ':') { pointer++; if (!chr()) return; } else if (chr()) return; - address[pieceIndex++] = value; } - if (compress !== null) { swaps = pieceIndex - compress; pieceIndex = 7; - while (pieceIndex != 0 && swaps > 0) { swap = address[pieceIndex]; address[pieceIndex--] = address[compress + swaps - 1]; address[compress + --swaps] = swap; } } else if (pieceIndex != 8) return; - return address; }; - var findLongestZeroSequence = function (ipv6) { var maxIndex = null; var maxLength = 1; var currStart = null; var currLength = 0; var index = 0; - for (; index < 8; index++) { if (ipv6[index] !== 0) { if (currLength > maxLength) { maxIndex = currStart; maxLength = currLength; } - currStart = null; currLength = 0; } else { @@ -18463,36 +16294,31 @@ var findLongestZeroSequence = function (ipv6) { ++currLength; } } - if (currLength > maxLength) { maxIndex = currStart; maxLength = currLength; } - return maxIndex; -}; // https://url.spec.whatwg.org/#host-serializing - +}; +// https://url.spec.whatwg.org/#host-serializing var serializeHost = function (host) { - var result, index, compress, ignore0; // ipv4 - + var result, index, compress, ignore0; + // ipv4 if (typeof host == 'number') { result = []; - for (index = 0; index < 4; index++) { unshift(result, host % 256); host = floor(host / 256); } - - return join(result, '.'); // ipv6 + return join(result, '.'); + // ipv6 } else if (typeof host == 'object') { result = ''; compress = findLongestZeroSequence(host); - for (index = 0; index < 8; index++) { if (ignore0 && host[index] === 0) continue; if (ignore0) ignore0 = false; - if (compress === index) { result += index ? ':' : '::'; ignore0 = true; @@ -18501,13 +16327,10 @@ var serializeHost = function (host) { if (index < 7) result += ':'; } } - return '[' + result + ']'; } - return host; }; - var C0ControlPercentEncodeSet = {}; var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, { ' ': 1, @@ -18534,13 +16357,12 @@ var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, { '^': 1, '|': 1 }); - var percentEncode = function (chr, set) { var code = codeAt(chr, 0); return code > 0x20 && code < 0x7F && !hasOwn(set, chr) ? chr : encodeURIComponent(chr); -}; // https://url.spec.whatwg.org/#special-scheme - +}; +// https://url.spec.whatwg.org/#special-scheme var specialSchemes = { ftp: 21, file: null, @@ -18548,31 +16370,32 @@ var specialSchemes = { https: 443, ws: 80, wss: 443 -}; // https://url.spec.whatwg.org/#windows-drive-letter +}; +// https://url.spec.whatwg.org/#windows-drive-letter var isWindowsDriveLetter = function (string, normalized) { var second; return string.length == 2 && exec(ALPHA, charAt(string, 0)) && ((second = charAt(string, 1)) == ':' || !normalized && second == '|'); -}; // https://url.spec.whatwg.org/#start-with-a-windows-drive-letter - +}; +// https://url.spec.whatwg.org/#start-with-a-windows-drive-letter var startsWithWindowsDriveLetter = function (string) { var third; return string.length > 1 && isWindowsDriveLetter(stringSlice(string, 0, 2)) && (string.length == 2 || (third = charAt(string, 2)) === '/' || third === '\\' || third === '?' || third === '#'); -}; // https://url.spec.whatwg.org/#single-dot-path-segment - +}; +// https://url.spec.whatwg.org/#single-dot-path-segment var isSingleDot = function (segment) { return segment === '.' || toLowerCase(segment) === '%2e'; -}; // https://url.spec.whatwg.org/#double-dot-path-segment - +}; +// https://url.spec.whatwg.org/#double-dot-path-segment var isDoubleDot = function (segment) { segment = toLowerCase(segment); return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e'; -}; // States: - +}; +// States: var SCHEME_START = {}; var SCHEME = {}; var NO_SCHEME = {}; @@ -18594,11 +16417,9 @@ var PATH = {}; var CANNOT_BE_A_BASE_URL_PATH = {}; var QUERY = {}; var FRAGMENT = {}; - var URLState = function (url, isBase, base) { var urlString = $toString(url); var baseState, failure, searchParams; - if (isBase) { failure = this.parse(urlString); if (failure) throw TypeError(failure); @@ -18612,7 +16433,6 @@ var URLState = function (url, isBase, base) { this.searchParams = searchParams; } }; - URLState.prototype = { type: 'URL', // https://url.spec.whatwg.org/#url-parsing @@ -18627,7 +16447,6 @@ URLState.prototype = { var seenPasswordToken = false; var codePoints, chr, bufferCodePoints, failure; input = $toString(input); - if (!stateOverride) { url.scheme = ''; url.username = ''; @@ -18638,15 +16457,13 @@ URLState.prototype = { url.query = null; url.fragment = null; url.cannotBeABaseURL = false; - input = replace(input, LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, ''); + input = replace(input, LEADING_C0_CONTROL_OR_SPACE, ''); + input = replace(input, TRAILING_C0_CONTROL_OR_SPACE, '$1'); } - input = replace(input, TAB_AND_NEW_LINE, ''); codePoints = arrayFrom(input); - while (pointer <= codePoints.length) { chr = codePoints[pointer]; - switch (state) { case SCHEME_START: if (chr && exec(ALPHA, chr)) { @@ -18656,23 +16473,18 @@ URLState.prototype = { state = NO_SCHEME; continue; } else return INVALID_SCHEME; - break; - case SCHEME: if (chr && (exec(ALPHANUMERIC, chr) || chr == '+' || chr == '-' || chr == '.')) { buffer += toLowerCase(chr); } else if (chr == ':') { if (stateOverride && (url.isSpecial() != hasOwn(specialSchemes, buffer) || buffer == 'file' && (url.includesCredentials() || url.port !== null) || url.scheme == 'file' && !url.host)) return; url.scheme = buffer; - if (stateOverride) { if (url.isSpecial() && specialSchemes[url.scheme] == url.port) url.port = null; return; } - buffer = ''; - if (url.scheme == 'file') { state = FILE; } else if (url.isSpecial() && base && base.scheme == url.scheme) { @@ -18693,12 +16505,9 @@ URLState.prototype = { pointer = 0; continue; } else return INVALID_SCHEME; - break; - case NO_SCHEME: if (!base || base.cannotBeABaseURL && chr != '#') return INVALID_SCHEME; - if (base.cannotBeABaseURL && chr == '#') { url.scheme = base.scheme; url.path = arraySlice(base.path); @@ -18708,10 +16517,8 @@ URLState.prototype = { state = FRAGMENT; break; } - state = base.scheme == 'file' ? FILE : RELATIVE; continue; - case SPECIAL_RELATIVE_OR_AUTHORITY: if (chr == '/' && codePoints[pointer + 1] == '/') { state = SPECIAL_AUTHORITY_IGNORE_SLASHES; @@ -18720,9 +16527,7 @@ URLState.prototype = { state = RELATIVE; continue; } - break; - case PATH_OR_AUTHORITY: if (chr == '/') { state = AUTHORITY; @@ -18731,10 +16536,8 @@ URLState.prototype = { state = PATH; continue; } - case RELATIVE: url.scheme = base.scheme; - if (chr == EOF) { url.username = base.username; url.password = base.password; @@ -18771,9 +16574,7 @@ URLState.prototype = { state = PATH; continue; } - break; - case RELATIVE_SLASH: if (url.isSpecial() && (chr == '/' || chr == '\\')) { state = SPECIAL_AUTHORITY_IGNORE_SLASHES; @@ -18787,41 +16588,32 @@ URLState.prototype = { state = PATH; continue; } - break; - case SPECIAL_AUTHORITY_SLASHES: state = SPECIAL_AUTHORITY_IGNORE_SLASHES; if (chr != '/' || charAt(buffer, pointer + 1) != '/') continue; pointer++; break; - case SPECIAL_AUTHORITY_IGNORE_SLASHES: if (chr != '/' && chr != '\\') { state = AUTHORITY; continue; } - break; - case AUTHORITY: if (chr == '@') { if (seenAt) buffer = '%40' + buffer; seenAt = true; bufferCodePoints = arrayFrom(buffer); - for (var i = 0; i < bufferCodePoints.length; i++) { var codePoint = bufferCodePoints[i]; - if (codePoint == ':' && !seenPasswordToken) { seenPasswordToken = true; continue; } - var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet); if (seenPasswordToken) url.password += encodedCodePoints;else url.username += encodedCodePoints; } - buffer = ''; } else if (chr == EOF || chr == '/' || chr == '?' || chr == '#' || chr == '\\' && url.isSpecial()) { if (seenAt && buffer == '') return INVALID_AUTHORITY; @@ -18829,9 +16621,7 @@ URLState.prototype = { buffer = ''; state = HOST; } else buffer += chr; - break; - case HOST: case HOSTNAME: if (stateOverride && url.scheme == 'file') { @@ -18857,9 +16647,7 @@ URLState.prototype = { if (chr == '[') seenBracket = true;else if (chr == ']') seenBracket = false; buffer += chr; } - break; - case PORT: if (exec(DIGIT, chr)) { buffer += chr; @@ -18870,14 +16658,11 @@ URLState.prototype = { url.port = url.isSpecial() && port === specialSchemes[url.scheme] ? null : port; buffer = ''; } - if (stateOverride) return; state = PATH_START; continue; } else return INVALID_PORT; - break; - case FILE: url.scheme = 'file'; if (chr == '/' || chr == '\\') state = FILE_SLASH;else if (base && base.scheme == 'file') { @@ -18902,7 +16687,6 @@ URLState.prototype = { url.path = arraySlice(base.path); url.shortenPath(); } - state = PATH; continue; } @@ -18911,20 +16695,16 @@ URLState.prototype = { continue; } break; - case FILE_SLASH: if (chr == '/' || chr == '\\') { state = FILE_HOST; break; } - if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) { if (isWindowsDriveLetter(base.path[0], true)) push(url.path, base.path[0]);else url.host = base.host; } - state = PATH; continue; - case FILE_HOST: if (chr == EOF || chr == '/' || chr == '\\' || chr == '?' || chr == '#') { if (!stateOverride && isWindowsDriveLetter(buffer)) { @@ -18941,12 +16721,9 @@ URLState.prototype = { buffer = ''; state = PATH_START; } - continue; } else buffer += chr; - break; - case PATH_START: if (url.isSpecial()) { state = PATH; @@ -18961,14 +16738,11 @@ URLState.prototype = { state = PATH; if (chr != '/') continue; } - break; - case PATH: if (chr == EOF || chr == '/' || chr == '\\' && url.isSpecial() || !stateOverride && (chr == '?' || chr == '#')) { if (isDoubleDot(buffer)) { url.shortenPath(); - if (chr != '/' && !(chr == '\\' && url.isSpecial())) { push(url.path, ''); } @@ -18984,15 +16758,12 @@ URLState.prototype = { push(url.path, buffer); } - buffer = ''; - if (url.scheme == 'file' && (chr == EOF || chr == '?' || chr == '#')) { while (url.path.length > 1 && url.path[0] === '') { shift(url.path); } } - if (chr == '?') { url.query = ''; state = QUERY; @@ -19003,9 +16774,7 @@ URLState.prototype = { } else { buffer += percentEncode(chr, pathPercentEncodeSet); } - break; - case CANNOT_BE_A_BASE_URL_PATH: if (chr == '?') { url.query = ''; @@ -19016,9 +16785,7 @@ URLState.prototype = { } else if (chr != EOF) { url.path[0] += percentEncode(chr, C0ControlPercentEncodeSet); } - break; - case QUERY: if (!stateOverride && chr == '#') { url.fragment = ''; @@ -19026,35 +16793,30 @@ URLState.prototype = { } else if (chr != EOF) { if (chr == "'" && url.isSpecial()) url.query += '%27';else if (chr == '#') url.query += '%23';else url.query += percentEncode(chr, C0ControlPercentEncodeSet); } - break; - case FRAGMENT: if (chr != EOF) url.fragment += percentEncode(chr, fragmentPercentEncodeSet); break; } - pointer++; } }, // https://url.spec.whatwg.org/#host-parsing parseHost: function (input) { var result, codePoints, index; - if (charAt(input, 0) == '[') { if (charAt(input, input.length - 1) != ']') return INVALID_HOST; result = parseIPv6(stringSlice(input, 1, -1)); if (!result) return INVALID_HOST; - this.host = result; // opaque host + this.host = result; + // opaque host } else if (!this.isSpecial()) { if (exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT, input)) return INVALID_HOST; result = ''; codePoints = arrayFrom(input); - for (index = 0; index < codePoints.length; index++) { result += percentEncode(codePoints[index], C0ControlPercentEncodeSet); } - this.host = result; } else { input = toASCII(input); @@ -19080,7 +16842,6 @@ URLState.prototype = { shortenPath: function () { var path = this.path; var pathSize = path.length; - if (pathSize && (this.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) { path.length--; } @@ -19097,18 +16858,14 @@ URLState.prototype = { var query = url.query; var fragment = url.fragment; var output = scheme + ':'; - if (host !== null) { output += '//'; - if (url.includesCredentials()) { output += username + (password ? ':' + password : '') + '@'; } - output += serializeHost(host); if (port !== null) output += ':' + port; } else if (scheme == 'file') output += '//'; - output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : ''; if (query !== null) output += '?' + query; if (fragment !== null) output += '#' + fragment; @@ -19147,7 +16904,6 @@ URLState.prototype = { var codePoints = arrayFrom($toString(username)); if (this.cannotHaveUsernamePasswordPort()) return; this.username = ''; - for (var i = 0; i < codePoints.length; i++) { this.username += percentEncode(codePoints[i], userinfoPercentEncodeSet); } @@ -19160,7 +16916,6 @@ URLState.prototype = { var codePoints = arrayFrom($toString(password)); if (this.cannotHaveUsernamePasswordPort()) return; this.password = ''; - for (var i = 0; i < codePoints.length; i++) { this.password += percentEncode(codePoints[i], userinfoPercentEncodeSet); } @@ -19211,7 +16966,6 @@ URLState.prototype = { }, setSearch: function (search) { search = $toString(search); - if (search == '') { this.query = null; } else { @@ -19219,7 +16973,6 @@ URLState.prototype = { this.query = ''; this.parse(search, QUERY); } - this.searchParams.update(); }, // https://url.spec.whatwg.org/#dom-url-searchparams @@ -19233,12 +16986,10 @@ URLState.prototype = { }, setHash: function (hash) { hash = $toString(hash); - if (hash == '') { this.fragment = null; return; } - if ('#' == charAt(hash, 0)) hash = stringSlice(hash, 1); this.fragment = ''; this.parse(hash, FRAGMENT); @@ -19246,16 +16997,14 @@ URLState.prototype = { update: function () { this.query = this.searchParams.serialize() || null; } -}; // `URL` constructor -// https://url.spec.whatwg.org/#url-class +}; -var URLConstructor = function URL(url -/* , base */ -) { +// `URL` constructor +// https://url.spec.whatwg.org/#url-class +var URLConstructor = function URL(url /* , base */) { var that = anInstance(this, URLPrototype); var base = validateArgumentsLength(arguments.length, 1) > 1 ? arguments[1] : undefined; var state = setInternalState(that, new URLState(url, false, base)); - if (!DESCRIPTORS) { that.href = state.serialize(); that.origin = state.getOrigin(); @@ -19271,9 +17020,7 @@ var URLConstructor = function URL(url that.hash = state.getHash(); } }; - var URLPrototype = URLConstructor.prototype; - var accessorDescriptor = function (getter, setter) { return { get: function () { @@ -19286,72 +17033,70 @@ var accessorDescriptor = function (getter, setter) { enumerable: true }; }; - if (DESCRIPTORS) { // `URL.prototype.href` accessors pair // https://url.spec.whatwg.org/#dom-url-href - defineBuiltInAccessor(URLPrototype, 'href', accessorDescriptor('serialize', 'setHref')); // `URL.prototype.origin` getter + defineBuiltInAccessor(URLPrototype, 'href', accessorDescriptor('serialize', 'setHref')); + // `URL.prototype.origin` getter // https://url.spec.whatwg.org/#dom-url-origin - - defineBuiltInAccessor(URLPrototype, 'origin', accessorDescriptor('getOrigin')); // `URL.prototype.protocol` accessors pair + defineBuiltInAccessor(URLPrototype, 'origin', accessorDescriptor('getOrigin')); + // `URL.prototype.protocol` accessors pair // https://url.spec.whatwg.org/#dom-url-protocol - - defineBuiltInAccessor(URLPrototype, 'protocol', accessorDescriptor('getProtocol', 'setProtocol')); // `URL.prototype.username` accessors pair + defineBuiltInAccessor(URLPrototype, 'protocol', accessorDescriptor('getProtocol', 'setProtocol')); + // `URL.prototype.username` accessors pair // https://url.spec.whatwg.org/#dom-url-username - - defineBuiltInAccessor(URLPrototype, 'username', accessorDescriptor('getUsername', 'setUsername')); // `URL.prototype.password` accessors pair + defineBuiltInAccessor(URLPrototype, 'username', accessorDescriptor('getUsername', 'setUsername')); + // `URL.prototype.password` accessors pair // https://url.spec.whatwg.org/#dom-url-password - - defineBuiltInAccessor(URLPrototype, 'password', accessorDescriptor('getPassword', 'setPassword')); // `URL.prototype.host` accessors pair + defineBuiltInAccessor(URLPrototype, 'password', accessorDescriptor('getPassword', 'setPassword')); + // `URL.prototype.host` accessors pair // https://url.spec.whatwg.org/#dom-url-host - - defineBuiltInAccessor(URLPrototype, 'host', accessorDescriptor('getHost', 'setHost')); // `URL.prototype.hostname` accessors pair + defineBuiltInAccessor(URLPrototype, 'host', accessorDescriptor('getHost', 'setHost')); + // `URL.prototype.hostname` accessors pair // https://url.spec.whatwg.org/#dom-url-hostname - - defineBuiltInAccessor(URLPrototype, 'hostname', accessorDescriptor('getHostname', 'setHostname')); // `URL.prototype.port` accessors pair + defineBuiltInAccessor(URLPrototype, 'hostname', accessorDescriptor('getHostname', 'setHostname')); + // `URL.prototype.port` accessors pair // https://url.spec.whatwg.org/#dom-url-port - - defineBuiltInAccessor(URLPrototype, 'port', accessorDescriptor('getPort', 'setPort')); // `URL.prototype.pathname` accessors pair + defineBuiltInAccessor(URLPrototype, 'port', accessorDescriptor('getPort', 'setPort')); + // `URL.prototype.pathname` accessors pair // https://url.spec.whatwg.org/#dom-url-pathname - - defineBuiltInAccessor(URLPrototype, 'pathname', accessorDescriptor('getPathname', 'setPathname')); // `URL.prototype.search` accessors pair + defineBuiltInAccessor(URLPrototype, 'pathname', accessorDescriptor('getPathname', 'setPathname')); + // `URL.prototype.search` accessors pair // https://url.spec.whatwg.org/#dom-url-search - - defineBuiltInAccessor(URLPrototype, 'search', accessorDescriptor('getSearch', 'setSearch')); // `URL.prototype.searchParams` getter + defineBuiltInAccessor(URLPrototype, 'search', accessorDescriptor('getSearch', 'setSearch')); + // `URL.prototype.searchParams` getter // https://url.spec.whatwg.org/#dom-url-searchparams - - defineBuiltInAccessor(URLPrototype, 'searchParams', accessorDescriptor('getSearchParams')); // `URL.prototype.hash` accessors pair + defineBuiltInAccessor(URLPrototype, 'searchParams', accessorDescriptor('getSearchParams')); + // `URL.prototype.hash` accessors pair // https://url.spec.whatwg.org/#dom-url-hash - defineBuiltInAccessor(URLPrototype, 'hash', accessorDescriptor('getHash', 'setHash')); -} // `URL.prototype.toJSON` method +} + +// `URL.prototype.toJSON` method // https://url.spec.whatwg.org/#dom-url-tojson - - defineBuiltIn(URLPrototype, 'toJSON', function toJSON() { return getInternalURLState(this).serialize(); }, { enumerable: true -}); // `URL.prototype.toString` method -// https://url.spec.whatwg.org/#URL-stringification-behavior - -defineBuiltIn(URLPrototype, 'toString', function toString() { - return getInternalURLState(this).serialize(); -}, { - enumerable: true }); +// `URL.prototype.toString` method +// https://url.spec.whatwg.org/#URL-stringification-behavior +defineBuiltIn(URLPrototype, 'toString', function toString() { + return getInternalURLState(this).serialize(); +}, { + enumerable: true +}); if (NativeURL) { var nativeCreateObjectURL = NativeURL.createObjectURL; - var nativeRevokeObjectURL = NativeURL.revokeObjectURL; // `URL.createObjectURL` method + var nativeRevokeObjectURL = NativeURL.revokeObjectURL; + // `URL.createObjectURL` method // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL - - if (nativeCreateObjectURL) defineBuiltIn(URLConstructor, 'createObjectURL', bind(nativeCreateObjectURL, NativeURL)); // `URL.revokeObjectURL` method + if (nativeCreateObjectURL) defineBuiltIn(URLConstructor, 'createObjectURL', bind(nativeCreateObjectURL, NativeURL)); + // `URL.revokeObjectURL` method // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL - if (nativeRevokeObjectURL) defineBuiltIn(URLConstructor, 'revokeObjectURL', bind(nativeRevokeObjectURL, NativeURL)); } - setToStringTag(URLConstructor, 'URL'); $({ global: true, @@ -19363,15 +17108,13 @@ $({ }); /***/ }), -/* 494 */ +/* 514 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fails = __webpack_require__(7); - -var wellKnownSymbol = __webpack_require__(33); - -var IS_PURE = __webpack_require__(35); - +var wellKnownSymbol = __webpack_require__(34); +var DESCRIPTORS = __webpack_require__(6); +var IS_PURE = __webpack_require__(36); var ITERATOR = wellKnownSymbol('iterator'); module.exports = !fails(function () { // eslint-disable-next-line unicorn/relative-url-style -- required for testing @@ -19383,25 +17126,26 @@ module.exports = !fails(function () { searchParams['delete']('b'); result += key + value; }); - return IS_PURE && !url.toJSON || !searchParams.sort || url.href !== 'http://a/c%20d?a=1&c=3' || searchParams.get('c') !== '3' || String(new URLSearchParams('?a=1')) !== 'a=1' || !searchParams[ITERATOR] // throws in Edge - || new URL('https://a@b').username !== 'a' || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b' // not punycoded in Edge - || new URL('http://тест').host !== 'xn--e1aybc' // not escaped in Chrome 62- - || new URL('http://a#б').hash !== '#%D0%B1' // fails in Chrome 66- - || result !== 'a1c3' // throws in Safari + return IS_PURE && !url.toJSON || !searchParams.size && (IS_PURE || !DESCRIPTORS) || !searchParams.sort || url.href !== 'http://a/c%20d?a=1&c=3' || searchParams.get('c') !== '3' || String(new URLSearchParams('?a=1')) !== 'a=1' || !searchParams[ITERATOR] + // throws in Edge + || new URL('https://a@b').username !== 'a' || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b' + // not punycoded in Edge + || new URL('http://тест').host !== 'xn--e1aybc' + // not escaped in Chrome 62- + || new URL('http://a#б').hash !== '#%D0%B1' + // fails in Chrome 66- + || result !== 'a1c3' + // throws in Safari || new URL('http://x', undefined).host !== 'x'; }); /***/ }), -/* 495 */ +/* 515 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -"use strict"; - // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js - +// based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js var uncurryThis = __webpack_require__(14); - var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 - var base = 36; var tMin = 1; var tMax = 26; @@ -19409,13 +17153,9 @@ var skew = 38; var damp = 700; var initialBias = 72; var initialN = 128; // 0x80 - var delimiter = '-'; // '\x2D' - var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars - var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators - var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process'; var baseMinusTMin = base - tMin; var $RangeError = RangeError; @@ -19428,6 +17168,7 @@ var push = uncurryThis([].push); var replace = uncurryThis(''.replace); var split = uncurryThis(''.split); var toLowerCase = uncurryThis(''.toLowerCase); + /** * Creates an array containing the numeric code points of each Unicode * character in the string. While JavaScript uses UCS-2 internally, @@ -19435,19 +17176,15 @@ var toLowerCase = uncurryThis(''.toLowerCase); * UCS-2 exposes as separate characters) into a single code point, * matching UTF-16. */ - var ucs2decode = function (string) { var output = []; var counter = 0; var length = string.length; - while (counter < length) { var value = charCodeAt(string, counter++); - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { // It's a high surrogate, and there is a next character. var extra = charCodeAt(string, counter++); - if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. push(output, ((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); @@ -19461,107 +17198,94 @@ var ucs2decode = function (string) { push(output, value); } } - return output; }; + /** * Converts a digit/integer into a basic code point. */ - - var digitToBasic = function (digit) { // 0..25 map to ASCII a..z or A..Z // 26..35 map to ASCII 0..9 return digit + 22 + 75 * (digit < 26); }; + /** * Bias adaptation function as per section 3.4 of RFC 3492. * https://tools.ietf.org/html/rfc3492#section-3.4 */ - - var adapt = function (delta, numPoints, firstTime) { var k = 0; delta = firstTime ? floor(delta / damp) : delta >> 1; delta += floor(delta / numPoints); - while (delta > baseMinusTMin * tMax >> 1) { delta = floor(delta / baseMinusTMin); k += base; } - return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); }; + /** * Converts a string of Unicode symbols (e.g. a domain name label) to a * Punycode string of ASCII-only symbols. */ - - var encode = function (input) { - var output = []; // Convert the input in UCS-2 to an array of Unicode code points. + var output = []; - input = ucs2decode(input); // Cache the length. + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); - var inputLength = input.length; // Initialize the state. + // Cache the length. + var inputLength = input.length; + // Initialize the state. var n = initialN; var delta = 0; var bias = initialBias; - var i, currentValue; // Handle the basic code points. + var i, currentValue; + // Handle the basic code points. for (i = 0; i < input.length; i++) { currentValue = input[i]; - if (currentValue < 0x80) { push(output, fromCharCode(currentValue)); } } - var basicLength = output.length; // number of basic code points. - var handledCPCount = basicLength; // number of code points that have been handled; - // Finish the basic string with a delimiter unless it's empty. + // Finish the basic string with a delimiter unless it's empty. if (basicLength) { push(output, delimiter); - } // Main encoding loop: - + } + // Main encoding loop: while (handledCPCount < inputLength) { // All non-basic code points < n have been handled already. Find the next larger one: var m = maxInt; - for (i = 0; i < input.length; i++) { currentValue = input[i]; - if (currentValue >= n && currentValue < m) { m = currentValue; } - } // Increase `delta` enough to advance the decoder's state to , but guard against overflow. - + } + // Increase `delta` enough to advance the decoder's state to , but guard against overflow. var handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { throw $RangeError(OVERFLOW_ERROR); } - delta += (m - n) * handledCPCountPlusOne; n = m; - for (i = 0; i < input.length; i++) { currentValue = input[i]; - if (currentValue < n && ++delta > maxInt) { throw $RangeError(OVERFLOW_ERROR); } - if (currentValue == n) { // Represent delta as a generalized variable-length integer. var q = delta; var k = base; - while (true) { var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; if (q < t) break; @@ -19571,110 +17295,79 @@ var encode = function (input) { q = floor(qMinusT / baseMinusT); k += base; } - push(output, fromCharCode(digitToBasic(q))); bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); delta = 0; handledCPCount++; } } - delta++; n++; } - return join(output, ''); }; - module.exports = function (input) { var encoded = []; var labels = split(replace(toLowerCase(input), regexSeparators, '\u002E'), '.'); var i, label; - for (i = 0; i < labels.length; i++) { label = labels[i]; push(encoded, exec(regexNonASCII, label) ? 'xn--' + encode(label) : label); } - return join(encoded, '.'); }; /***/ }), -/* 496 */ +/* 516 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; - // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` -__webpack_require__(163); +// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` +__webpack_require__(169); var $ = __webpack_require__(3); - var global = __webpack_require__(4); - var call = __webpack_require__(8); - var uncurryThis = __webpack_require__(14); - var DESCRIPTORS = __webpack_require__(6); - -var USE_NATIVE_URL = __webpack_require__(494); - -var defineBuiltIn = __webpack_require__(47); - -var defineBuiltIns = __webpack_require__(196); - -var setToStringTag = __webpack_require__(82); - -var createIteratorConstructor = __webpack_require__(165); - -var InternalStateModule = __webpack_require__(51); - -var anInstance = __webpack_require__(197); - +var USE_NATIVE_URL = __webpack_require__(514); +var defineBuiltIn = __webpack_require__(48); +var defineBuiltInAccessor = __webpack_require__(79); +var defineBuiltIns = __webpack_require__(210); +var setToStringTag = __webpack_require__(84); +var createIteratorConstructor = __webpack_require__(171); +var InternalStateModule = __webpack_require__(52); +var anInstance = __webpack_require__(211); var isCallable = __webpack_require__(21); - -var hasOwn = __webpack_require__(38); - -var bind = __webpack_require__(84); - -var classof = __webpack_require__(69); - -var anObject = __webpack_require__(46); - +var hasOwn = __webpack_require__(39); +var bind = __webpack_require__(86); +var classof = __webpack_require__(70); +var anObject = __webpack_require__(47); var isObject = __webpack_require__(20); - -var $toString = __webpack_require__(68); - -var create = __webpack_require__(71); - +var $toString = __webpack_require__(69); +var create = __webpack_require__(72); var createPropertyDescriptor = __webpack_require__(11); - -var getIterator = __webpack_require__(129); - -var getIteratorMethod = __webpack_require__(130); - -var validateArgumentsLength = __webpack_require__(315); - -var wellKnownSymbol = __webpack_require__(33); - -var arraySort = __webpack_require__(183); - +var getIterator = __webpack_require__(135); +var getIteratorMethod = __webpack_require__(136); +var validateArgumentsLength = __webpack_require__(328); +var wellKnownSymbol = __webpack_require__(34); +var arraySort = __webpack_require__(189); var ITERATOR = wellKnownSymbol('iterator'); var URL_SEARCH_PARAMS = 'URLSearchParams'; var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator'; var setInternalState = InternalStateModule.set; var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS); -var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR); // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe - -var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Avoid NodeJS experimental warning +var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR); +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; +// Avoid NodeJS experimental warning var safeGetBuiltIn = function (name) { if (!DESCRIPTORS) return global[name]; var descriptor = getOwnPropertyDescriptor(global, name); return descriptor && descriptor.value; }; - var nativeFetch = safeGetBuiltIn('fetch'); var NativeRequest = safeGetBuiltIn('Request'); var Headers = safeGetBuiltIn('Headers'); @@ -19694,11 +17387,9 @@ var split = uncurryThis(''.split); var stringSlice = uncurryThis(''.slice); var plus = /\+/g; var sequences = Array(4); - var percentSequence = function (bytes) { return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\da-f]{2}){' + bytes + '})', 'gi')); }; - var percentDecode = function (sequence) { try { return decodeURIComponent(sequence); @@ -19706,22 +17397,18 @@ var percentDecode = function (sequence) { return sequence; } }; - var deserialize = function (it) { var result = replace(it, plus, ' '); var bytes = 4; - try { return decodeURIComponent(result); } catch (error) { while (bytes) { result = replace(result, percentSequence(bytes--), percentDecode); } - return result; } }; - var find = /[!'()~]|%20/g; var replacements = { '!': '%21', @@ -19731,15 +17418,12 @@ var replacements = { '~': '%7E', '%20': '+' }; - var replacer = function (match) { return replacements[match]; }; - var serialize = function (it) { return replace(encodeURIComponent(it), find, replacer); }; - var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) { setInternalState(this, { type: URL_SEARCH_PARAMS_ITERATOR, @@ -19751,23 +17435,18 @@ var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params var kind = state.kind; var step = state.iterator.next(); var entry = step.value; - if (!step.done) { step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value]; } - return step; }, true); - var URLSearchParamsState = function (init) { this.entries = []; this.url = null; - if (init !== undefined) { if (isObject(init)) this.parseObject(init);else this.parseQuery(typeof init == 'string' ? charAt(init, 0) === '?' ? stringSlice(init, 1) : init : $toString(init)); } }; - URLSearchParamsState.prototype = { type: URL_SEARCH_PARAMS, bindURL: function (url) { @@ -19777,11 +17456,9 @@ URLSearchParamsState.prototype = { parseObject: function (object) { var iteratorMethod = getIteratorMethod(object); var iterator, next, step, entryIterator, entryNext, first, second; - if (iteratorMethod) { iterator = getIterator(object, iteratorMethod); next = iterator.next; - while (!(step = call(next, iterator)).done) { entryIterator = getIterator(anObject(step.value)); entryNext = entryIterator.next; @@ -19803,10 +17480,8 @@ URLSearchParamsState.prototype = { var attributes = split(query, '&'); var index = 0; var attribute, entry; - while (index < attributes.length) { attribute = attributes[index++]; - if (attribute.length) { entry = split(attribute, '='); push(this.entries, { @@ -19822,12 +17497,10 @@ URLSearchParamsState.prototype = { var result = []; var index = 0; var entry; - while (index < entries.length) { entry = entries[index++]; push(result, serialize(entry.key) + '=' + serialize(entry.value)); } - return join(result, '&'); }, update: function () { @@ -19837,17 +17510,17 @@ URLSearchParamsState.prototype = { updateURL: function () { if (this.url) this.url.update(); } -}; // `URLSearchParams` constructor -// https://url.spec.whatwg.org/#interface-urlsearchparams - -var URLSearchParamsConstructor = function - /* init */ -URLSearchParams() { - anInstance(this, URLSearchParamsPrototype); - var init = arguments.length > 0 ? arguments[0] : undefined; - setInternalState(this, new URLSearchParamsState(init)); }; +// `URLSearchParams` constructor +// https://url.spec.whatwg.org/#interface-urlsearchparams +var URLSearchParamsConstructor = function URLSearchParams( /* init */ +) { + anInstance(this, URLSearchParamsPrototype); + var init = arguments.length > 0 ? arguments[0] : undefined; + var state = setInternalState(this, new URLSearchParamsState(init)); + if (!DESCRIPTORS) this.length = state.entries.length; +}; var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype; defineBuiltIns(URLSearchParamsPrototype, { // `URLSearchParams.prototype.append` method @@ -19859,6 +17532,7 @@ defineBuiltIns(URLSearchParamsPrototype, { key: $toString(name), value: $toString(value) }); + if (!DESCRIPTORS) this.length++; state.updateURL(); }, // `URLSearchParams.prototype.delete` method @@ -19869,11 +17543,10 @@ defineBuiltIns(URLSearchParamsPrototype, { var entries = state.entries; var key = $toString(name); var index = 0; - while (index < entries.length) { if (entries[index].key === key) splice(entries, index, 1);else index++; } - + if (!DESCRIPTORS) this.length = entries.length; state.updateURL(); }, // `URLSearchParams.prototype.get` method @@ -19883,11 +17556,9 @@ defineBuiltIns(URLSearchParamsPrototype, { var entries = getInternalParamsState(this).entries; var key = $toString(name); var index = 0; - for (; index < entries.length; index++) { if (entries[index].key === key) return entries[index].value; } - return null; }, // `URLSearchParams.prototype.getAll` method @@ -19898,11 +17569,9 @@ defineBuiltIns(URLSearchParamsPrototype, { var key = $toString(name); var result = []; var index = 0; - for (; index < entries.length; index++) { if (entries[index].key === key) push(result, entries[index].value); } - return result; }, // `URLSearchParams.prototype.has` method @@ -19912,11 +17581,9 @@ defineBuiltIns(URLSearchParamsPrototype, { var entries = getInternalParamsState(this).entries; var key = $toString(name); var index = 0; - while (index < entries.length) { if (entries[index++].key === key) return true; } - return false; }, // `URLSearchParams.prototype.set` method @@ -19930,10 +17597,8 @@ defineBuiltIns(URLSearchParamsPrototype, { var val = $toString(value); var index = 0; var entry; - for (; index < entries.length; index++) { entry = entries[index]; - if (entry.key === key) { if (found) splice(entries, index--, 1);else { found = true; @@ -19941,11 +17606,11 @@ defineBuiltIns(URLSearchParamsPrototype, { } } } - if (!found) push(entries, { key: key, value: val }); + if (!DESCRIPTORS) this.length = entries.length; state.updateURL(); }, // `URLSearchParams.prototype.sort` method @@ -19958,14 +17623,11 @@ defineBuiltIns(URLSearchParamsPrototype, { state.updateURL(); }, // `URLSearchParams.prototype.forEach` method - forEach: function forEach(callback - /* , thisArg */ - ) { + forEach: function forEach(callback /* , thisArg */) { var entries = getInternalParamsState(this).entries; var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined); var index = 0; var entry; - while (index < entries.length) { entry = entries[index++]; boundFunction(entry.value, entry.key, this); @@ -19985,18 +17647,30 @@ defineBuiltIns(URLSearchParamsPrototype, { } }, { enumerable: true -}); // `URLSearchParams.prototype[@@iterator]` method +}); +// `URLSearchParams.prototype[@@iterator]` method defineBuiltIn(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries, { name: 'entries' -}); // `URLSearchParams.prototype.toString` method -// https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior +}); +// `URLSearchParams.prototype.toString` method +// https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior defineBuiltIn(URLSearchParamsPrototype, 'toString', function toString() { return getInternalParamsState(this).serialize(); }, { enumerable: true }); + +// `URLSearchParams.prototype.size` getter +// https://github.com/whatwg/url/pull/734 +if (DESCRIPTORS) defineBuiltInAccessor(URLSearchParamsPrototype, 'size', { + get: function size() { + return getInternalParamsState(this).entries.length; + }, + configurable: true, + enumerable: true +}); setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS); $({ global: true, @@ -20004,34 +17678,29 @@ $({ forced: !USE_NATIVE_URL }, { URLSearchParams: URLSearchParamsConstructor -}); // Wrap `fetch` and `Request` for correct work with polyfilled `URLSearchParams` +}); +// Wrap `fetch` and `Request` for correct work with polyfilled `URLSearchParams` if (!USE_NATIVE_URL && isCallable(Headers)) { var headersHas = uncurryThis(HeadersPrototype.has); var headersSet = uncurryThis(HeadersPrototype.set); - var wrapRequestOptions = function (init) { if (isObject(init)) { var body = init.body; var headers; - if (classof(body) === URL_SEARCH_PARAMS) { headers = init.headers ? new Headers(init.headers) : new Headers(); - if (!headersHas(headers, 'content-type')) { headersSet(headers, 'content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); } - return create(init, { body: createPropertyDescriptor(0, $toString(body)), headers: createPropertyDescriptor(0, headers) }); } } - return init; }; - if (isCallable(nativeFetch)) { $({ global: true, @@ -20039,22 +17708,16 @@ if (!USE_NATIVE_URL && isCallable(Headers)) { dontCallGetSet: true, forced: true }, { - fetch: function fetch(input - /* , init */ - ) { + fetch: function fetch(input /* , init */) { return nativeFetch(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {}); } }); } - if (isCallable(NativeRequest)) { - var RequestConstructor = function Request(input - /* , init */ - ) { + var RequestConstructor = function Request(input /* , init */) { anInstance(this, RequestPrototype); return new NativeRequest(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {}); }; - RequestPrototype.constructor = RequestConstructor; RequestConstructor.prototype = RequestPrototype; $({ @@ -20067,25 +17730,60 @@ if (!USE_NATIVE_URL && isCallable(Headers)) { }); } } - module.exports = { URLSearchParams: URLSearchParamsConstructor, getState: getInternalParamsState }; /***/ }), -/* 497 */ +/* 517 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +var $ = __webpack_require__(3); +var getBuiltIn = __webpack_require__(24); +var fails = __webpack_require__(7); +var validateArgumentsLength = __webpack_require__(328); +var toString = __webpack_require__(69); +var USE_NATIVE_URL = __webpack_require__(514); +var URL = getBuiltIn('URL'); + +// https://github.com/nodejs/node/issues/47505 +// https://github.com/denoland/deno/issues/18893 +var THROWS_WITHOUT_ARGUMENTS = USE_NATIVE_URL && fails(function () { + URL.canParse(); +}); + +// `URL.canParse` method +// https://url.spec.whatwg.org/#dom-url-canparse +$({ + target: 'URL', + stat: true, + forced: !THROWS_WITHOUT_ARGUMENTS +}, { + canParse: function canParse(url) { + var length = validateArgumentsLength(arguments.length, 1); + var urlString = toString(url); + var base = length < 2 || arguments[1] === undefined ? undefined : toString(arguments[1]); + try { + return !!new URL(urlString, base); + } catch (error) { + return false; + } + } +}); + +/***/ }), +/* 518 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $ = __webpack_require__(3); +var call = __webpack_require__(8); -var call = __webpack_require__(8); // `URL.prototype.toJSON` method +// `URL.prototype.toJSON` method // https://url.spec.whatwg.org/#dom-url-tojson - - $({ target: 'URL', proto: true, @@ -20097,14 +17795,43 @@ $({ }); /***/ }), -/* 498 */ +/* 519 */ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { // TODO: Remove this module from `core-js@4` since it's replaced to module below -__webpack_require__(496); +__webpack_require__(516); /***/ }), -/* 499 */ +/* 520 */ +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var DESCRIPTORS = __webpack_require__(6); +var uncurryThis = __webpack_require__(14); +var defineBuiltInAccessor = __webpack_require__(79); +var URLSearchParamsPrototype = URLSearchParams.prototype; +var forEach = uncurryThis(URLSearchParamsPrototype.forEach); + +// `URLSearchParams.prototype.size` getter +// https://github.com/whatwg/url/pull/734 +if (DESCRIPTORS && !('size' in URLSearchParamsPrototype)) { + defineBuiltInAccessor(URLSearchParamsPrototype, 'size', { + get: function size() { + var count = 0; + forEach(this, function () { + count++; + }); + return count; + }, + configurable: true, + enumerable: true + }); +} + +/***/ }), +/* 521 */ /***/ ((module) => { /** @@ -20113,18 +17840,20 @@ __webpack_require__(496); * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ + var runtime = function (exports) { "use strict"; var Op = Object.prototype; var hasOwn = Op.hasOwnProperty; + var defineProperty = Object.defineProperty || function (obj, key, desc) { + obj[key] = desc.value; + }; var undefined; // More compressible than void 0. - var $Symbol = typeof Symbol === "function" ? Symbol : {}; var iteratorSymbol = $Symbol.iterator || "@@iterator"; var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; - function define(obj, key, value) { Object.defineProperty(obj, key, { value: value, @@ -20134,7 +17863,6 @@ var runtime = function (exports) { }); return obj[key]; } - try { // IE 8 has a broken Object.defineProperty that only works on DOM objects. define({}, ""); @@ -20143,19 +17871,22 @@ var runtime = function (exports) { return obj[key] = value; }; } - function wrap(innerFn, outerFn, self, tryLocsList) { // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; var generator = Object.create(protoGenerator.prototype); - var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. + var context = new Context(tryLocsList || []); - generator._invoke = makeInvokeMethod(innerFn, self, context); + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + defineProperty(generator, "_invoke", { + value: makeInvokeMethod(innerFn, self, context) + }); return generator; } + exports.wrap = wrap; - exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion + // Try/catch helper to minimize deoptimizations. Returns a completion // record like context.tryEntries[i].completion. This interface could // have been (and was previously) designed to take a closure to be // invoked without arguments, but in all the cases we care about we @@ -20165,7 +17896,6 @@ var runtime = function (exports) { // in every case, so we don't have to touch the arguments object. The // only additional allocation required is the completion record, which // has a stable shape and so hopefully should be cheap to allocate. - function tryCatch(fn, obj, arg) { try { return { @@ -20179,46 +17909,50 @@ var runtime = function (exports) { }; } } - var GenStateSuspendedStart = "suspendedStart"; var GenStateSuspendedYield = "suspendedYield"; var GenStateExecuting = "executing"; - var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as - // breaking out of the dispatch switch statement. + var GenStateCompleted = "completed"; - var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and // .constructor.prototype properties for functions that return Generator // objects. For full spec compliance, you may wish to configure your // minifier not to mangle the names of these two functions. - function Generator() {} - function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} - function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that + // This is a polyfill for %IteratorPrototype% for environments that // don't natively support it. - - var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf; var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); - if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { // This environment has a native %IteratorPrototype%; use it instead // of the polyfill. IteratorPrototype = NativeIteratorPrototype; } - var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); GeneratorFunction.prototype = GeneratorFunctionPrototype; - define(Gp, "constructor", GeneratorFunctionPrototype); - define(GeneratorFunctionPrototype, "constructor", GeneratorFunction); - GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the - // Iterator interface in terms of a single ._invoke method. + defineProperty(Gp, "constructor", { + value: GeneratorFunctionPrototype, + configurable: true + }); + defineProperty(GeneratorFunctionPrototype, "constructor", { + value: GeneratorFunction, + configurable: true + }); + GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { @@ -20226,14 +17960,13 @@ var runtime = function (exports) { }); }); } - exports.isGeneratorFunction = function (genFun) { var ctor = typeof genFun === "function" && genFun.constructor; - return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can + return ctor ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can // do is to check its .name property. (ctor.displayName || ctor.name) === "GeneratorFunction" : false; }; - exports.mark = function (genFun) { if (Object.setPrototypeOf) { Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); @@ -20241,31 +17974,27 @@ var runtime = function (exports) { genFun.__proto__ = GeneratorFunctionPrototype; define(genFun, toStringTagSymbol, "GeneratorFunction"); } - genFun.prototype = Object.create(Gp); return genFun; - }; // Within the body of any async function, `await x` is transformed to + }; + + // Within the body of any async function, `await x` is transformed to // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test // `hasOwn.call(value, "__await")` to determine if the yielded value is // meant to be awaited. - - exports.awrap = function (arg) { return { __await: arg }; }; - function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); - if (record.type === "throw") { reject(record.arg); } else { var result = record.arg; var value = result.value; - if (value && typeof value === "object" && hasOwn.call(value, "__await")) { return PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); @@ -20273,7 +18002,6 @@ var runtime = function (exports) { invoke("throw", err, resolve, reject); }); } - return PromiseImpl.resolve(value).then(function (unwrapped) { // When a yielded Promise is resolved, its final value becomes // the .value of the Promise<{value,done}> result for the @@ -20287,17 +18015,15 @@ var runtime = function (exports) { }); } } - var previousPromise; - function enqueue(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } - - return previousPromise = // If enqueue has been called before, then we want to wait until + return previousPromise = + // If enqueue has been called before, then we want to wait until // all previous Promises have been resolved before calling invoke, // so that results are always delivered in the correct order. If // enqueue has not been called before, then it is important to @@ -20309,24 +18035,27 @@ var runtime = function (exports) { // execute code before the first await. Since we implement simple // async functions in terms of async generators, it is especially // important to get this right, even though it requires care. - previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later + previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later // invocations of the iterator. callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); - } // Define the unified helper method that is used to implement .next, + } + + // Define the unified helper method that is used to implement .next, // .throw, and .return (see defineIteratorMethods). - - - this._invoke = enqueue; + defineProperty(this, "_invoke", { + value: enqueue + }); } - defineIteratorMethods(AsyncIterator.prototype); define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }); - exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of + exports.AsyncIterator = AsyncIterator; + + // Note that simple async functions are implemented on top of // AsyncIterator objects; they just return a Promise for the value of // the final result produced by the iterator. - exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { if (PromiseImpl === void 0) PromiseImpl = Promise; var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); @@ -20335,39 +18064,32 @@ var runtime = function (exports) { return result.done ? result.value : iter.next(); }); }; - function makeInvokeMethod(innerFn, self, context) { var state = GenStateSuspendedStart; return function invoke(method, arg) { if (state === GenStateExecuting) { throw new Error("Generator is already running"); } - if (state === GenStateCompleted) { if (method === "throw") { throw arg; - } // Be forgiving, per 25.3.3.3.3 of the spec: + } + + // Be forgiving, per 25.3.3.3.3 of the spec: // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume - - return doneResult(); } - context.method = method; context.arg = arg; - while (true) { var delegate = context.delegate; - if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); - if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } - if (context.method === "next") { // Setting context._sent for legacy support of Babel's // function.sent implementation. @@ -20377,104 +18099,94 @@ var runtime = function (exports) { state = GenStateCompleted; throw context.arg; } - context.dispatchException(context.arg); } else if (context.method === "return") { context.abrupt("return", context.arg); } - state = GenStateExecuting; var record = tryCatch(innerFn, self, context); - if (record.type === "normal") { // If an exception is thrown from innerFn, we leave state === // GenStateExecuting and loop back for another invocation. state = context.done ? GenStateCompleted : GenStateSuspendedYield; - if (record.arg === ContinueSentinel) { continue; } - return { value: record.arg, done: context.done }; } else if (record.type === "throw") { - state = GenStateCompleted; // Dispatch the exception by looping back around to the + state = GenStateCompleted; + // Dispatch the exception by looping back around to the // context.dispatchException(context.arg) call above. - context.method = "throw"; context.arg = record.arg; } } }; - } // Call delegate.iterator[context.method](context.arg) and handle the + } + + // Call delegate.iterator[context.method](context.arg) and handle the // result, either by returning a { value, done } result from the // delegate iterator, or by modifying context.method and context.arg, // setting context.delegate to null, and returning the ContinueSentinel. - - function maybeInvokeDelegate(delegate, context) { - var method = delegate.iterator[context.method]; - + var methodName = context.method; + var method = delegate.iterator[methodName]; if (method === undefined) { // A .throw or .return when the delegate iterator has no .throw - // method always terminates the yield* loop. + // method, or a missing .next mehtod, always terminate the + // yield* loop. context.delegate = null; - if (context.method === "throw") { - // Note: ["return"] must be used for ES3 parsing compatibility. - if (delegate.iterator["return"]) { - // If the delegate iterator has a return method, give it a - // chance to clean up. - context.method = "return"; - context.arg = undefined; - maybeInvokeDelegate(delegate, context); - - if (context.method === "throw") { - // If maybeInvokeDelegate(context) changed context.method from - // "return" to "throw", let that override the TypeError below. - return ContinueSentinel; - } + // Note: ["return"] must be used for ES3 parsing compatibility. + if (methodName === "throw" && delegate.iterator["return"]) { + // If the delegate iterator has a return method, give it a + // chance to clean up. + context.method = "return"; + context.arg = undefined; + maybeInvokeDelegate(delegate, context); + if (context.method === "throw") { + // If maybeInvokeDelegate(context) changed context.method from + // "return" to "throw", let that override the TypeError below. + return ContinueSentinel; } - - context.method = "throw"; - context.arg = new TypeError("The iterator does not provide a 'throw' method"); } - + if (methodName !== "return") { + context.method = "throw"; + context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method"); + } return ContinueSentinel; } - var record = tryCatch(method, delegate.iterator, context.arg); - if (record.type === "throw") { context.method = "throw"; context.arg = record.arg; context.delegate = null; return ContinueSentinel; } - var info = record.arg; - if (!info) { context.method = "throw"; context.arg = new TypeError("iterator result is not an object"); context.delegate = null; return ContinueSentinel; } - if (info.done) { // Assign the result of the finished delegate to the temporary // variable specified by delegate.resultName (see delegateYield). - context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield). + context[delegate.resultName] = info.value; - context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the + // Resume execution at the desired location (see delegateYield). + context.next = delegate.nextLoc; + + // If context.method was "throw" but the delegate handled the // exception, let the outer generator proceed normally. If // context.method was "next", forget context.arg since it has been // "consumed" by the delegate iterator. If context.method was // "return", allow the original .return call to continue in the // outer generator. - if (context.method !== "return") { context.method = "next"; context.arg = undefined; @@ -20482,54 +18194,49 @@ var runtime = function (exports) { } else { // Re-yield the result returned by the delegate method. return info; - } // The delegate iterator is finished, so forget it and continue with + } + + // The delegate iterator is finished, so forget it and continue with // the outer generator. - - context.delegate = null; return ContinueSentinel; - } // Define Generator.prototype.{next,throw,return} in terms of the + } + + // Define Generator.prototype.{next,throw,return} in terms of the // unified ._invoke helper method. - - defineIteratorMethods(Gp); - define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the + define(Gp, toStringTagSymbol, "Generator"); + + // A Generator should always return itself as the iterator object when the // @@iterator function is called on it. Some browsers' implementations of the // iterator prototype chain incorrectly implement this, causing the Generator // object to not be returned from this call. This ensures that doesn't happen. // See https://github.com/facebook/regenerator/issues/274 for more details. - define(Gp, iteratorSymbol, function () { return this; }); define(Gp, "toString", function () { return "[object Generator]"; }); - function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; - if (1 in locs) { entry.catchLoc = locs[1]; } - if (2 in locs) { entry.finallyLoc = locs[2]; entry.afterLoc = locs[3]; } - this.tryEntries.push(entry); } - function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal"; delete record.arg; entry.completion = record; } - function Context(tryLocsList) { // The root entry object (effectively a try statement without a catch // or a finally block) gives us a place to store values thrown from @@ -20540,97 +18247,85 @@ var runtime = function (exports) { tryLocsList.forEach(pushTryEntry, this); this.reset(true); } - - exports.keys = function (object) { + exports.keys = function (val) { + var object = Object(val); var keys = []; - for (var key in object) { keys.push(key); } + keys.reverse(); - keys.reverse(); // Rather than returning an object with a next method, we keep + // Rather than returning an object with a next method, we keep // things simple and return the next function itself. - return function next() { while (keys.length) { var key = keys.pop(); - if (key in object) { next.value = key; next.done = false; return next; } - } // To avoid creating an additional object, we just hang the .value + } + + // To avoid creating an additional object, we just hang the .value // and .done properties off the next function object itself. This // also ensures that the minifier will not anonymize the function. - - next.done = true; return next; }; }; - function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; - if (iteratorMethod) { return iteratorMethod.call(iterable); } - if (typeof iterable.next === "function") { return iterable; } - if (!isNaN(iterable.length)) { var i = -1, - next = function next() { - while (++i < iterable.length) { - if (hasOwn.call(iterable, i)) { - next.value = iterable[i]; - next.done = false; - return next; + next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } } - } - - next.value = undefined; - next.done = true; - return next; - }; - + next.value = undefined; + next.done = true; + return next; + }; return next.next = next; } - } // Return an iterator with no values. - + } + // Return an iterator with no values. return { next: doneResult }; } - exports.values = values; - function doneResult() { return { value: undefined, done: true }; } - Context.prototype = { constructor: Context, reset: function (skipTempReset) { this.prev = 0; - this.next = 0; // Resetting context._sent for legacy support of Babel's + this.next = 0; + // Resetting context._sent for legacy support of Babel's // function.sent implementation. - this.sent = this._sent = undefined; this.done = false; this.delegate = null; this.method = "next"; this.arg = undefined; this.tryEntries.forEach(resetTryEntry); - if (!skipTempReset) { for (var name in this) { // Not sure about the optimal order of these conditions: @@ -20644,50 +18339,40 @@ var runtime = function (exports) { this.done = true; var rootEntry = this.tryEntries[0]; var rootRecord = rootEntry.completion; - if (rootRecord.type === "throw") { throw rootRecord.arg; } - return this.rval; }, dispatchException: function (exception) { if (this.done) { throw exception; } - var context = this; - function handle(loc, caught) { record.type = "throw"; record.arg = exception; context.next = loc; - if (caught) { // If the dispatched exception was caught by a catch block, // then let that catch block handle the exception normally. context.method = "next"; context.arg = undefined; } - return !!caught; } - for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; var record = entry.completion; - if (entry.tryLoc === "root") { // Exception thrown outside of any try block that could handle // it, so set the completion value of the entire function to // throw the exception. return handle("end"); } - if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"); var hasFinally = hasOwn.call(entry, "finallyLoc"); - if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); @@ -20711,36 +18396,30 @@ var runtime = function (exports) { abrupt: function (type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; - if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } - if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { // Ignore the finally entry if control is not jumping to a // location outside the try/catch block. finallyEntry = null; } - var record = finallyEntry ? finallyEntry.completion : {}; record.type = type; record.arg = arg; - if (finallyEntry) { this.method = "next"; this.next = finallyEntry.finallyLoc; return ContinueSentinel; } - return this.complete(record); }, complete: function (record, afterLoc) { if (record.type === "throw") { throw record.arg; } - if (record.type === "break" || record.type === "continue") { this.next = record.arg; } else if (record.type === "return") { @@ -20750,13 +18429,11 @@ var runtime = function (exports) { } else if (record.type === "normal" && afterLoc) { this.next = afterLoc; } - return ContinueSentinel; }, finish: function (finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; - if (entry.finallyLoc === finallyLoc) { this.complete(entry.completion, entry.afterLoc); resetTryEntry(entry); @@ -20767,21 +18444,18 @@ var runtime = function (exports) { "catch": function (tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; - if (entry.tryLoc === tryLoc) { var record = entry.completion; - if (record.type === "throw") { var thrown = record.arg; resetTryEntry(entry); } - return thrown; } - } // The context.catch method must only be called with a location + } + + // The context.catch method must only be called with a location // argument that corresponds to a known catch block. - - throw new Error("illegal catch attempt"); }, delegateYield: function (iterable, resultName, nextLoc) { @@ -20790,27 +18464,26 @@ var runtime = function (exports) { resultName: resultName, nextLoc: nextLoc }; - if (this.method === "next") { // Deliberately forget the last sent value so that we don't // accidentally pass it on to the delegate. this.arg = undefined; } - return ContinueSentinel; } - }; // Regardless of whether this script is executing as a CommonJS module + }; + + // Regardless of whether this script is executing as a CommonJS module // or not, return the runtime object so that we can declare the variable // regeneratorRuntime in the outer scope, which allows this module to be // injected easily by `bin/regenerator --include-runtime script.js`. - return exports; -}( // If this script is executing as a CommonJS module, use module.exports +}( +// If this script is executing as a CommonJS module, use module.exports // as the regeneratorRuntime namespace. Otherwise create a new empty // object. Either way, the resulting object will be used to initialize // the regeneratorRuntime variable at the top of this file. true ? module.exports : 0); - try { regeneratorRuntime = runtime; } catch (accidentalStrictMode) { @@ -20832,7 +18505,7 @@ try { } /***/ }), -/* 500 */ +/* 522 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -20841,49 +18514,50 @@ try { * @author Gyandeep Singh * @author aladdin-add */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - -const path = __webpack_require__(501), - eslintScope = __webpack_require__(502), - evk = __webpack_require__(507), - espree = __webpack_require__(508), - merge = __webpack_require__(512), - pkg = __webpack_require__(513), - astUtils = __webpack_require__(514), - { - Legacy: { - ConfigOps, - ConfigValidator, - environments: BuiltInEnvironments - } -} = __webpack_require__(515), - Traverser = __webpack_require__(565), - { - SourceCode -} = __webpack_require__(569), - CodePathAnalyzer = __webpack_require__(587), - applyDisableDirectives = __webpack_require__(594), - ConfigCommentParser = __webpack_require__(596), - NodeEventGenerator = __webpack_require__(609), - createReportTranslator = __webpack_require__(611), - Rules = __webpack_require__(614), - createEmitter = __webpack_require__(946), - SourceCodeFixer = __webpack_require__(947), - timing = __webpack_require__(948), - ruleReplacements = __webpack_require__(949); - +const path = __webpack_require__(523), + eslintScope = __webpack_require__(524), + evk = __webpack_require__(529), + espree = __webpack_require__(530), + merge = __webpack_require__(534), + pkg = __webpack_require__(535), + astUtils = __webpack_require__(536), + { + directivesPattern + } = __webpack_require__(537), + { + Legacy: { + ConfigOps, + ConfigValidator, + environments: BuiltInEnvironments + } + } = __webpack_require__(538), + Traverser = __webpack_require__(588), + { + SourceCode + } = __webpack_require__(592), + CodePathAnalyzer = __webpack_require__(608), + applyDisableDirectives = __webpack_require__(615), + ConfigCommentParser = __webpack_require__(617), + NodeEventGenerator = __webpack_require__(630), + createReportTranslator = __webpack_require__(632), + Rules = __webpack_require__(635), + createEmitter = __webpack_require__(956), + SourceCodeFixer = __webpack_require__(957), + timing = __webpack_require__(958), + ruleReplacements = __webpack_require__(959); const { getRuleFromConfig -} = __webpack_require__(950); - +} = __webpack_require__(960); const { FlatConfigArray -} = __webpack_require__(951); - -const debug = __webpack_require__(566)("eslint:linter"); - +} = __webpack_require__(961); +const debug = __webpack_require__(589)("eslint:linter"); const MAX_AUTOFIX_PASSES = 10; const DEFAULT_PARSER_NAME = "espree"; const DEFAULT_ECMA_VERSION = 5; @@ -20899,40 +18573,29 @@ const DEFAULT_ERROR_LOC = { } }; const parserSymbol = Symbol.for("eslint.RuleTester.parser"); +const globals = __webpack_require__(979); -const globals = __webpack_require__(968); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // 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").SuppressedLintMessage} SuppressedLintMessage */ - /** @typedef {import("../shared/types").ParserOptions} ParserOptions */ - /** @typedef {import("../shared/types").LanguageOptions} LanguageOptions */ - /** @typedef {import("../shared/types").Processor} Processor */ - /** @typedef {import("../shared/types").Rule} Rule */ /* eslint-disable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */ - /** * @template T * @typedef {{ [P in keyof T]-?: T[P] }} Required */ - /* eslint-enable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */ /** @@ -20991,6 +18654,7 @@ const globals = __webpack_require__(968); //------------------------------------ * @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 //------------------------------------------------------------------------------ @@ -21000,34 +18664,29 @@ const globals = __webpack_require__(968); //------------------------------------ * @param {Object} parser The parser to check. * @returns {boolean} True if the parser is Espree or false if not. */ - - function isEspree(parser) { return !!(parser === espree || parser[parserSymbol] === espree); } + /** * Retrieves globals for the given ecmaVersion. * @param {number} ecmaVersion The version to retrieve globals for. * @returns {Object} The globals for the given ecmaVersion. */ - - function getGlobalsForEcmaVersion(ecmaVersion) { switch (ecmaVersion) { case 3: return globals.es3; - case 5: return globals.es5; - default: if (ecmaVersion < 2015) { return globals[`es${ecmaVersion + 2009}`]; } - return globals[`es${ecmaVersion}`]; } } + /** * Ensures that variables representing built-in properties of the Global Object, * and any globals declared by special block comments, are present in the global @@ -21037,14 +18696,11 @@ function getGlobalsForEcmaVersion(ecmaVersion) { * @param {{exportedVariables: Object, enabledGlobals: Object}} commentDirectives Directives from comment configuration * @returns {void} */ - - function addDeclaredGlobals(globalScope, configGlobals, _ref) { let { exportedVariables, enabledGlobals } = _ref; - // Define configured global variables. for (const id of new Set([...Object.keys(configGlobals), ...Object.keys(enabledGlobals)])) { /* @@ -21055,43 +18711,38 @@ function addDeclaredGlobals(globalScope, configGlobals, _ref) { 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 - + } + // mark all exported variables as such Object.keys(exportedVariables).forEach(name => { const variable = globalScope.set.get(name); - if (variable) { variable.eslintUsed = true; + variable.eslintExported = 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. @@ -21101,21 +18752,20 @@ function addDeclaredGlobals(globalScope, configGlobals, _ref) { 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 @@ -21126,8 +18776,6 @@ function createMissingRuleMessage(ruleId) { * @returns {LintMessage} created problem, returns a missing-rule problem if only provided ruleId. * @private */ - - function createLintingProblem(options) { const { ruleId = null, @@ -21146,6 +18794,7 @@ function createLintingProblem(options) { nodeType: null }; } + /** * Creates a collection of disable directives from a comment * @param {Object} options to create disable directives @@ -21157,8 +18806,6 @@ function createLintingProblem(options) { * @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 { commentToken, @@ -21173,13 +18820,12 @@ function createDisableDirectives(options) { directives: [], // valid disable directives directiveProblems: [] // problems in directives - }; + const parentComment = { commentToken, ruleIds }; - for (const ruleId of directiveRules) { // push to directives, if the rule is defined(including null, e.g. /*eslint enable*/) if (ruleId === null || !!ruleMapper(ruleId)) { @@ -21209,26 +18855,22 @@ function createDisableDirectives(options) { })); } } - return result; } + /** * Extract the directive and the justification from a given directive comment and trim them. * @param {string} value The comment text to extract. * @returns {{directivePart: string, justificationPart: string}} The extracted directive and justification. */ - - function extractDirectiveComment(value) { const match = /\s-{2,}\s/u.exec(value); - if (!match) { return { directivePart: value.trim(), justificationPart: "" }; } - const directive = value.slice(0, match.index).trim(); const justification = value.slice(match.index + match[0].length).trim(); return { @@ -21236,6 +18878,7 @@ function extractDirectiveComment(value) { justificationPart: justification }; } + /** * Parses comments in file to extract file-specific config of rules, globals * and environments and merges them with global config; also code blocks @@ -21243,11 +18886,9 @@ function extractDirectiveComment(value) { * @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[]}} + * @returns {{configuredRules: Object, enabledGlobals: {value:string,comment:Token}[], exportedVariables: Object, problems: LintMessage[], disableDirectives: DisableDirective[]}} * A collection of the directive comments that were found, along with any problems that occurred when parsing */ - - function getDirectiveComments(ast, ruleMapper, warnInlineConfig) { const configuredRules = {}; const enabledGlobals = Object.create(null); @@ -21262,19 +18903,15 @@ function getDirectiveComments(ast, ruleMapper, warnInlineConfig) { directivePart, justificationPart } = extractDirectiveComment(comment.value); - const match = /^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u.exec(directivePart); - + const match = directivesPattern.exec(directivePart); 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({ @@ -21285,7 +18922,6 @@ function getDirectiveComments(ast, ruleMapper, warnInlineConfig) { })); return; } - if (directiveText === "eslint-disable-line" && comment.loc.start.line !== comment.loc.end.line) { const message = `${directiveText} comment should not span multiple lines.`; problems.push(createLintingProblem({ @@ -21295,9 +18931,7 @@ function getDirectiveComments(ast, ruleMapper, warnInlineConfig) { })); return; } - const directiveValue = directivePart.slice(match.index + directiveText.length); - switch (directiveText) { case "eslint-disable": case "eslint-enable": @@ -21320,18 +18954,15 @@ function getDirectiveComments(ast, ruleMapper, warnInlineConfig) { 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) { @@ -21342,7 +18973,6 @@ function getDirectiveComments(ast, ruleMapper, warnInlineConfig) { })); continue; } - if (enabledGlobals[id]) { enabledGlobals[id].comments.push(comment); enabledGlobals[id].value = normalizedValue; @@ -21353,18 +18983,14 @@ function getDirectiveComments(ast, ruleMapper, warnInlineConfig) { }; } } - 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) { problems.push(createLintingProblem({ ruleId: name, @@ -21372,7 +18998,6 @@ function getDirectiveComments(ast, ruleMapper, warnInlineConfig) { })); return; } - try { validator.validateRuleOptions(rule, name, ruleValue); } catch (err) { @@ -21380,22 +19005,23 @@ function getDirectiveComments(ast, ruleMapper, warnInlineConfig) { ruleId: name, message: err.message, loc: comment.loc - })); // do not apply the config, if found invalid options. + })); + // do not apply the config, if found invalid options. return; } - configuredRules[name] = ruleValue; }); } else { problems.push(parseResult.error); } - break; } + // no default } }); + return { configuredRules, enabledGlobals, @@ -21404,87 +19030,79 @@ function getDirectiveComments(ast, ruleMapper, warnInlineConfig) { disableDirectives }; } + /** * Normalize ECMAScript version from the initial config * @param {Parser} parser The parser which uses this options. * @param {number} ecmaVersion ECMAScript version from the initial config * @returns {number} normalized ECMAScript version */ - - function normalizeEcmaVersion(parser, ecmaVersion) { if (isEspree(parser)) { if (ecmaVersion === "latest") { return espree.latestEcmaVersion; } } + /* * 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; } + /** * Normalize ECMAScript version from the initial config into languageOptions (year) * format. * @param {any} [ecmaVersion] ECMAScript version from the initial config * @returns {number} normalized ECMAScript version */ - - function normalizeEcmaVersionForLanguageOptions(ecmaVersion) { switch (ecmaVersion) { case 3: return 3; - // void 0 = no ecmaVersion specified so use the default + // void 0 = no ecmaVersion specified so use the default case 5: case void 0: return 5; - default: if (typeof ecmaVersion === "number") { return ecmaVersion >= 2015 ? ecmaVersion : ecmaVersion + 2009; } - } + /* * We default to the latest supported ecmaVersion for everything else. * Remember, this is for languageOptions.ecmaVersion, which sets the version * that is used for a number of processes inside of ESLint. It's normally * safe to assume people want the latest unless otherwise specified. */ - - return espree.latestEcmaVersion + 2009; } - const eslintEnvPattern = /\/\*\s*eslint-env\s(.+?)(?:\*\/|$)/gsu; + /** * 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) { if (match[0].endsWith("*/")) { retv = Object.assign(retv || {}, commentParser.parseListConfig(extractDirectiveComment(match[1]).directivePart)); } } - 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 + * But the linter should pass `` to `RuleContext#filename` 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., @@ -21492,13 +19110,12 @@ function findEslintEnv(text) { * @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. @@ -21506,24 +19123,20 @@ function normalizeFilename(filename) { * @param {ConfigData} config Config. * @returns {Required & InternalOptions} Normalized options */ - - function normalizeVerifyOptions(providedOptions, config) { - const linterOptions = config.linterOptions || config; // .noInlineConfig for eslintrc, .linterOptions.noInlineConfig for flat + const linterOptions = config.linterOptions || config; + // .noInlineConfig for eslintrc, .linterOptions.noInlineConfig for flat const disableInlineConfig = linterOptions.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 = linterOptions.reportUnusedDisableDirectives ? "warn" : "off"; } - return { filename: normalizeFilename(providedOptions.filename || ""), allowInlineConfig: !ignoreInlineConfig, @@ -21532,6 +19145,7 @@ function normalizeVerifyOptions(providedOptions, config) { disableFixes: Boolean(providedOptions.disableFixes) }; } + /** * Combines the provided parserOptions with the options from environments * @param {Parser} parser The parser which uses this options. @@ -21539,13 +19153,10 @@ function normalizeVerifyOptions(providedOptions, config) { * @param {Environment[]} enabledEnvironments The environments enabled in configuration and with inline comments * @returns {ParserOptions} Resulting parser options after merge */ - - function resolveParserOptions(parser, providedOptions, enabledEnvironments) { const parserOptionsFromEnv = enabledEnvironments.filter(env => env.parserOptions).reduce((parserOptions, env) => merge(parserOptions, env.parserOptions), {}); const mergedParserOptions = merge(parserOptionsFromEnv, providedOptions || {}); const isModule = mergedParserOptions.sourceType === "module"; - if (isModule) { /* * can't have global return inside of modules @@ -21555,10 +19166,10 @@ function resolveParserOptions(parser, providedOptions, enabledEnvironments) { globalReturn: false }); } - mergedParserOptions.ecmaVersion = normalizeEcmaVersion(parser, mergedParserOptions.ecmaVersion); return mergedParserOptions; } + /** * Converts parserOptions to languageOptions for backwards compatibility with eslintrc. * @param {ConfigData} config Config object. @@ -21567,8 +19178,6 @@ function resolveParserOptions(parser, providedOptions, enabledEnvironments) { * @param {ParserOptions} config.parserOptions The parserOptions to use. * @returns {LanguageOptions} The languageOptions equivalent. */ - - function createLanguageOptions(_ref2) { let { globals: configuredGlobals, @@ -21587,24 +19196,22 @@ function createLanguageOptions(_ref2) { parserOptions }; } + /** * 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. @@ -21614,23 +19221,21 @@ function stripUnicodeBOM(text) { 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. @@ -21638,8 +19243,6 @@ function getRuleOptions(ruleConfig) { * @param {Record} visitorKeys The visitor keys. * @returns {ScopeManager} The analysis result. */ - - function analyzeScope(ast, languageOptions, visitorKeys) { const parserOptions = languageOptions.parserOptions; const ecmaFeatures = parserOptions.ecmaFeatures || {}; @@ -21654,6 +19257,7 @@ function analyzeScope(ast, languageOptions, visitorKeys) { 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 @@ -21661,12 +19265,10 @@ function analyzeScope(ast, languageOptions, visitorKeys) { * @param {string} text The text to parse. * @param {LanguageOptions} languageOptions 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}} + * @returns {{success: false, error: LintMessage}|{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, languageOptions, filePath) { const textToParse = stripUnicodeBOM(text).replace(astUtils.shebangPattern, (match, captured) => `//${captured}`); const { @@ -21687,13 +19289,13 @@ function parse(text, languageOptions, filePath) { 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 { debug("Parsing:", filePath); const parseResult = typeof parser.parseForESLint === "function" ? parser.parseForESLint(textToParse, parserOptions) : { @@ -21708,7 +19310,6 @@ function parse(text, languageOptions, filePath) { debug("Scope analysis successful:", filePath); return { success: true, - /* * Save all values that `parseForESLint()` returned. * If a `SourceCode` object is given as the first parameter instead of source code text, @@ -21735,67 +19336,13 @@ function parse(text, languageOptions, filePath) { severity: 2, message, line: ex.lineNumber, - column: ex.column + column: ex.column, + nodeType: null } }; } } -/** - * 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 {LanguageOptions} languageOptions 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, languageOptions, name) { - const parserOptions = languageOptions.parserOptions; - const sourceType = languageOptions.sourceType; - const hasGlobalReturn = parserOptions.ecmaFeatures && parserOptions.ecmaFeatures.globalReturn || sourceType === "commonjs"; - const specialScope = hasGlobalReturn || 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 @@ -21803,8 +19350,6 @@ function markVariableAsUsed(scopeManager, currentNode, languageOptions, name) { * @throws {any} Any error during the rule's `create` * @returns {Object} A map of selector listeners provided by the rule */ - - function createRuleListeners(rule, ruleContext) { try { return rule.create(ruleContext); @@ -21813,25 +19358,8 @@ function createRuleListeners(rule, ruleContext) { 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 - +// methods that exist on SourceCode object const DEPRECATED_SOURCECODE_PASSTHROUGHS = { getSource: "getText", getSourceLines: "getLines", @@ -21856,10 +19384,10 @@ const DEPRECATED_SOURCECODE_PASSTHROUGHS = { }; const BASE_TRAVERSAL_CONTEXT = Object.freeze(Object.keys(DEPRECATED_SOURCECODE_PASSTHROUGHS).reduce((contextInfo, methodName) => Object.assign(contextInfo, { [methodName]() { - return this.getSourceCode()[DEPRECATED_SOURCECODE_PASSTHROUGHS[methodName]](...arguments); + return this.sourceCode[DEPRECATED_SOURCECODE_PASSTHROUGHS[methodName]](...arguments); } - }), {})); + /** * Runs the given rules on the given SourceCode object * @param {SourceCode} sourceCode A SourceCode object for the given text @@ -21872,9 +19400,8 @@ const BASE_TRAVERSAL_CONTEXT = Object.freeze(Object.keys(DEPRECATED_SOURCECODE_P * @param {boolean} disableFixes If true, it doesn't make `fix` properties. * @param {string | undefined} cwd cwd of the cli * @param {string} physicalFilename The full path of the file on disk without any code block information - * @returns {Problem[]} An array of reported problems + * @returns {LintMessage[]} An array of reported problems */ - function runRules(sourceCode, configuredRules, ruleMapper, parserName, languageOptions, settings, filename, disableFixes, cwd, physicalFilename) { const emitter = createEmitter(); const nodeQueue = []; @@ -21887,32 +19414,35 @@ function runRules(sourceCode, configuredRules, ruleMapper, parserName, languageO 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), + getAncestors: () => sourceCode.getAncestors(currentNode), + getDeclaredVariables: node => sourceCode.getDeclaredVariables(node), getCwd: () => cwd, + cwd, getFilename: () => filename, + filename, getPhysicalFilename: () => physicalFilename || filename, - getScope: () => getScope(sourceCode.scopeManager, currentNode), + physicalFilename: physicalFilename || filename, + getScope: () => sourceCode.getScope(currentNode), getSourceCode: () => sourceCode, - markVariableAsUsed: name => markVariableAsUsed(sourceCode.scopeManager, currentNode, languageOptions, name), - parserOptions: { ...languageOptions.parserOptions + sourceCode, + markVariableAsUsed: name => sourceCode.markVariableAsUsed(name, currentNode), + parserOptions: { + ...languageOptions.parserOptions }, parserPath: parserName, languageOptions, @@ -21921,27 +19451,24 @@ function runRules(sourceCode, configuredRules, ruleMapper, parserName, languageO })); const lintingProblems = []; Object.keys(configuredRules).forEach(ruleId => { - const severity = ConfigOps.getRuleSeverity(configuredRules[ruleId]); // not load disabled rules + const severity = ConfigOps.getRuleSeverity(configuredRules[ruleId]); + // not load disabled rules if (severity === 0) { return; } - const rule = ruleMapper(ruleId); - if (!rule) { 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() { /* * Create a report translator lazily. @@ -21962,33 +19489,27 @@ function runRules(sourceCode, configuredRules, ruleMapper, parserName, languageO disableFixes }); } - const problem = reportTranslator(...arguments); - if (problem.fix && !(rule.meta && rule.meta.fixable)) { throw new Error("Fixable rules must set the `meta.fixable` property to \"code\" or \"whitespace\"."); } - if (problem.suggestions && !(rule.meta && rule.meta.hasSuggestions === true)) { if (rule.meta && rule.meta.docs && typeof rule.meta.docs.suggestion !== "undefined") { // Encourage migration from the former property name. throw new Error("Rules with suggestions must set the `meta.hasSuggestions` property to `true`. `meta.docs.suggestion` is ignored by ESLint."); } - throw new Error("Rules with suggestions must set the `meta.hasSuggestions` property to `true`."); } - lintingProblems.push(problem); } - })); const ruleListeners = timing.enabled ? timing.time(ruleId, createRuleListeners)(rule, ruleContext) : createRuleListeners(rule, ruleContext); + /** * Include `ruleId` in error logs * @param {Function} ruleListener A rule method that listens for a node. * @returns {Function} ruleListener wrapped in error handler */ - function addRuleErrorHandler(ruleListener) { return function ruleErrorHandler() { try { @@ -21999,18 +19520,18 @@ function runRules(sourceCode, configuredRules, ruleMapper, parserName, languageO } }; } - if (typeof ruleListeners === "undefined" || ruleListeners === null) { throw new Error(`The create() function for rule '${ruleId}' did not return an object.`); - } // add all the selectors from the rule as listeners - + } + // add all the selectors from the rule as listeners Object.keys(ruleListeners).forEach(selector => { const ruleListener = timing.enabled ? timing.time(ruleId, ruleListeners[selector]) : ruleListeners[selector]; emitter.on(selector, addRuleErrorHandler(ruleListener)); }); - }); // only run code path analyzer if the top level node is "Program", skip otherwise + }); + // 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, { visitorKeys: sourceCode.visitorKeys, fallback: Traverser.getKeys @@ -22020,7 +19541,6 @@ function runRules(sourceCode, configuredRules, ruleMapper, parserName, languageO }); nodeQueue.forEach(traversalInfo => { currentNode = traversalInfo.node; - try { if (traversalInfo.isEntering) { eventGenerator.enterNode(currentNode); @@ -22034,13 +19554,12 @@ function runRules(sourceCode, configuredRules, ruleMapper, parserName, languageO }); 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 { @@ -22050,74 +19569,69 @@ function ensureText(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 + } + + // It's more explicit to assign the undefined // eslint-disable-next-line no-undefined -- Consistently returning a value - - return undefined; } + /** * The map to store private data. * @type {WeakMap} */ - - const internalSlotsMap = new WeakMap(); + /** * Throws an error when the given linter is in flat config mode. * @param {Linter} linter The linter to check. * @returns {void} * @throws {Error} If the linter is in flat config mode. */ - function assertEslintrcConfig(linter) { const { configType } = internalSlotsMap.get(linter); - if (configType === "flat") { throw new Error("This method cannot be used with flat config. Add your entries directly into the config array."); } -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ @@ -22125,8 +19639,6 @@ function assertEslintrcConfig(linter) { * Object that is responsible for verifying JavaScript text * @name Linter */ - - class Linter { /** * Initialize the Linter. @@ -22151,16 +19663,16 @@ class Linter { }); 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. @@ -22169,26 +19681,24 @@ class Linter { * @throws {Error} If during rule execution. * @returns {(LintMessage|SuppressedLintMessage)[]} 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 + let text; + // evaluate arguments if (typeof textOrSourceCode === "string") { slots.lastSourceCode = null; text = textOrSourceCode; } else { slots.lastSourceCode = textOrSourceCode; text = textOrSourceCode.text; - } // Resolve parser. - + } + // 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; @@ -22200,15 +19710,15 @@ class Linter { severity: 2, message: `Configured parser '${config.parser}' was not found.`, line: 0, - column: 0 + column: 0, + nodeType: null }]; } - parserName = config.parser; parser = slots.parserMap.get(config.parser); - } // search and apply "eslint-env *". - + } + // search and apply "eslint-env *". const envInFile = options.allowInlineConfig && !options.warnInlineConfig ? findEslintEnv(text) : {}; const resolvedEnvConfig = Object.assign({ builtin: true @@ -22222,14 +19732,11 @@ class Linter { parser, parserOptions }); - if (!slots.lastSourceCode) { const parseResult = parse(text, languageOptions, options.filename); - if (!parseResult.success) { return [parseResult.error]; } - slots.lastSourceCode = parseResult.sourceCode; } else { /* @@ -22246,7 +19753,6 @@ class Linter { }); } } - const sourceCode = slots.lastSourceCode; const commentDirectives = options.allowInlineConfig ? getDirectiveComments(sourceCode.ast, ruleId => getRule(slots, ruleId), options.warnInlineConfig) : { configuredRules: {}, @@ -22254,22 +19760,21 @@ class Linter { exportedVariables: {}, problems: [], disableDirectives: [] - }; // augment global scope with declared global variables + }; + // 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), parserName, languageOptions, settings, options.filename, options.disableFixes, slots.cwd, providedOptions.physicalFilename); } catch (err) { err.message += `\nOccurred while linting ${options.filename}`; debug("An error occurred while traversing"); debug("Filename:", options.filename); - if (err.currentNode) { const { line @@ -22277,18 +19782,14 @@ class Linter { debug("Line:", line); err.message += `:${line}`; } - debug("Parser Options:", parserOptions); debug("Parser Path:", parserName); debug("Settings:", settings); - if (err.ruleId) { err.message += `\nRule: "${err.ruleId}"`; } - throw err; } - return applyDisableDirectives({ directives: commentDirectives.disableDirectives, disableFixes: options.disableFixes, @@ -22296,6 +19797,7 @@ class Linter { 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. @@ -22305,8 +19807,6 @@ class Linter { * 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 { @@ -22315,7 +19815,6 @@ class Linter { const options = typeof filenameOrOptions === "string" ? { filename: filenameOrOptions } : filenameOrOptions || {}; - if (config) { if (configType === "flat") { /* @@ -22326,19 +19825,17 @@ class Linter { * `FlatConfigArray` if it has a `getConfig()` method. */ let configArray = config; - if (!Array.isArray(config) || typeof config.getConfig !== "function") { configArray = new FlatConfigArray(config); configArray.normalizeSync(); } - return this._distinguishSuppressedMessages(this._verifyWithFlatConfigArray(textOrSourceCode, configArray, options, true)); } - if (typeof config.extractConfig === "function") { return this._distinguishSuppressedMessages(this._verifyWithConfigArray(textOrSourceCode, config, options)); } } + /* * If we get to here, it means `config` is just an object rather * than a config array so we can go right into linting. @@ -22348,14 +19845,12 @@ class Linter { * `Linter` doesn't support `overrides` property in configuration. * So we cannot apply multiple processors. */ - - if (options.preprocess || options.postprocess) { return this._distinguishSuppressedMessages(this._verifyWithProcessor(textOrSourceCode, config, options)); } - return this._distinguishSuppressedMessages(this._verifyWithoutProcessors(textOrSourceCode, config, options)); } + /** * Verify with a processor. * @param {string|SourceCode} textOrSourceCode The source code. @@ -22364,23 +19859,16 @@ class Linter { * @param {FlatConfigArray} [configForRecursive] The `ConfigArray` object to apply multiple processors recursively. * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems. */ - - _verifyWithFlatConfigArrayAndProcessor(textOrSourceCode, config, options, configForRecursive) { const filename = options.filename || ""; const filenameToExpose = normalizeFilename(filename); const physicalFilename = options.physicalFilename || filenameToExpose; const text = ensureText(textOrSourceCode); - const preprocess = options.preprocess || (rawText => [rawText]); - const postprocess = options.postprocess || (messagesList => messagesList.flat()); - const filterCodeBlock = options.filterCodeBlock || (blockFilename => blockFilename.endsWith(".js")); - const originalExtname = path.extname(filename); let blocks; - try { blocks = preprocess(text, filenameToExpose); } catch (ex) { @@ -22393,42 +19881,46 @@ class Linter { severity: 2, message, line: ex.lineNumber, - column: ex.column + column: ex.column, + nodeType: null }]; } - const messageLists = blocks.map((block, i) => { - debug("A code block was found: %o", block.filename || "(unnamed)"); // Keep the legacy behavior. + debug("A code block was found: %o", block.filename || "(unnamed)"); + // Keep the legacy behavior. if (typeof block === "string") { return this._verifyWithFlatConfigArrayAndWithoutProcessors(block, config, options); } - const blockText = block.text; - const blockName = path.join(filename, `${i}_${block.filename}`); // Skip this block if filtered. + 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 content or extension was changed. - + } + // Resolve configuration again if the file content or extension was changed. if (configForRecursive && (text !== blockText || path.extname(blockName) !== originalExtname)) { debug("Resolving configuration again because the file content or extension was changed."); - return this._verifyWithFlatConfigArray(blockText, configForRecursive, { ...options, + return this._verifyWithFlatConfigArray(blockText, configForRecursive, { + ...options, filename: blockName, physicalFilename }); - } // Does lint. + } - - return this._verifyWithFlatConfigArrayAndWithoutProcessors(blockText, config, { ...options, + // Does lint. + return this._verifyWithFlatConfigArrayAndWithoutProcessors(blockText, config, { + ...options, filename: blockName, physicalFilename }); }); return postprocess(messageLists, filenameToExpose); } + /** * Same as linter.verify, except without support for processors. * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object. @@ -22437,14 +19929,13 @@ class Linter { * @throws {Error} If during rule execution. * @returns {(LintMessage|SuppressedLintMessage)[]} The results as an array of messages or an empty array if no messages. */ - - _verifyWithFlatConfigArrayAndWithoutProcessors(textOrSourceCode, providedConfig, providedOptions) { const slots = internalSlotsMap.get(this); const config = providedConfig || {}; const options = normalizeVerifyOptions(providedOptions, config); - let text; // evaluate arguments + let text; + // evaluate arguments if (typeof textOrSourceCode === "string") { slots.lastSourceCode = null; text = textOrSourceCode; @@ -22452,41 +19943,38 @@ class Linter { slots.lastSourceCode = textOrSourceCode; text = textOrSourceCode.text; } - const languageOptions = config.languageOptions; - languageOptions.ecmaVersion = normalizeEcmaVersionForLanguageOptions(languageOptions.ecmaVersion); // add configured globals and language globals + languageOptions.ecmaVersion = normalizeEcmaVersionForLanguageOptions(languageOptions.ecmaVersion); - const configuredGlobals = { ...getGlobalsForEcmaVersion(languageOptions.ecmaVersion), - ...(languageOptions.sourceType === "commonjs" ? globals.commonjs : void 0), - ...languageOptions.globals - }; // double check that there is a parser to avoid mysterious error messages + /* + * add configured globals and language globals + * + * using Object.assign instead of object spread for performance reasons + * https://github.com/eslint/eslint/issues/16302 + */ + const configuredGlobals = Object.assign({}, getGlobalsForEcmaVersion(languageOptions.ecmaVersion), languageOptions.sourceType === "commonjs" ? globals.commonjs : void 0, languageOptions.globals); + // double check that there is a parser to avoid mysterious error messages if (!languageOptions.parser) { throw new TypeError(`No parser specified for ${options.filename}`); - } // Espree expects this information to be passed in - + } + // Espree expects this information to be passed in if (isEspree(languageOptions.parser)) { const parserOptions = languageOptions.parserOptions; - if (languageOptions.sourceType) { parserOptions.sourceType = languageOptions.sourceType; - if (parserOptions.sourceType === "module" && parserOptions.ecmaFeatures && parserOptions.ecmaFeatures.globalReturn) { parserOptions.ecmaFeatures.globalReturn = false; } } } - const settings = config.settings || {}; - if (!slots.lastSourceCode) { const parseResult = parse(text, languageOptions, options.filename); - if (!parseResult.success) { return [parseResult.error]; } - slots.lastSourceCode = parseResult.sourceCode; } else { /* @@ -22503,7 +19991,6 @@ class Linter { }); } } - const sourceCode = slots.lastSourceCode; const commentDirectives = options.allowInlineConfig ? getDirectiveComments(sourceCode.ast, ruleId => getRuleFromConfig(ruleId, config), options.warnInlineConfig) : { configuredRules: {}, @@ -22511,22 +19998,21 @@ class Linter { exportedVariables: {}, problems: [], disableDirectives: [] - }; // augment global scope with declared global variables + }; + // 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 => getRuleFromConfig(ruleId, config), void 0, languageOptions, settings, options.filename, options.disableFixes, slots.cwd, providedOptions.physicalFilename); } catch (err) { err.message += `\nOccurred while linting ${options.filename}`; debug("An error occurred while traversing"); debug("Filename:", options.filename); - if (err.currentNode) { const { line @@ -22534,18 +20020,15 @@ class Linter { debug("Line:", line); err.message += `:${line}`; } + debug("Parser Options:", languageOptions.parserOptions); - debug("Parser Options:", languageOptions.parserOptions); // debug("Parser Path:", parserName); - + // debug("Parser Path:", parserName); debug("Settings:", settings); - if (err.ruleId) { err.message += `\nRule: "${err.ruleId}"`; } - throw err; } - return applyDisableDirectives({ directives: commentDirectives.disableDirectives, disableFixes: options.disableFixes, @@ -22553,6 +20036,7 @@ class Linter { reportUnusedDisableDirectives: options.reportUnusedDisableDirectives }); } + /** * Verify a given code with `ConfigArray`. * @param {string|SourceCode} textOrSourceCode The source code. @@ -22560,16 +20044,17 @@ class Linter { * @param {VerifyOptions&ProcessorOptions} options The options. * @returns {(LintMessage|SuppressedLintMessage)[]} 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. + debug("With ConfigArray: %s", options.filename); - internalSlotsMap.get(this).lastConfigArray = configArray; // Extract the final config for this file. + // 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. + const processor = config.processor && configArray.pluginProcessors.get(config.processor); + // Verify. if (processor) { debug("Apply the processor: %o", config.processor); const { @@ -22578,15 +20063,16 @@ class Linter { supportsAutofix } = processor; const disableFixes = options.disableFixes || !supportsAutofix; - return this._verifyWithProcessor(textOrSourceCode, config, { ...options, + return this._verifyWithProcessor(textOrSourceCode, config, { + ...options, disableFixes, postprocess, preprocess }, configArray); } - return this._verifyWithoutProcessors(textOrSourceCode, config, options); } + /** * Verify a given code with a flat config. * @param {string|SourceCode} textOrSourceCode The source code. @@ -22596,28 +20082,28 @@ class Linter { * from verify(). (TODO: Remove once eslintrc is removed.) * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems. */ - - _verifyWithFlatConfigArray(textOrSourceCode, configArray, options) { let firstCall = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; - debug("With flat config: %s", options.filename); // we need a filename to match configs against + debug("With flat config: %s", options.filename); - const filename = options.filename || "__placeholder__.js"; // Store the config array in order to get plugin envs and rules later. + // we need a filename to match configs against + const filename = options.filename || "__placeholder__.js"; + // Store the config array in order to get plugin envs and rules later. internalSlotsMap.get(this).lastConfigArray = configArray; const config = configArray.getConfig(filename); - if (!config) { return [{ ruleId: null, severity: 1, message: `No matching configuration found for ${filename}.`, line: 0, - column: 0 + column: 0, + nodeType: null }]; - } // Verify. - + } + // Verify. if (config.processor) { debug("Apply the processor: %o", config.processor); const { @@ -22626,21 +20112,22 @@ class Linter { supportsAutofix } = config.processor; const disableFixes = options.disableFixes || !supportsAutofix; - return this._verifyWithFlatConfigArrayAndProcessor(textOrSourceCode, config, { ...options, + return this._verifyWithFlatConfigArrayAndProcessor(textOrSourceCode, config, { + ...options, filename, disableFixes, postprocess, preprocess }, configArray); - } // check for options-based processing - + } + // check for options-based processing if (firstCall && (options.preprocess || options.postprocess)) { return this._verifyWithFlatConfigArrayAndProcessor(textOrSourceCode, config, options); } - return this._verifyWithFlatConfigArrayAndWithoutProcessors(textOrSourceCode, config, options); } + /** * Verify with a processor. * @param {string|SourceCode} textOrSourceCode The source code. @@ -22649,23 +20136,16 @@ class Linter { * @param {ConfigArray} [configForRecursive] The `ConfigArray` object to apply multiple processors recursively. * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems. */ - - _verifyWithProcessor(textOrSourceCode, config, options, configForRecursive) { const filename = options.filename || ""; const filenameToExpose = normalizeFilename(filename); const physicalFilename = options.physicalFilename || filenameToExpose; const text = ensureText(textOrSourceCode); - const preprocess = options.preprocess || (rawText => [rawText]); - const postprocess = options.postprocess || (messagesList => messagesList.flat()); - const filterCodeBlock = options.filterCodeBlock || (blockFilename => blockFilename.endsWith(".js")); - const originalExtname = path.extname(filename); let blocks; - try { blocks = preprocess(text, filenameToExpose); } catch (ex) { @@ -22678,55 +20158,56 @@ class Linter { severity: 2, message, line: ex.lineNumber, - column: ex.column + column: ex.column, + nodeType: null }]; } - const messageLists = blocks.map((block, i) => { - debug("A code block was found: %o", block.filename || "(unnamed)"); // Keep the legacy behavior. + 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. + 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 content or extension was changed. - + } + // Resolve configuration again if the file content or extension was changed. if (configForRecursive && (text !== blockText || path.extname(blockName) !== originalExtname)) { debug("Resolving configuration again because the file content or extension was changed."); - return this._verifyWithConfigArray(blockText, configForRecursive, { ...options, + return this._verifyWithConfigArray(blockText, configForRecursive, { + ...options, filename: blockName, physicalFilename }); - } // Does lint. + } - - return this._verifyWithoutProcessors(blockText, config, { ...options, + // Does lint. + return this._verifyWithoutProcessors(blockText, config, { + ...options, filename: blockName, physicalFilename }); }); return postprocess(messageLists, filenameToExpose); } + /** * Given a list of reported problems, distinguish problems between normal messages and suppressed messages. * The normal messages will be returned and the suppressed messages will be stored as lastSuppressedMessages. - * @param {Problem[]} problems A list of reported problems. + * @param {Array} problems A list of reported problems. * @returns {LintMessage[]} A list of LintMessage. */ - - _distinguishSuppressedMessages(problems) { const messages = []; const suppressedMessages = []; const slots = internalSlotsMap.get(this); - for (const problem of problems) { if (problem.suppressions) { suppressedMessages.push(problem); @@ -22734,59 +20215,53 @@ class Linter { messages.push(problem); } } - slots.lastSuppressedMessages = suppressedMessages; return messages; } + /** * Gets the SourceCode object representing the parsed source. * @returns {SourceCode} The SourceCode object. */ - - getSourceCode() { return internalSlotsMap.get(this).lastSourceCode; } + /** * Gets the list of SuppressedLintMessage produced in the last running. * @returns {SuppressedLintMessage[]} The list of SuppressedLintMessage */ - - getSuppressedMessages() { return internalSlotsMap.get(this).lastSuppressedMessages; } + /** * 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) { assertEslintrcConfig(this); 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) { assertEslintrcConfig(this); Object.getOwnPropertyNames(rulesToDefine).forEach(ruleId => { this.defineRule(ruleId, rulesToDefine[ruleId]); }); } + /** * Gets an object with all loaded rules. * @returns {Map} All loaded rules */ - - getRules() { assertEslintrcConfig(this); const { @@ -22795,24 +20270,23 @@ class Linter { } = 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) { assertEslintrcConfig(this); internalSlotsMap.get(this).parserMap.set(parserId, parserModule); } + /** * Performs multiple autofix passes over the text until as many fixes as possible * have been applied. @@ -22822,16 +20296,15 @@ class Linter { * @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; + 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: * @@ -22841,48 +20314,44 @@ class Linter { * 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 + } + // keep track if any fixes were ever applied - important for return value + fixed = fixed || fixedResult.fixed; - fixed = fixed || fixedResult.fixed; // update to use the fixed output instead of the original text - + // 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 - + } + // 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. @@ -22891,18 +20360,17 @@ module.exports = { getLinterInternalSlots(instance) { return internalSlotsMap.get(instance); } - }; /***/ }), -/* 501 */ +/* 523 */ /***/ ((module) => { "use strict"; module.exports = require("path"); /***/ }), -/* 502 */ +/* 524 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -22910,9 +20378,9 @@ module.exports = require("path"); Object.defineProperty(exports, "__esModule", ({ value: true })); -var assert = __webpack_require__(503); -var estraverse = __webpack_require__(504); -var esrecurse = __webpack_require__(505); +var assert = __webpack_require__(525); +var estraverse = __webpack_require__(526); +var esrecurse = __webpack_require__(527); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } @@ -24046,7 +21514,7 @@ class ScopeManager { return this.__options.ignoreEval; } - __isNodejsScope() { + isGlobalReturn() { return this.__options.nodejsScope || this.__options.sourceType === "commonjs"; } @@ -24780,7 +22248,7 @@ class Referencer extends esrecurse__default["default"].Visitor { Program(node) { this.scopeManager.__nestGlobalScope(node); - if (this.scopeManager.__isNodejsScope()) { + if (this.scopeManager.isGlobalReturn()) { // Force strictness of GlobalScope to false when using node.js scope. this.currentScope().isStrict = false; @@ -25022,7 +22490,7 @@ class Referencer extends esrecurse__default["default"].Visitor { /* vim: set sw=4 ts=4 et tw=80 : */ -const version = "7.1.1"; +const version = "7.2.0"; /* Copyright (C) 2012-2014 Yusuke Suzuki @@ -25149,14 +22617,14 @@ exports.version = version; /***/ }), -/* 503 */ +/* 525 */ /***/ ((module) => { "use strict"; module.exports = require("assert"); /***/ }), -/* 504 */ +/* 526 */ /***/ ((__unused_webpack_module, exports) => { /* @@ -25183,26 +22651,20 @@ module.exports = require("assert"); (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - /*jslint vars:false, bitwise:true*/ - /*jshint indent:4*/ - /*global exports:true*/ (function clone(exports) { 'use strict'; var Syntax, VisitorOption, VisitorKeys, BREAK, SKIP, REMOVE; - function deepCopy(obj) { var ret = {}, - key, - val; - + key, + val; for (key in obj) { if (obj.hasOwnProperty(key)) { val = obj[key]; - if (typeof val === 'object' && val !== null) { ret[key] = deepCopy(val); } else { @@ -25210,21 +22672,19 @@ module.exports = require("assert"); } } } - return ret; - } // based on LLVM libc++ upper_bound / lower_bound - // MIT License + } + // based on LLVM libc++ upper_bound / lower_bound + // MIT License function upperBound(array, func) { var diff, len, i, current; len = array.length; i = 0; - while (len) { diff = len >>> 1; current = i + diff; - if (func(array[current])) { len = diff; } else { @@ -25232,10 +22692,8 @@ module.exports = require("assert"); len -= diff + 1; } } - return i; } - Syntax = { AssignmentExpression: 'AssignmentExpression', AssignmentPattern: 'AssignmentPattern', @@ -25397,8 +22855,9 @@ module.exports = require("assert"); WhileStatement: ['test', 'body'], WithStatement: ['object', 'body'], YieldExpression: ['argument'] - }; // unique id + }; + // unique id BREAK = {}; SKIP = {}; REMOVE = {}; @@ -25407,16 +22866,13 @@ module.exports = require("assert"); Skip: SKIP, Remove: REMOVE }; - function Reference(parent, key) { this.parent = parent; this.key = key; } - Reference.prototype.replace = function replace(node) { this.parent[this.key] = node; }; - Reference.prototype.remove = function remove() { if (Array.isArray(this.parent)) { this.parent.splice(this.key, 1); @@ -25426,21 +22882,18 @@ module.exports = require("assert"); return false; } }; - function Element(node, path, wrap, ref) { this.node = node; this.path = path; this.wrap = wrap; this.ref = ref; } + function Controller() {} - function Controller() {} // API: + // API: // return property path array from root to current node - - Controller.prototype.path = function path() { var i, iz, j, jz, result, element; - function addToPath(result, path) { if (Array.isArray(path)) { for (j = 0, jz = path.length; j < jz; ++j) { @@ -25449,91 +22902,84 @@ module.exports = require("assert"); } else { result.push(path); } - } // root node - + } + // root node if (!this.__current.path) { return null; - } // first node is sentinel, second node is root element - + } + // first node is sentinel, second node is root element result = []; - for (i = 2, iz = this.__leavelist.length; i < iz; ++i) { element = this.__leavelist[i]; addToPath(result, element.path); } - addToPath(result, this.__current.path); return result; - }; // API: + }; + + // API: // return type of current node - - Controller.prototype.type = function () { var node = this.current(); return node.type || this.__current.wrap; - }; // API: + }; + + // API: // return array of parent elements - - Controller.prototype.parents = function parents() { - var i, iz, result; // first node is sentinel + var i, iz, result; + // first node is sentinel result = []; - for (i = 1, iz = this.__leavelist.length; i < iz; ++i) { result.push(this.__leavelist[i].node); } - return result; - }; // API: + }; + + // API: // return current node - - Controller.prototype.current = function current() { return this.__current.node; }; - Controller.prototype.__execute = function __execute(callback, element) { var previous, result; result = undefined; previous = this.__current; this.__current = element; this.__state = null; - if (callback) { result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node); } - this.__current = previous; return result; - }; // API: + }; + + // API: // notify control skip / break - - Controller.prototype.notify = function notify(flag) { this.__state = flag; - }; // API: + }; + + // API: // skip child nodes of current node - - Controller.prototype.skip = function () { this.notify(SKIP); - }; // API: + }; + + // API: // break traversals - - Controller.prototype['break'] = function () { this.notify(BREAK); - }; // API: + }; + + // API: // remove node - - Controller.prototype.remove = function () { this.notify(REMOVE); }; - Controller.prototype.__initialize = function (root, visitor) { this.visitor = visitor; this.root = root; @@ -25542,87 +22988,68 @@ module.exports = require("assert"); this.__current = null; this.__state = null; this.__fallback = null; - if (visitor.fallback === 'iteration') { this.__fallback = Object.keys; } else if (typeof visitor.fallback === 'function') { this.__fallback = visitor.fallback; } - this.__keys = VisitorKeys; - if (visitor.keys) { this.__keys = Object.assign(Object.create(this.__keys), visitor.keys); } }; - function isNode(node) { if (node == null) { return false; } - return typeof node === 'object' && typeof node.type === 'string'; } - function isProperty(nodeType, key) { return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key; } - function candidateExistsInLeaveList(leavelist, candidate) { for (var i = leavelist.length - 1; i >= 0; --i) { if (leavelist[i].node === candidate) { return true; } } - return false; } - Controller.prototype.traverse = function traverse(root, visitor) { var worklist, leavelist, element, node, nodeType, ret, key, current, current2, candidates, candidate, sentinel; - this.__initialize(root, visitor); + sentinel = {}; - sentinel = {}; // reference - + // reference worklist = this.__worklist; - leavelist = this.__leavelist; // initialize + leavelist = this.__leavelist; + // initialize worklist.push(new Element(root, null, null, null)); leavelist.push(new Element(null, null, null, null)); - while (worklist.length) { element = worklist.pop(); - if (element === sentinel) { element = leavelist.pop(); ret = this.__execute(visitor.leave, element); - if (this.__state === BREAK || ret === BREAK) { return; } - continue; } - if (element.node) { ret = this.__execute(visitor.enter, element); - if (this.__state === BREAK || ret === BREAK) { return; } - worklist.push(sentinel); leavelist.push(element); - if (this.__state === SKIP || ret === SKIP) { continue; } - node = element.node; nodeType = node.type || element.wrap; candidates = this.__keys[nodeType]; - if (!candidates) { if (this.__fallback) { candidates = this.__fallback(node); @@ -25630,29 +23057,22 @@ module.exports = require("assert"); throw new Error('Unknown node type ' + nodeType + '.'); } } - current = candidates.length; - while ((current -= 1) >= 0) { key = candidates[current]; candidate = node[key]; - if (!candidate) { continue; } - if (Array.isArray(candidate)) { current2 = candidate.length; - while ((current2 -= 1) >= 0) { if (!candidate[current2]) { continue; } - if (candidateExistsInLeaveList(leavelist, candidate[current2])) { continue; } - if (isProperty(nodeType, candidates[current])) { element = new Element(candidate[current2], [key, current2], 'Property', null); } else if (isNode(candidate[current2])) { @@ -25660,121 +23080,103 @@ module.exports = require("assert"); } else { continue; } - worklist.push(element); } } else if (isNode(candidate)) { if (candidateExistsInLeaveList(leavelist, candidate)) { continue; } - worklist.push(new Element(candidate, key, null, null)); } } } } }; - Controller.prototype.replace = function replace(root, visitor) { var worklist, leavelist, node, nodeType, target, element, current, current2, candidates, candidate, sentinel, outer, key; - function removeElem(element) { var i, key, nextElem, parent; - if (element.ref.remove()) { // When the reference is an element of an array. key = element.ref.key; - parent = element.ref.parent; // If removed from array, then decrease following items' keys. + parent = element.ref.parent; + // If removed from array, then decrease following items' keys. i = worklist.length; - while (i--) { nextElem = worklist[i]; - if (nextElem.ref && nextElem.ref.parent === parent) { if (nextElem.ref.key < key) { break; } - --nextElem.ref.key; } } } } - this.__initialize(root, visitor); + sentinel = {}; - sentinel = {}; // reference - + // reference worklist = this.__worklist; - leavelist = this.__leavelist; // initialize + leavelist = this.__leavelist; + // initialize outer = { root: root }; element = new Element(root, null, null, new Reference(outer, 'root')); worklist.push(element); leavelist.push(element); - while (worklist.length) { element = worklist.pop(); - if (element === sentinel) { element = leavelist.pop(); - target = this.__execute(visitor.leave, element); // node may be replaced with null, - // so distinguish between undefined and null in this place + target = this.__execute(visitor.leave, element); + // node may be replaced with null, + // so distinguish between undefined and null in this place if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { // replace element.ref.replace(target); } - if (this.__state === REMOVE || target === REMOVE) { removeElem(element); } - if (this.__state === BREAK || target === BREAK) { return outer.root; } - continue; } + target = this.__execute(visitor.enter, element); - target = this.__execute(visitor.enter, element); // node may be replaced with null, + // node may be replaced with null, // so distinguish between undefined and null in this place - if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) { // replace element.ref.replace(target); element.node = target; } - if (this.__state === REMOVE || target === REMOVE) { removeElem(element); element.node = null; } - if (this.__state === BREAK || target === BREAK) { return outer.root; - } // node may be null - + } + // node may be null node = element.node; - if (!node) { continue; } - worklist.push(sentinel); leavelist.push(element); - if (this.__state === SKIP || target === SKIP) { continue; } - nodeType = node.type || element.wrap; candidates = this.__keys[nodeType]; - if (!candidates) { if (this.__fallback) { candidates = this.__fallback(node); @@ -25782,25 +23184,19 @@ module.exports = require("assert"); throw new Error('Unknown node type ' + nodeType + '.'); } } - current = candidates.length; - while ((current -= 1) >= 0) { key = candidates[current]; candidate = node[key]; - if (!candidate) { continue; } - if (Array.isArray(candidate)) { current2 = candidate.length; - while ((current2 -= 1) >= 0) { if (!candidate[current2]) { continue; } - if (isProperty(nodeType, candidates[current])) { element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2)); } else if (isNode(candidate[current2])) { @@ -25808,7 +23204,6 @@ module.exports = require("assert"); } else { continue; } - worklist.push(element); } } else if (isNode(candidate)) { @@ -25816,53 +23211,43 @@ module.exports = require("assert"); } } } - return outer.root; }; - function traverse(root, visitor) { var controller = new Controller(); return controller.traverse(root, visitor); } - function replace(root, visitor) { var controller = new Controller(); return controller.replace(root, visitor); } - function extendCommentRange(comment, tokens) { var target; target = upperBound(tokens, function search(token) { return token.range[0] > comment.range[0]; }); comment.extendedRange = [comment.range[0], comment.range[1]]; - if (target !== tokens.length) { comment.extendedRange[1] = tokens[target].range[0]; } - target -= 1; - if (target >= 0) { comment.extendedRange[0] = tokens[target].range[1]; } - return comment; } - function attachComments(tree, providedComments, tokens) { // At first, we should calculate extended comment ranges. var comments = [], - comment, - len, - i, - cursor; - + comment, + len, + i, + cursor; if (!tree.range) { throw new Error('attachComments needs range information'); - } // tokens array is empty, we attach comments to tree as 'leadingComments' - + } + // tokens array is empty, we attach comments to tree as 'leadingComments' if (!tokens.length) { if (providedComments.length) { for (i = 0, len = providedComments.length; i < len; i += 1) { @@ -25870,47 +23255,39 @@ module.exports = require("assert"); comment.extendedRange = [0, tree.range[0]]; comments.push(comment); } - tree.leadingComments = comments; } - return tree; } - for (i = 0, len = providedComments.length; i < len; i += 1) { comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens)); - } // This is based on John Freeman's implementation. - + } + // This is based on John Freeman's implementation. cursor = 0; traverse(tree, { enter: function (node) { var comment; - while (cursor < comments.length) { comment = comments[cursor]; - if (comment.extendedRange[1] > node.range[0]) { break; } - if (comment.extendedRange[1] === node.range[0]) { if (!node.leadingComments) { node.leadingComments = []; } - node.leadingComments.push(comment); comments.splice(cursor, 1); } else { cursor += 1; } - } // already out of owned node - + } + // already out of owned node if (cursor === comments.length) { return VisitorOption.Break; } - if (comments[cursor].extendedRange[0] > node.range[1]) { return VisitorOption.Skip; } @@ -25920,31 +23297,26 @@ module.exports = require("assert"); traverse(tree, { leave: function (node) { var comment; - while (cursor < comments.length) { comment = comments[cursor]; - if (node.range[1] < comment.extendedRange[0]) { break; } - if (node.range[1] === comment.extendedRange[0]) { if (!node.trailingComments) { node.trailingComments = []; } - node.trailingComments.push(comment); comments.splice(cursor, 1); } else { cursor += 1; } - } // already out of owned node - + } + // already out of owned node if (cursor === comments.length) { return VisitorOption.Break; } - if (comments[cursor].extendedRange[0] > node.range[1]) { return VisitorOption.Skip; } @@ -25952,7 +23324,6 @@ module.exports = require("assert"); }); return tree; } - exports.Syntax = Syntax; exports.traverse = traverse; exports.replace = replace; @@ -25960,17 +23331,15 @@ module.exports = require("assert"); exports.VisitorKeys = VisitorKeys; exports.VisitorOption = VisitorOption; exports.Controller = Controller; - exports.cloneEnvironment = function () { return clone({}); }; - return exports; })(exports); /* vim: set sw=4 ts=4 et tw=80 : */ /***/ }), -/* 505 */ +/* 527 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* @@ -25999,47 +23368,38 @@ module.exports = require("assert"); (function () { 'use strict'; - var estraverse = __webpack_require__(504); - + var estraverse = __webpack_require__(526); function isNode(node) { if (node == null) { return false; } - return typeof node === 'object' && typeof node.type === 'string'; } - function isProperty(nodeType, key) { return (nodeType === estraverse.Syntax.ObjectExpression || nodeType === estraverse.Syntax.ObjectPattern) && key === 'properties'; } - function Visitor(visitor, options) { options = options || {}; this.__visitor = visitor || this; this.__childVisitorKeys = options.childVisitorKeys ? Object.assign({}, estraverse.VisitorKeys, options.childVisitorKeys) : estraverse.VisitorKeys; - if (options.fallback === 'iteration') { this.__fallback = Object.keys; } else if (typeof options.fallback === 'function') { this.__fallback = options.fallback; } } + /* Default method for visiting children. * When you need to call default visiting operation inside custom visiting * operation, you can use it with `this.visitChildren(node)`. */ - - Visitor.prototype.visitChildren = function (node) { var type, children, i, iz, j, jz, child; - if (node == null) { return; } - type = node.type || estraverse.Syntax.Property; children = this.__childVisitorKeys[type]; - if (!children) { if (this.__fallback) { children = this.__fallback(node); @@ -26047,10 +23407,8 @@ module.exports = require("assert"); throw new Error('Unknown node type ' + type + '.'); } } - for (i = 0, iz = children.length; i < iz; ++i) { child = node[children[i]]; - if (child) { if (Array.isArray(child)) { for (j = 0, jz = child.length; j < jz; ++j) { @@ -26066,30 +23424,22 @@ module.exports = require("assert"); } } }; + /* Dispatching node. */ - - Visitor.prototype.visit = function (node) { var type; - if (node == null) { return; } - type = node.type || estraverse.Syntax.Property; - if (this.__visitor[type]) { this.__visitor[type].call(this, node); - return; } - this.visitChildren(node); }; - - exports.version = __webpack_require__(506).version; + exports.version = __webpack_require__(528).version; exports.Visitor = Visitor; - exports.visit = function (node, visitor, options) { var v = new Visitor(visitor, options); v.visit(node); @@ -26098,14 +23448,14 @@ module.exports = require("assert"); /* vim: set sw=4 ts=4 et tw=80 : */ /***/ }), -/* 506 */ +/* 528 */ /***/ ((module) => { "use strict"; module.exports = JSON.parse('{"name":"esrecurse","description":"ECMAScript AST recursive visitor","homepage":"https://github.com/estools/esrecurse","main":"esrecurse.js","version":"4.3.0","engines":{"node":">=4.0"},"maintainers":[{"name":"Yusuke Suzuki","email":"utatane.tea@gmail.com","web":"https://github.com/Constellation"}],"repository":{"type":"git","url":"https://github.com/estools/esrecurse.git"},"dependencies":{"estraverse":"^5.2.0"},"devDependencies":{"babel-cli":"^6.24.1","babel-eslint":"^7.2.3","babel-preset-es2015":"^6.24.1","babel-register":"^6.24.1","chai":"^4.0.2","esprima":"^4.0.0","gulp":"^3.9.0","gulp-bump":"^2.7.0","gulp-eslint":"^4.0.0","gulp-filter":"^5.0.0","gulp-git":"^2.4.1","gulp-mocha":"^4.3.1","gulp-tag-version":"^1.2.1","jsdoc":"^3.3.0-alpha10","minimist":"^1.1.0"},"license":"BSD-2-Clause","scripts":{"test":"gulp travis","unit-test":"gulp test","lint":"gulp lint"},"babel":{"presets":["es2015"]}}'); /***/ }), -/* 507 */ +/* 529 */ /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -26114,21 +23464,13 @@ module.exports = JSON.parse('{"name":"esrecurse","description":"ECMAScript AST r Object.defineProperty(exports, "__esModule", ({ value: true })); /** - * @typedef {import('./index.js').VisitorKeys} VisitorKeys + * @typedef {{ readonly [type: string]: ReadonlyArray }} VisitorKeys */ /** * @type {VisitorKeys} */ const KEYS = { - AssignmentExpression: [ - "left", - "right" - ], - AssignmentPattern: [ - "left", - "right" - ], ArrayExpression: [ "elements" ], @@ -26139,16 +23481,24 @@ const KEYS = { "params", "body" ], + AssignmentExpression: [ + "left", + "right" + ], + AssignmentPattern: [ + "left", + "right" + ], AwaitExpression: [ "argument" ], - BlockStatement: [ - "body" - ], BinaryExpression: [ "left", "right" ], + BlockStatement: [ + "body" + ], BreakStatement: [ "label" ], @@ -26190,6 +23540,12 @@ const KEYS = { "test" ], EmptyStatement: [], + ExperimentalRestProperty: [ + "argument" + ], + ExperimentalSpreadProperty: [ + "argument" + ], ExportAllDeclaration: [ "exported", "source" @@ -26209,18 +23565,6 @@ const KEYS = { ExpressionStatement: [ "expression" ], - ExperimentalRestProperty: [ - "argument" - ], - ExperimentalSpreadProperty: [ - "argument" - ], - ForStatement: [ - "init", - "test", - "update", - "body" - ], ForInStatement: [ "left", "right", @@ -26231,6 +23575,12 @@ const KEYS = { "right", "body" ], + ForStatement: [ + "init", + "test", + "update", + "body" + ], FunctionDeclaration: [ "id", "params", @@ -26271,6 +23621,7 @@ const KEYS = { JSXClosingElement: [ "name" ], + JSXClosingFragment: [], JSXElement: [ "openingElement", "children", @@ -26280,6 +23631,11 @@ const KEYS = { JSXExpressionContainer: [ "expression" ], + JSXFragment: [ + "openingFragment", + "children", + "closingFragment" + ], JSXIdentifier: [], JSXMemberExpression: [ "object", @@ -26293,22 +23649,19 @@ const KEYS = { "name", "attributes" ], + JSXOpeningFragment: [], JSXSpreadAttribute: [ "argument" ], - JSXText: [], - JSXFragment: [ - "openingFragment", - "children", - "closingFragment" + JSXSpreadChild: [ + "expression" ], - JSXClosingFragment: [], - JSXOpeningFragment: [], - Literal: [], + JSXText: [], LabeledStatement: [ "label", "body" ], + Literal: [], LogicalExpression: [ "left", "right" @@ -26363,14 +23716,14 @@ const KEYS = { "body" ], Super: [], - SwitchStatement: [ - "discriminant", - "cases" - ], SwitchCase: [ "test", "consequent" ], + SwitchStatement: [ + "discriminant", + "cases" + ], TaggedTemplateExpression: [ "tag", "quasi" @@ -26430,7 +23783,7 @@ Object.freeze(KEYS); */ /** - * @typedef {{ readonly [type: string]: ReadonlyArray }} VisitorKeys + * @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys */ // List to ignore keys. @@ -26490,11 +23843,10 @@ function unionWith(additionalKeys) { exports.KEYS = KEYS; exports.getKeys = getKeys; exports.unionWith = unionWith; -//# sourceMappingURL=eslint-visitor-keys.cjs.map /***/ }), -/* 508 */ +/* 530 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -26502,9 +23854,9 @@ exports.unionWith = unionWith; Object.defineProperty(exports, "__esModule", ({ value: true })); -var acorn = __webpack_require__(509); -var jsx = __webpack_require__(510); -var visitorKeys = __webpack_require__(507); +var acorn = __webpack_require__(531); +var jsx = __webpack_require__(532); +var visitorKeys = __webpack_require__(529); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } @@ -27260,7 +24612,7 @@ var espree = () => Parser => { }; }; -const version$1 = "9.4.0"; +const version$1 = "9.5.2"; /** * @fileoverview Main Espree file that converts Acorn into Esprima output. @@ -27395,6 +24747,7 @@ function parse(code, options) { //------------------------------------------------------------------------------ const version = version$1; +const name = "espree"; /* istanbul ignore next */ const VisitorKeys = (function() { @@ -27404,16 +24757,16 @@ const VisitorKeys = (function() { // Derive node types from VisitorKeys /* istanbul ignore next */ const Syntax = (function() { - let name, + let key, types = {}; if (typeof Object.create === "function") { types = Object.create(null); } - for (name in VisitorKeys) { - if (Object.hasOwnProperty.call(VisitorKeys, name)) { - types[name] = name; + for (key in VisitorKeys) { + if (Object.hasOwnProperty.call(VisitorKeys, key)) { + types[key] = key; } } @@ -27431,29 +24784,36 @@ const supportedEcmaVersions = getSupportedEcmaVersions(); exports.Syntax = Syntax; exports.VisitorKeys = VisitorKeys; exports.latestEcmaVersion = latestEcmaVersion; +exports.name = name; exports.parse = parse; exports.supportedEcmaVersions = supportedEcmaVersions; exports.tokenize = tokenize; exports.version = version; -//# sourceMappingURL=espree.cjs.map /***/ }), -/* 509 */ +/* 531 */ /***/ (function(__unused_webpack_module, exports) { (function (global, factory) { true ? factory(exports) : 0; })(this, function (exports) { - 'use strict'; // This file was generated. Do not modify manually! + 'use strict'; - var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 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, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 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, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; // This file was generated. Do not modify manually! + // This file was generated. Do not modify manually! + var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 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, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 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, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; - var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 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, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 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, 38, 6, 186, 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, 19, 72, 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, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 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, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 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, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 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, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; // This file was generated. Do not modify manually! + // This file was generated. Do not modify manually! + var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 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, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 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, 20, 1, 64, 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, 38, 6, 186, 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, 19, 72, 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, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 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, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 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, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 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, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938, 6, 4191]; - var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\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\u0c3c\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-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\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-\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"; // This file was generated. Do not modify manually! + // This file was generated. Do not modify manually! + var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\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\u0c3c\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\u0cf3\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-\u0ece\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-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\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-\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"; + + // This file was generated. Do not modify manually! + var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\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\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\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-\u1711\u171f-\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-\u1b4c\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-\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-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\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"; + + // These are a run-length and offset encoded representation of the - var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\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\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\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-\u1711\u171f-\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-\u1b4c\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-\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-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\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"; // These are a run-length and offset encoded representation of the // Reserved word lists for various dialects of the language var reservedWords = { @@ -27462,7 +24822,9 @@ exports.version = version; 6: "enum", strict: "implements interface let package private protected public static yield", strictBind: "eval arguments" - }; // And the keywords + }; + + // And the keywords var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; var keywords$1 = { @@ -27470,101 +24832,94 @@ exports.version = version; "5module": ecma5AndLessKeywords + " export import", 6: ecma5AndLessKeywords + " const class extends export import super" }; - var keywordRelationalOperator = /^in(stanceof)?$/; // ## Character categories + var keywordRelationalOperator = /^in(stanceof)?$/; + + // ## Character categories var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); - var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); // This has a complexity linear to the value of the code. The + var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); + + // This has a complexity linear to the value of the code. The // assumption is that looking up astral identifier characters is // rare. - function isInAstralSet(code, set) { var pos = 0x10000; - for (var i = 0; i < set.length; i += 2) { pos += set[i]; - if (pos > code) { return false; } - pos += set[i + 1]; - if (pos >= code) { return true; } } - } // Test whether a given character code starts an identifier. + return false; + } + // Test whether a given character code starts an identifier. function isIdentifierStart(code, astral) { if (code < 65) { return code === 36; } - if (code < 91) { return true; } - if (code < 97) { return code === 95; } - if (code < 123) { return true; } - if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); } - if (astral === false) { return false; } - return isInAstralSet(code, astralIdentifierStartCodes); - } // Test whether a given character is part of an identifier. + } + // Test whether a given character is part of an identifier. function isIdentifierChar(code, astral) { if (code < 48) { return code === 36; } - if (code < 58) { return true; } - if (code < 65) { return false; } - if (code < 91) { return true; } - if (code < 97) { return code === 95; } - if (code < 123) { return true; } - if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); } - if (astral === false) { return false; } - return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); - } // ## Token types + } + + // ## Token types + // The assignment of fine-grained, information-carrying type objects // allows the tokenizer to store the information it has about a // token in a way that is very cheap for the parser to look up. + // All token type variables start with an underscore, to make them // easy to recognize. + // The `beforeExpr` property is used to disambiguate between regular // expressions and divisions. It is set on all token types that can // be followed by an expression (thus, a slash after them would be a @@ -27579,7 +24934,6 @@ exports.version = version; // to know when parsing a label, in order to allow or disallow // continue jumps to that label. - var TokenType = function TokenType(label, conf) { if (conf === void 0) conf = {}; this.label = label; @@ -27593,29 +24947,29 @@ exports.version = version; this.binop = conf.binop || null; this.updateContext = null; }; - function binop(name, prec) { return new TokenType(name, { beforeExpr: true, binop: prec }); } - var beforeExpr = { - beforeExpr: true - }, - startsExpr = { - startsExpr: true - }; // Map keyword names to token types. + beforeExpr: true + }, + startsExpr = { + startsExpr: true + }; - var keywords = {}; // Succinct definitions of keyword token types + // Map keyword names to token types. + var keywords = {}; + + // Succinct definitions of keyword token types function kw(name, options) { if (options === void 0) options = {}; options.keyword = name; return keywords[name] = new TokenType(name, options); } - var types$1 = { num: new TokenType("num", startsExpr), regexp: new TokenType("regexp", startsExpr), @@ -27667,6 +25021,7 @@ exports.version = version; // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as // binary operators with a very low precedence, that should result // in AssignmentExpression nodes. + eq: new TokenType("=", { beforeExpr: true, isAssign: true @@ -27770,98 +25125,87 @@ exports.version = version; prefix: true, startsExpr: true }) - }; // Matches a whole line break (where CRLF is considered a single + }; + + // Matches a whole line break (where CRLF is considered a single // line break). Used to count lines. var lineBreak = /\r\n?|\n|\u2028|\u2029/; var lineBreakG = new RegExp(lineBreak.source, "g"); - function isNewLine(code) { return code === 10 || code === 13 || code === 0x2028 || code === 0x2029; } - function nextLineBreak(code, from, end) { if (end === void 0) end = code.length; - for (var i = from; i < end; i++) { var next = code.charCodeAt(i); - if (isNewLine(next)) { return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1; } } - return -1; } - var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; var ref = Object.prototype; var hasOwnProperty = ref.hasOwnProperty; var toString = ref.toString; - var hasOwn = Object.hasOwn || function (obj, propName) { return hasOwnProperty.call(obj, propName); }; - var isArray = Array.isArray || function (obj) { return toString.call(obj) === "[object Array]"; }; - function wordsRegexp(words) { return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$"); } - function codePointToString(code) { // UTF-16 Decoding if (code <= 0xFFFF) { return String.fromCharCode(code); } - code -= 0x10000; return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00); } + var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/; - var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/; // These are used when `options.locations` is on, for the + // These are used when `options.locations` is on, for the // `startLoc` and `endLoc` properties. var Position = function Position(line, col) { this.line = line; this.column = col; }; - Position.prototype.offset = function offset(n) { return new Position(this.line, this.column + n); }; - var SourceLocation = function SourceLocation(p, start, end) { this.start = start; this.end = end; - if (p.sourceFile !== null) { this.source = p.sourceFile; } - }; // The `getLineInfo` function is mostly useful when the + }; + + // The `getLineInfo` function is mostly useful when the // `locations` option is off (for performance reasons) and you // want to find the line/column position for a given character // offset. `input` should be the code string that the offset refers // into. - function getLineInfo(input, offset) { for (var line = 1, cur = 0;;) { var nextBreak = nextLineBreak(input, cur, offset); - if (nextBreak < 0) { return new Position(line, offset - cur); } - ++line; cur = nextBreak; } - } // A second argument must be given to configure the parser process. - // These options are recognized (only `ecmaVersion` is required): + } + // A second argument must be given to configure the parser process. + // These options are recognized (only `ecmaVersion` is required): var defaultOptions = { // `ecmaVersion` indicates the ECMAScript version to parse. Must be @@ -27953,17 +25297,16 @@ exports.version = version; // When enabled, parenthesized expressions are represented by // (non-standard) ParenthesizedExpression nodes preserveParens: false - }; // Interpret and default an options object + }; + + // Interpret and default an options object var warnedAboutEcmaVersion = false; - function getOptions(opts) { var options = {}; - for (var opt in defaultOptions) { options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; } - if (options.ecmaVersion === "latest") { options.ecmaVersion = 1e8; } else if (options.ecmaVersion == null) { @@ -27971,35 +25314,27 @@ exports.version = version; warnedAboutEcmaVersion = true; console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future."); } - options.ecmaVersion = 11; } else if (options.ecmaVersion >= 2015) { options.ecmaVersion -= 2009; } - if (options.allowReserved == null) { options.allowReserved = options.ecmaVersion < 5; } - - if (opts.allowHashBang == null) { + if (!opts || opts.allowHashBang == null) { options.allowHashBang = options.ecmaVersion >= 14; } - if (isArray(options.onToken)) { var tokens = options.onToken; - options.onToken = function (token) { return tokens.push(token); }; } - if (isArray(options.onComment)) { options.onComment = pushComment(options, options.onComment); } - return options; } - function pushComment(options, array) { return function (block, text, start, end, startLoc, endLoc) { var comment = { @@ -28008,73 +25343,69 @@ exports.version = version; start: start, end: end }; - if (options.locations) { comment.loc = new SourceLocation(this, startLoc, endLoc); } - if (options.ranges) { comment.range = [start, end]; } - array.push(comment); }; - } // Each scope gets a bitset that may contain these flags - + } + // Each scope gets a bitset that may contain these flags var SCOPE_TOP = 1, - SCOPE_FUNCTION = 2, - SCOPE_ASYNC = 4, - SCOPE_GENERATOR = 8, - SCOPE_ARROW = 16, - SCOPE_SIMPLE_CATCH = 32, - SCOPE_SUPER = 64, - SCOPE_DIRECT_SUPER = 128, - SCOPE_CLASS_STATIC_BLOCK = 256, - SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK; - + SCOPE_FUNCTION = 2, + SCOPE_ASYNC = 4, + SCOPE_GENERATOR = 8, + SCOPE_ARROW = 16, + SCOPE_SIMPLE_CATCH = 32, + SCOPE_SUPER = 64, + SCOPE_DIRECT_SUPER = 128, + SCOPE_CLASS_STATIC_BLOCK = 256, + SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK; function functionFlags(async, generator) { return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0); - } // Used in checkLVal* and declareName to determine the type of a binding - + } + // Used in checkLVal* and declareName to determine the type of a binding var BIND_NONE = 0, - // Not a binding - BIND_VAR = 1, - // Var-style binding - BIND_LEXICAL = 2, - // Let- or const-style binding - BIND_FUNCTION = 3, - // Function declaration - BIND_SIMPLE_CATCH = 4, - // Simple (identifier pattern) catch binding - BIND_OUTSIDE = 5; // Special case for function names as bound inside the function + // Not a binding + BIND_VAR = 1, + // Var-style binding + BIND_LEXICAL = 2, + // Let- or const-style binding + BIND_FUNCTION = 3, + // Function declaration + BIND_SIMPLE_CATCH = 4, + // Simple (identifier pattern) catch binding + BIND_OUTSIDE = 5; // Special case for function names as bound inside the function var Parser = function Parser(options, input, startPos) { this.options = options = getOptions(options); this.sourceFile = options.sourceFile; this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); var reserved = ""; - if (options.allowReserved !== true) { reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3]; - if (options.sourceType === "module") { reserved += " await"; } } - this.reservedWords = wordsRegexp(reserved); var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; this.reservedWordsStrict = wordsRegexp(reservedStrict); this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind); - this.input = String(input); // Used to signal to callers of `readWord1` whether the word + this.input = String(input); + + // Used to signal to callers of `readWord1` whether the word // contained any escape sequences. This is needed because words with // escape sequences must not be interpreted as keywords. + this.containsEsc = false; + + // Set up token state - this.containsEsc = false; // Set up token state // The current position of the tokenizer in the input. - if (startPos) { this.pos = startPos; this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; @@ -28082,54 +25413,61 @@ exports.version = version; } else { this.pos = this.lineStart = 0; this.curLine = 1; - } // Properties of the current token: + } + + // Properties of the current token: // Its type - - - this.type = types$1.eof; // For tokens that include more information than their type, the value - - this.value = null; // Its start and end offset - - this.start = this.end = this.pos; // And, if locations are used, the {line, column} object + this.type = types$1.eof; + // For tokens that include more information than their type, the value + this.value = null; + // Its start and end offset + this.start = this.end = this.pos; + // And, if locations are used, the {line, column} object // corresponding to those offsets + this.startLoc = this.endLoc = this.curPosition(); - this.startLoc = this.endLoc = this.curPosition(); // Position information for the previous token - + // Position information for the previous token this.lastTokEndLoc = this.lastTokStartLoc = null; - this.lastTokStart = this.lastTokEnd = this.pos; // The context stack is used to superficially track syntactic + this.lastTokStart = this.lastTokEnd = this.pos; + + // The context stack is used to superficially track syntactic // context to predict whether a regular expression is allowed in a // given position. - this.context = this.initialContext(); - this.exprAllowed = true; // Figure out if it's a module code. + this.exprAllowed = true; + // Figure out if it's a module code. this.inModule = options.sourceType === "module"; - this.strict = this.inModule || this.strictDirective(this.pos); // Used to signify the start of a potential arrow function + this.strict = this.inModule || this.strictDirective(this.pos); + // Used to signify the start of a potential arrow function this.potentialArrowAt = -1; - this.potentialArrowInForAwait = false; // Positions to delayed-check that yield/await does not exist in default parameters. + this.potentialArrowInForAwait = false; - this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; // Labels in scope. - - this.labels = []; // Thus-far undefined exports. - - this.undefinedExports = Object.create(null); // If enabled, skip leading hashbang line. + // Positions to delayed-check that yield/await does not exist in default parameters. + this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; + // Labels in scope. + this.labels = []; + // Thus-far undefined exports. + this.undefinedExports = Object.create(null); + // If enabled, skip leading hashbang line. if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") { this.skipLineComment(2); - } // Scope tracking for duplicate variable names (see scope.js) - + } + // Scope tracking for duplicate variable names (see scope.js) this.scopeStack = []; - this.enterScope(SCOPE_TOP); // For RegExp validation + this.enterScope(SCOPE_TOP); - this.regexpState = null; // The stack of private names. + // For RegExp validation + this.regexpState = null; + + // The stack of private names. // Each element has two properties: 'declared' and 'used'. // When it exited from the outermost class definition, all used private names must be declared. - this.privateNameStack = []; }; - var prototypeAccessors = { inFunction: { configurable: true @@ -28159,136 +25497,112 @@ exports.version = version; configurable: true } }; - Parser.prototype.parse = function parse() { var node = this.options.program || this.startNode(); this.nextToken(); return this.parseTopLevel(node); }; - prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0; }; - prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit; }; - prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit; }; - prototypeAccessors.canAwait.get = function () { for (var i = this.scopeStack.length - 1; i >= 0; i--) { var scope = this.scopeStack[i]; - if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) { return false; } - if (scope.flags & SCOPE_FUNCTION) { return (scope.flags & SCOPE_ASYNC) > 0; } } - return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction; }; - prototypeAccessors.allowSuper.get = function () { var ref = this.currentThisScope(); var flags = ref.flags; var inClassFieldInit = ref.inClassFieldInit; return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod; }; - prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0; }; - prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()); }; - prototypeAccessors.allowNewDotTarget.get = function () { var ref = this.currentThisScope(); var flags = ref.flags; var inClassFieldInit = ref.inClassFieldInit; return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit; }; - prototypeAccessors.inClassStaticBlock.get = function () { return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0; }; - Parser.extend = function extend() { var plugins = [], - len = arguments.length; - + len = arguments.length; while (len--) plugins[len] = arguments[len]; - var cls = this; - for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); } - return cls; }; - Parser.parse = function parse(input, options) { return new this(options, input).parse(); }; - Parser.parseExpressionAt = function parseExpressionAt(input, pos, options) { var parser = new this(options, input, pos); parser.nextToken(); return parser.parseExpression(); }; - Parser.tokenizer = function tokenizer(input, options) { return new this(options, input); }; - Object.defineProperties(Parser.prototype, prototypeAccessors); - var pp$9 = Parser.prototype; // ## Parser utilities + var pp$9 = Parser.prototype; + + // ## Parser utilities var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; - pp$9.strictDirective = function (start) { if (this.options.ecmaVersion < 5) { return false; } - for (;;) { // Try to find string literal. skipWhiteSpace.lastIndex = start; start += skipWhiteSpace.exec(this.input)[0].length; var match = literal.exec(this.input.slice(start)); - if (!match) { return false; } - if ((match[1] || match[2]) === "use strict") { skipWhiteSpace.lastIndex = start + match[0].length; var spaceAfter = skipWhiteSpace.exec(this.input), - end = spaceAfter.index + spaceAfter[0].length; + end = spaceAfter.index + spaceAfter[0].length; var next = this.input.charAt(end); return next === ";" || next === "}" || lineBreak.test(spaceAfter[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "="); } + start += match[0].length; - start += match[0].length; // Skip semicolon, if any. - + // Skip semicolon, if any. skipWhiteSpace.lastIndex = start; start += skipWhiteSpace.exec(this.input)[0].length; - if (this.input[start] === ";") { start++; } } - }; // Predicate that tests whether the next token is of the given - // type, and if yes, consumes it as a side effect. + }; + // Predicate that tests whether the next token is of the given + // type, and if yes, consumes it as a side effect. pp$9.eat = function (type) { if (this.type === type) { @@ -28297,138 +25611,127 @@ exports.version = version; } else { return false; } - }; // Tests whether parsed token is a contextual keyword. + }; + // Tests whether parsed token is a contextual keyword. pp$9.isContextual = function (name) { return this.type === types$1.name && this.value === name && !this.containsEsc; - }; // Consumes contextual keyword if possible. + }; + // Consumes contextual keyword if possible. pp$9.eatContextual = function (name) { if (!this.isContextual(name)) { return false; } - this.next(); return true; - }; // Asserts that following token is given contextual keyword. + }; + // Asserts that following token is given contextual keyword. pp$9.expectContextual = function (name) { if (!this.eatContextual(name)) { this.unexpected(); } - }; // Test whether a semicolon can be inserted at the current position. + }; + // Test whether a semicolon can be inserted at the current position. pp$9.canInsertSemicolon = function () { return this.type === types$1.eof || this.type === types$1.braceR || lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); }; - pp$9.insertSemicolon = function () { if (this.canInsertSemicolon()) { if (this.options.onInsertedSemicolon) { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); } - return true; } - }; // Consume a semicolon, or, failing that, see if we are allowed to - // pretend that there is a semicolon at this position. + }; + // Consume a semicolon, or, failing that, see if we are allowed to + // pretend that there is a semicolon at this position. pp$9.semicolon = function () { if (!this.eat(types$1.semi) && !this.insertSemicolon()) { this.unexpected(); } }; - pp$9.afterTrailingComma = function (tokType, notNext) { if (this.type === tokType) { if (this.options.onTrailingComma) { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); } - if (!notNext) { this.next(); } - return true; } - }; // Expect a token of a given type. If found, consume it, otherwise, - // raise an unexpected token error. + }; + // Expect a token of a given type. If found, consume it, otherwise, + // raise an unexpected token error. pp$9.expect = function (type) { this.eat(type) || this.unexpected(); - }; // Raise an unexpected token error. + }; + // Raise an unexpected token error. pp$9.unexpected = function (pos) { this.raise(pos != null ? pos : this.start, "Unexpected token"); }; - var DestructuringErrors = function DestructuringErrors() { this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1; }; - pp$9.checkPatternErrors = function (refDestructuringErrors, isAssign) { if (!refDestructuringErrors) { return; } - if (refDestructuringErrors.trailingComma > -1) { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); } - var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; - if (parens > -1) { this.raiseRecoverable(parens, isAssign ? "Assigning to rvalue" : "Parenthesized pattern"); } }; - pp$9.checkExpressionErrors = function (refDestructuringErrors, andThrow) { if (!refDestructuringErrors) { return false; } - var shorthandAssign = refDestructuringErrors.shorthandAssign; var doubleProto = refDestructuringErrors.doubleProto; - if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0; } - if (shorthandAssign >= 0) { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); } - if (doubleProto >= 0) { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); } }; - pp$9.checkYieldAwaitInDefaultParams = function () { if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } - if (this.awaitPos) { this.raise(this.awaitPos, "Await expression cannot be a default value"); } }; - pp$9.isSimpleAssignTarget = function (expr) { if (expr.type === "ParenthesizedExpression") { return this.isSimpleAssignTarget(expr.expression); } - return expr.type === "Identifier" || expr.type === "MemberExpression"; }; + var pp$8 = Parser.prototype; + + // ### Statement parsing - var pp$8 = Parser.prototype; // ### Statement parsing // Parse a program. Initializes the parser, reads any number of // statements, and wraps them in a Program node. Optionally takes a // `program` argument. If present, the statements will be appended @@ -28436,132 +25739,111 @@ exports.version = version; pp$8.parseTopLevel = function (node) { var exports = Object.create(null); - if (!node.body) { node.body = []; } - while (this.type !== types$1.eof) { var stmt = this.parseStatement(null, true, exports); node.body.push(stmt); } - if (this.inModule) { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1) { var name = list[i]; this.raiseRecoverable(this.undefinedExports[name].start, "Export '" + name + "' is not defined"); } } - this.adaptDirectivePrologue(node.body); this.next(); node.sourceType = this.options.sourceType; return this.finishNode(node, "Program"); }; - var loopLabel = { - kind: "loop" - }, - switchLabel = { - kind: "switch" - }; - + kind: "loop" + }, + switchLabel = { + kind: "switch" + }; pp$8.isLet = function (context) { if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false; } - skipWhiteSpace.lastIndex = this.pos; var skip = skipWhiteSpace.exec(this.input); var next = this.pos + skip[0].length, - nextCh = this.input.charCodeAt(next); // For ambiguous cases, determine if a LexicalDeclaration (or only a + nextCh = this.input.charCodeAt(next); + // For ambiguous cases, determine if a LexicalDeclaration (or only a // Statement) is allowed here. If context is not empty then only a Statement // is allowed. However, `let [` is an explicit negative lookahead for // ExpressionStatement, so special-case it first. - - if (nextCh === 91 || nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { + if (nextCh === 91 || nextCh === 92) { return true; - } // '[', '/', astral - - + } // '[', '/' if (context) { return false; } - - if (nextCh === 123) { + if (nextCh === 123 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true; - } // '{' - - + } // '{', astral if (isIdentifierStart(nextCh, true)) { var pos = next + 1; - while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { ++pos; } - if (nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true; } - var ident = this.input.slice(next, pos); - if (!keywordRelationalOperator.test(ident)) { return true; } } - return false; - }; // check 'async [no LineTerminator here] function' + }; + + // check 'async [no LineTerminator here] function' // - 'async /*foo*/ function' is OK. // - 'async /*\n*/ function' is invalid. - - pp$8.isAsyncFunction = function () { if (this.options.ecmaVersion < 8 || !this.isContextual("async")) { return false; } - skipWhiteSpace.lastIndex = this.pos; var skip = skipWhiteSpace.exec(this.input); var next = this.pos + skip[0].length, - after; + after; return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 0xd7ff && after < 0xdc00)); - }; // Parse a single statement. + }; + + // Parse a single statement. // // If expecting a statement and finding a slash operator, parse a // regular expression literal. This is to handle cases like // `if (foo) /blah/.exec(foo)`, where looking at the previous token // does not help. - pp$8.parseStatement = function (context, topLevel, exports) { var starttype = this.type, - node = this.startNode(), - kind; - + node = this.startNode(), + kind; if (this.isLet(context)) { starttype = types$1._var; kind = "let"; - } // Most types of statements are recognized by the keyword they + } + + // Most types of statements are recognized by the keyword they // start with. Many are trivial to parse, some require a bit of // complexity. - switch (starttype) { case types$1._break: case types$1._continue: return this.parseBreakContinueStatement(node, starttype.keyword); - case types$1._debugger: return this.parseDebuggerStatement(node); - case types$1._do: return this.parseDoStatement(node); - case types$1._for: return this.parseForStatement(node); - case types$1._function: // Function as sole body of either an if statement or a labeled statement // works, but not when it is part of a labeled statement that is the sole @@ -28569,110 +25851,85 @@ exports.version = version; if (context && (this.strict || context !== "if" && context !== "label") && this.options.ecmaVersion >= 6) { this.unexpected(); } - return this.parseFunctionStatement(node, false, !context); - case types$1._class: if (context) { this.unexpected(); } - return this.parseClass(node, true); - case types$1._if: return this.parseIfStatement(node); - case types$1._return: return this.parseReturnStatement(node); - case types$1._switch: return this.parseSwitchStatement(node); - case types$1._throw: return this.parseThrowStatement(node); - case types$1._try: return this.parseTryStatement(node); - case types$1._const: case types$1._var: kind = kind || this.value; - if (context && kind !== "var") { this.unexpected(); } - return this.parseVarStatement(node, kind); - case types$1._while: return this.parseWhileStatement(node); - case types$1._with: return this.parseWithStatement(node); - case types$1.braceL: return this.parseBlock(true, node); - case types$1.semi: return this.parseEmptyStatement(node); - case types$1._export: case types$1._import: if (this.options.ecmaVersion > 10 && starttype === types$1._import) { skipWhiteSpace.lastIndex = this.pos; var skip = skipWhiteSpace.exec(this.input); var next = this.pos + skip[0].length, - nextCh = this.input.charCodeAt(next); - - if (nextCh === 40 || nextCh === 46) // '(' or '.' + nextCh = this.input.charCodeAt(next); + if (nextCh === 40 || nextCh === 46) + // '(' or '.' { return this.parseExpressionStatement(node, this.parseExpression()); } } - if (!this.options.allowImportExportEverywhere) { if (!topLevel) { this.raise(this.start, "'import' and 'export' may only appear at the top level"); } - if (!this.inModule) { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } } - return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports); + // If the statement does not start with a statement keyword or a // brace, it's an ExpressionStatement or LabeledStatement. We // simply start parsing an expression, and afterwards, if the // next token is a colon and the expression was a simple // Identifier node, we switch to interpreting it as a label. - default: if (this.isAsyncFunction()) { if (context) { this.unexpected(); } - this.next(); return this.parseFunctionStatement(node, true, !context); } - var maybeName = this.value, - expr = this.parseExpression(); - + expr = this.parseExpression(); if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) { return this.parseLabeledStatement(node, maybeName, expr, context); } else { return this.parseExpressionStatement(node, expr); } - } }; - pp$8.parseBreakContinueStatement = function (node, keyword) { var isBreak = keyword === "break"; this.next(); - if (this.eat(types$1.semi) || this.insertSemicolon()) { node.label = null; } else if (this.type !== types$1.name) { @@ -28680,39 +25937,32 @@ exports.version = version; } else { node.label = this.parseIdent(); this.semicolon(); - } // Verify that there is an actual destination to break or + } + + // Verify that there is an actual destination to break or // continue to. - - var i = 0; - for (; i < this.labels.length; ++i) { var lab = this.labels[i]; - if (node.label == null || lab.name === node.label.name) { if (lab.kind != null && (isBreak || lab.kind === "loop")) { break; } - if (node.label && isBreak) { break; } } } - if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); } - return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); }; - pp$8.parseDebuggerStatement = function (node) { this.next(); this.semicolon(); return this.finishNode(node, "DebuggerStatement"); }; - pp$8.parseDoStatement = function (node) { this.next(); this.labels.push(loopLabel); @@ -28720,15 +25970,15 @@ exports.version = version; this.labels.pop(); this.expect(types$1._while); node.test = this.parseParenExpression(); - if (this.options.ecmaVersion >= 6) { this.eat(types$1.semi); } else { this.semicolon(); } - return this.finishNode(node, "DoWhileStatement"); - }; // Disambiguating between a `for` and a `for`/`in` or `for`/`of` + }; + + // Disambiguating between a `for` and a `for`/`in` or `for`/`of` // loop is non-trivial. Basically, we have to parse the init `var` // statement or expression, disallowing the `in` operator (see // the second parameter to `parseExpression`), and then check @@ -28736,31 +25986,25 @@ exports.version = version; // part (semicolon immediately after the opening parenthesis), it // is a regular `for` loop. - pp$8.parseForStatement = function (node) { this.next(); var awaitAt = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1; this.labels.push(loopLabel); this.enterScope(0); this.expect(types$1.parenL); - if (this.type === types$1.semi) { if (awaitAt > -1) { this.unexpected(awaitAt); } - return this.parseFor(node, null); } - var isLet = this.isLet(); - if (this.type === types$1._var || this.type === types$1._const || isLet) { var init$1 = this.startNode(), - kind = isLet ? "let" : this.value; + kind = isLet ? "let" : this.value; this.next(); this.parseVar(init$1, true, kind); this.finishNode(init$1, "VariableDeclaration"); - if ((this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init$1.declarations.length === 1) { if (this.options.ecmaVersion >= 9) { if (this.type === types$1._in) { @@ -28771,22 +26015,17 @@ exports.version = version; node.await = awaitAt > -1; } } - return this.parseForIn(node, init$1); } - if (awaitAt > -1) { this.unexpected(awaitAt); } - return this.parseFor(node, init$1); } - var startsWithLet = this.isContextual("let"), - isForOf = false; + isForOf = false; var refDestructuringErrors = new DestructuringErrors(); var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors); - if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { if (this.options.ecmaVersion >= 9) { if (this.type === types$1._in) { @@ -28797,45 +26036,39 @@ exports.version = version; node.await = awaitAt > -1; } } - if (startsWithLet && isForOf) { this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); } - this.toAssignable(init, false, refDestructuringErrors); this.checkLValPattern(init); return this.parseForIn(node, init); } else { this.checkExpressionErrors(refDestructuringErrors, true); } - if (awaitAt > -1) { this.unexpected(awaitAt); } - return this.parseFor(node, init); }; - pp$8.parseFunctionStatement = function (node, isAsync, declarationPosition) { this.next(); return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync); }; - pp$8.parseIfStatement = function (node) { this.next(); - node.test = this.parseParenExpression(); // allow function declarations in branches, but only in non-strict mode - + node.test = this.parseParenExpression(); + // allow function declarations in branches, but only in non-strict mode node.consequent = this.parseStatement("if"); node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null; return this.finishNode(node, "IfStatement"); }; - pp$8.parseReturnStatement = function (node) { if (!this.inFunction && !this.options.allowReturnOutsideFunction) { this.raise(this.start, "'return' outside of function"); } + this.next(); - this.next(); // In `return` (and `break`/`continue`), the keywords with + // In `return` (and `break`/`continue`), the keywords with // optional arguments, we eagerly look for a semicolon or the // possibility to insert one. @@ -28845,91 +26078,75 @@ exports.version = version; node.argument = this.parseExpression(); this.semicolon(); } - return this.finishNode(node, "ReturnStatement"); }; - pp$8.parseSwitchStatement = function (node) { this.next(); node.discriminant = this.parseParenExpression(); node.cases = []; this.expect(types$1.braceL); this.labels.push(switchLabel); - this.enterScope(0); // Statements under must be grouped (by label) in SwitchCase + this.enterScope(0); + + // Statements under must be grouped (by label) in SwitchCase // nodes. `cur` is used to keep the node that we are currently // adding statements to. var cur; - for (var sawDefault = false; this.type !== types$1.braceR;) { if (this.type === types$1._case || this.type === types$1._default) { var isCase = this.type === types$1._case; - if (cur) { this.finishNode(cur, "SwitchCase"); } - node.cases.push(cur = this.startNode()); cur.consequent = []; this.next(); - if (isCase) { cur.test = this.parseExpression(); } else { if (sawDefault) { this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); } - sawDefault = true; cur.test = null; } - this.expect(types$1.colon); } else { if (!cur) { this.unexpected(); } - cur.consequent.push(this.parseStatement(null)); } } - this.exitScope(); - if (cur) { this.finishNode(cur, "SwitchCase"); } - this.next(); // Closing brace - this.labels.pop(); return this.finishNode(node, "SwitchStatement"); }; - pp$8.parseThrowStatement = function (node) { this.next(); - if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) { this.raise(this.lastTokEnd, "Illegal newline after throw"); } - node.argument = this.parseExpression(); this.semicolon(); return this.finishNode(node, "ThrowStatement"); - }; // Reused empty array added for node fields that are always empty. + }; + // Reused empty array added for node fields that are always empty. var empty$1 = []; - pp$8.parseTryStatement = function (node) { this.next(); node.block = this.parseBlock(); node.handler = null; - if (this.type === types$1._catch) { var clause = this.startNode(); this.next(); - if (this.eat(types$1.parenL)) { clause.param = this.parseBindingAtom(); var simple = clause.param.type === "Identifier"; @@ -28940,32 +26157,25 @@ exports.version = version; if (this.options.ecmaVersion < 10) { this.unexpected(); } - clause.param = null; this.enterScope(0); } - clause.body = this.parseBlock(false); this.exitScope(); node.handler = this.finishNode(clause, "CatchClause"); } - node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null; - if (!node.handler && !node.finalizer) { this.raise(node.start, "Missing catch or finally clause"); } - return this.finishNode(node, "TryStatement"); }; - pp$8.parseVarStatement = function (node, kind) { this.next(); this.parseVar(node, false, kind); this.semicolon(); return this.finishNode(node, "VariableDeclaration"); }; - pp$8.parseWhileStatement = function (node) { this.next(); node.test = this.parseParenExpression(); @@ -28974,37 +26184,29 @@ exports.version = version; this.labels.pop(); return this.finishNode(node, "WhileStatement"); }; - pp$8.parseWithStatement = function (node) { if (this.strict) { this.raise(this.start, "'with' in strict mode"); } - this.next(); node.object = this.parseParenExpression(); node.body = this.parseStatement("with"); return this.finishNode(node, "WithStatement"); }; - pp$8.parseEmptyStatement = function (node) { this.next(); return this.finishNode(node, "EmptyStatement"); }; - pp$8.parseLabeledStatement = function (node, maybeName, expr, context) { for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) { var label = list[i$1]; - if (label.name === maybeName) { this.raise(expr.start, "Label '" + maybeName + "' is already declared"); } } - var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null; - for (var i = this.labels.length - 1; i >= 0; i--) { var label$1 = this.labels[i]; - if (label$1.statementStart === node.start) { // Update information about previous labels on this node label$1.statementStart = this.start; @@ -29013,7 +26215,6 @@ exports.version = version; break; } } - this.labels.push({ name: maybeName, kind: kind, @@ -29024,47 +26225,42 @@ exports.version = version; node.label = expr; return this.finishNode(node, "LabeledStatement"); }; - pp$8.parseExpressionStatement = function (node, expr) { node.expression = expr; this.semicolon(); return this.finishNode(node, "ExpressionStatement"); - }; // Parse a semicolon-enclosed block of statements, handling `"use + }; + + // Parse a semicolon-enclosed block of statements, handling `"use // strict"` declarations when `allowStrict` is true (used for // function bodies). - pp$8.parseBlock = function (createNewLexicalScope, node, exitStrict) { if (createNewLexicalScope === void 0) createNewLexicalScope = true; if (node === void 0) node = this.startNode(); node.body = []; this.expect(types$1.braceL); - if (createNewLexicalScope) { this.enterScope(0); } - while (this.type !== types$1.braceR) { var stmt = this.parseStatement(null); node.body.push(stmt); } - if (exitStrict) { this.strict = false; } - this.next(); - if (createNewLexicalScope) { this.exitScope(); } - return this.finishNode(node, "BlockStatement"); - }; // Parse a regular `for` loop. The disambiguation code in + }; + + // Parse a regular `for` loop. The disambiguation code in // `parseStatement` will already have parsed the init statement or // expression. - pp$8.parseFor = function (node, init) { node.init = init; this.expect(types$1.semi); @@ -29076,18 +26272,17 @@ exports.version = version; this.exitScope(); this.labels.pop(); return this.finishNode(node, "ForStatement"); - }; // Parse a `for`/`in` and `for`/`of` loop, which are almost - // same from parser's perspective. + }; + // Parse a `for`/`in` and `for`/`of` loop, which are almost + // same from parser's perspective. pp$8.parseForIn = function (node, init) { var isForIn = this.type === types$1._in; this.next(); - if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.options.ecmaVersion < 8 || this.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) { this.raise(init.start, (isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"); } - node.left = init; node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); this.expect(types$1.parenR); @@ -29095,17 +26290,16 @@ exports.version = version; this.exitScope(); this.labels.pop(); return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement"); - }; // Parse a list of variable declarations. + }; + // Parse a list of variable declarations. pp$8.parseVar = function (node, isFor, kind) { node.declarations = []; node.kind = kind; - for (;;) { var decl = this.startNode(); this.parseVarId(decl, kind); - if (this.eat(types$1.eq)) { decl.init = this.parseMaybeAssign(isFor); } else if (kind === "const" && !(this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of"))) { @@ -29115,47 +26309,40 @@ exports.version = version; } else { decl.init = null; } - node.declarations.push(this.finishNode(decl, "VariableDeclarator")); - if (!this.eat(types$1.comma)) { break; } } - return node; }; - pp$8.parseVarId = function (decl, kind) { decl.id = this.parseBindingAtom(); this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); }; - var FUNC_STATEMENT = 1, - FUNC_HANGING_STATEMENT = 2, - FUNC_NULLABLE_ID = 4; // Parse a function declaration or literal (depending on the - // `statement & FUNC_STATEMENT`). - // Remove `allowExpressionBody` for 7.0.0, as it is only called with false + FUNC_HANGING_STATEMENT = 2, + FUNC_NULLABLE_ID = 4; + // Parse a function declaration or literal (depending on the + // `statement & FUNC_STATEMENT`). + + // Remove `allowExpressionBody` for 7.0.0, as it is only called with false pp$8.parseFunction = function (node, statement, allowExpressionBody, isAsync, forInit) { this.initFunction(node); - if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { if (this.type === types$1.star && statement & FUNC_HANGING_STATEMENT) { this.unexpected(); } - node.generator = this.eat(types$1.star); } - if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } - if (statement & FUNC_STATEMENT) { node.id = statement & FUNC_NULLABLE_ID && this.type !== types$1.name ? null : this.parseIdent(); - - if (node.id && !(statement & FUNC_HANGING_STATEMENT)) // If it is a regular function declaration in sloppy mode, then it is + if (node.id && !(statement & FUNC_HANGING_STATEMENT)) + // If it is a regular function declaration in sloppy mode, then it is // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding // mode depends on properties of the current scope (see // treatFunctionsAsVar). @@ -29163,19 +26350,16 @@ exports.version = version; this.checkLValSimple(node.id, this.strict || node.generator || node.async ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); } } - var oldYieldPos = this.yieldPos, - oldAwaitPos = this.awaitPos, - oldAwaitIdentPos = this.awaitIdentPos; + oldAwaitPos = this.awaitPos, + oldAwaitIdentPos = this.awaitIdentPos; this.yieldPos = 0; this.awaitPos = 0; this.awaitIdentPos = 0; this.enterScope(functionFlags(node.async, node.generator)); - if (!(statement & FUNC_STATEMENT)) { node.id = this.type === types$1.name ? this.parseIdent() : null; } - this.parseFunctionParams(node); this.parseFunctionBody(node, allowExpressionBody, false, forInit); this.yieldPos = oldYieldPos; @@ -29183,19 +26367,20 @@ exports.version = version; this.awaitIdentPos = oldAwaitIdentPos; return this.finishNode(node, statement & FUNC_STATEMENT ? "FunctionDeclaration" : "FunctionExpression"); }; - pp$8.parseFunctionParams = function (node) { this.expect(types$1.parenL); node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); this.checkYieldAwaitInDefaultParams(); - }; // Parse a class declaration or literal (depending on the + }; + + // Parse a class declaration or literal (depending on the // `isStatement` parameter). - pp$8.parseClass = function (node, isStatement) { - this.next(); // ecma-262 14.6 Class Definitions - // A class definition is always strict mode code. + this.next(); + // ecma-262 14.6 Class Definitions + // A class definition is always strict mode code. var oldStrict = this.strict; this.strict = true; this.parseClassId(node, isStatement); @@ -29205,37 +26390,30 @@ exports.version = version; var hadConstructor = false; classBody.body = []; this.expect(types$1.braceL); - while (this.type !== types$1.braceR) { var element = this.parseClassElement(node.superClass !== null); - if (element) { classBody.body.push(element); - if (element.type === "MethodDefinition" && element.kind === "constructor") { if (hadConstructor) { this.raise(element.start, "Duplicate constructor in the same class"); } - hadConstructor = true; } else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element)) { this.raiseRecoverable(element.key.start, "Identifier '#" + element.key.name + "' has already been declared"); } } } - this.strict = oldStrict; this.next(); node.body = this.finishNode(classBody, "ClassBody"); this.exitClassBody(); return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); }; - pp$8.parseClassElement = function (constructorAllowsSuper) { if (this.eat(types$1.semi)) { return null; } - var ecmaVersion = this.options.ecmaVersion; var node = this.startNode(); var keyName = ""; @@ -29243,23 +26421,19 @@ exports.version = version; var isAsync = false; var kind = "method"; var isStatic = false; - if (this.eatContextual("static")) { // Parse static init block if (ecmaVersion >= 13 && this.eat(types$1.braceL)) { this.parseClassStaticBlock(node); return node; } - if (this.isClassElementNameStart() || this.type === types$1.star) { isStatic = true; } else { keyName = "static"; } } - node.static = isStatic; - if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) { if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) { isAsync = true; @@ -29267,14 +26441,11 @@ exports.version = version; keyName = "async"; } } - if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) { isGenerator = true; } - if (!keyName && !isAsync && !isGenerator) { var lastValue = this.value; - if (this.eatContextual("get") || this.eatContextual("set")) { if (this.isClassElementNameStart()) { kind = lastValue; @@ -29282,9 +26453,9 @@ exports.version = version; keyName = lastValue; } } - } // Parse element name - + } + // Parse element name if (keyName) { // 'async', 'get', 'set', or 'static' were not a keyword contextually. // The last token is any of those. Make it the element name. @@ -29294,84 +26465,72 @@ exports.version = version; this.finishNode(node.key, "Identifier"); } else { this.parseClassElementName(node); - } // Parse element value - + } + // Parse element value if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) { var isConstructor = !node.static && checkKeyName(node, "constructor"); - var allowsDirectSuper = isConstructor && constructorAllowsSuper; // Couldn't move this check into the 'parseClassMethod' method for backward compatibility. - + var allowsDirectSuper = isConstructor && constructorAllowsSuper; + // Couldn't move this check into the 'parseClassMethod' method for backward compatibility. if (isConstructor && kind !== "method") { this.raise(node.key.start, "Constructor can't have get/set modifier"); } - node.kind = isConstructor ? "constructor" : kind; this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper); } else { this.parseClassField(node); } - return node; }; - pp$8.isClassElementNameStart = function () { return this.type === types$1.name || this.type === types$1.privateId || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword; }; - pp$8.parseClassElementName = function (element) { if (this.type === types$1.privateId) { if (this.value === "constructor") { this.raise(this.start, "Classes can't have an element named '#constructor'"); } - element.computed = false; element.key = this.parsePrivateIdent(); } else { this.parsePropertyName(element); } }; - pp$8.parseClassMethod = function (method, isGenerator, isAsync, allowsDirectSuper) { // Check key and flags var key = method.key; - if (method.kind === "constructor") { if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); } - if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); } } else if (method.static && checkKeyName(method, "prototype")) { this.raise(key.start, "Classes may not have a static property named prototype"); - } // Parse value + } + // Parse value + var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); - var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); // Check value - + // Check value if (method.kind === "get" && value.params.length !== 0) { this.raiseRecoverable(value.start, "getter should have no params"); } - if (method.kind === "set" && value.params.length !== 1) { this.raiseRecoverable(value.start, "setter should have exactly one param"); } - if (method.kind === "set" && value.params[0].type === "RestElement") { this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"); } - return this.finishNode(method, "MethodDefinition"); }; - pp$8.parseClassField = function (field) { if (checkKeyName(field, "constructor")) { this.raise(field.key.start, "Classes can't have a field named 'constructor'"); } else if (field.static && checkKeyName(field, "prototype")) { this.raise(field.key.start, "Classes can't have a static field named 'prototype'"); } - if (this.eat(types$1.eq)) { // To raise SyntaxError if 'arguments' exists in the initializer. var scope = this.currentThisScope(); @@ -29382,32 +26541,26 @@ exports.version = version; } else { field.value = null; } - this.semicolon(); return this.finishNode(field, "PropertyDefinition"); }; - pp$8.parseClassStaticBlock = function (node) { node.body = []; var oldLabels = this.labels; this.labels = []; this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER); - while (this.type !== types$1.braceR) { var stmt = this.parseStatement(null); node.body.push(stmt); } - this.next(); this.exitScope(); this.labels = oldLabels; return this.finishNode(node, "StaticBlock"); }; - pp$8.parseClassId = function (node, isStatement) { if (this.type === types$1.name) { node.id = this.parseIdent(); - if (isStatement) { this.checkLValSimple(node.id, BIND_LEXICAL, false); } @@ -29415,15 +26568,12 @@ exports.version = version; if (isStatement === true) { this.unexpected(); } - node.id = null; } }; - pp$8.parseClassSuper = function (node) { - node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(false) : null; + node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, false) : null; }; - pp$8.enterClassBody = function () { var element = { declared: Object.create(null), @@ -29432,17 +26582,14 @@ exports.version = version; this.privateNameStack.push(element); return element.declared; }; - pp$8.exitClassBody = function () { var ref = this.privateNameStack.pop(); var declared = ref.declared; var used = ref.used; var len = this.privateNameStack.length; var parent = len === 0 ? null : this.privateNameStack[len - 1]; - for (var i = 0; i < used.length; ++i) { var id = used[i]; - if (!hasOwn(declared, id.name)) { if (parent) { parent.used.push(id); @@ -29452,17 +26599,15 @@ exports.version = version; } } }; - function isPrivateNameConflicted(privateNameMap, element) { var name = element.key.name; var curr = privateNameMap[name]; var next = "true"; - if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) { next = (element.static ? "s" : "i") + element.kind; - } // `class { get #a(){}; static set #a(_){} }` is also conflict. - + } + // `class { get #a(){}; static set #a(_){} }` is also conflict. if (curr === "iget" && next === "iset" || curr === "iset" && next === "iget" || curr === "sget" && next === "sset" || curr === "sset" && next === "sget") { privateNameMap[name] = "true"; return false; @@ -29473,17 +26618,17 @@ exports.version = version; return true; } } - function checkKeyName(node, name) { var computed = node.computed; var key = node.key; return !computed && (key.type === "Identifier" && key.name === name || key.type === "Literal" && key.value === name); - } // Parses module export declaration. + } + // Parses module export declaration. pp$8.parseExport = function (node, exports) { - this.next(); // export * from '...' - + this.next(); + // export * from '...' if (this.eat(types$1.star)) { if (this.options.ecmaVersion >= 11) { if (this.eatContextual("as")) { @@ -29493,31 +26638,24 @@ exports.version = version; node.exported = null; } } - this.expectContextual("from"); - if (this.type !== types$1.string) { this.unexpected(); } - node.source = this.parseExprAtom(); this.semicolon(); return this.finishNode(node, "ExportAllDeclaration"); } - if (this.eat(types$1._default)) { // export default ... this.checkExport(exports, "default", this.lastTokStart); var isAsync; - if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) { var fNode = this.startNode(); this.next(); - if (isAsync) { this.next(); } - node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); } else if (this.type === types$1._class) { var cNode = this.startNode(); @@ -29526,74 +26664,58 @@ exports.version = version; node.declaration = this.parseMaybeAssign(); this.semicolon(); } - return this.finishNode(node, "ExportDefaultDeclaration"); - } // export var|const|let|function|class ... - - + } + // export var|const|let|function|class ... if (this.shouldParseExportStatement()) { node.declaration = this.parseStatement(null); - if (node.declaration.type === "VariableDeclaration") { this.checkVariableExport(exports, node.declaration.declarations); } else { this.checkExport(exports, node.declaration.id, node.declaration.id.start); } - node.specifiers = []; node.source = null; } else { // export { x, y as z } [from '...'] node.declaration = null; node.specifiers = this.parseExportSpecifiers(exports); - if (this.eatContextual("from")) { if (this.type !== types$1.string) { this.unexpected(); } - node.source = this.parseExprAtom(); } else { for (var i = 0, list = node.specifiers; i < list.length; i += 1) { // check for keywords used as local names var spec = list[i]; - this.checkUnreserved(spec.local); // check if export is defined - + this.checkUnreserved(spec.local); + // check if export is defined this.checkLocalExport(spec.local); - if (spec.local.type === "Literal") { this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`."); } } - node.source = null; } - this.semicolon(); } - return this.finishNode(node, "ExportNamedDeclaration"); }; - pp$8.checkExport = function (exports, name, pos) { if (!exports) { return; } - if (typeof name !== "string") { name = name.type === "Identifier" ? name.name : name.value; } - if (hasOwn(exports, name)) { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); } - exports[name] = true; }; - pp$8.checkPatternExport = function (exports, pat) { var type = pat.type; - if (type === "Identifier") { this.checkExport(exports, pat, pat.start); } else if (type === "ObjectPattern") { @@ -29604,7 +26726,6 @@ exports.version = version; } else if (type === "ArrayPattern") { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { var elt = list$1[i$1]; - if (elt) { this.checkPatternExport(exports, elt); } @@ -29619,54 +26740,49 @@ exports.version = version; this.checkPatternExport(exports, pat.expression); } }; - pp$8.checkVariableExport = function (exports, decls) { if (!exports) { return; } - for (var i = 0, list = decls; i < list.length; i += 1) { var decl = list[i]; this.checkPatternExport(exports, decl.id); } }; - pp$8.shouldParseExportStatement = function () { return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction(); - }; // Parses a comma-separated list of module exports. + }; + // Parses a comma-separated list of module exports. pp$8.parseExportSpecifiers = function (exports) { var nodes = [], - first = true; // export { x, y as z } [from '...'] - + first = true; + // export { x, y as z } [from '...'] this.expect(types$1.braceL); - while (!this.eat(types$1.braceR)) { if (!first) { this.expect(types$1.comma); - if (this.afterTrailingComma(types$1.braceR)) { break; } } else { first = false; } - var node = this.startNode(); node.local = this.parseModuleExportName(); node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local; this.checkExport(exports, node.exported, node.exported.start); nodes.push(this.finishNode(node, "ExportSpecifier")); } - return nodes; - }; // Parses import declaration. + }; + // Parses import declaration. pp$8.parseImport = function (node) { - this.next(); // import '...' - + this.next(); + // import '...' if (this.type === types$1.string) { node.specifiers = empty$1; node.source = this.parseExprAtom(); @@ -29675,28 +26791,25 @@ exports.version = version; this.expectContextual("from"); node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected(); } - this.semicolon(); return this.finishNode(node, "ImportDeclaration"); - }; // Parses a comma-separated list of module imports. + }; + // Parses a comma-separated list of module imports. pp$8.parseImportSpecifiers = function () { var nodes = [], - first = true; - + first = true; if (this.type === types$1.name) { // import defaultObj, { x, y as z } from '...' var node = this.startNode(); node.local = this.parseIdent(); this.checkLValSimple(node.local, BIND_LEXICAL); nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); - if (!this.eat(types$1.comma)) { return nodes; } } - if (this.type === types$1.star) { var node$1 = this.startNode(); this.next(); @@ -29706,64 +26819,54 @@ exports.version = version; nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); return nodes; } - this.expect(types$1.braceL); - while (!this.eat(types$1.braceR)) { if (!first) { this.expect(types$1.comma); - if (this.afterTrailingComma(types$1.braceR)) { break; } } else { first = false; } - var node$2 = this.startNode(); node$2.imported = this.parseModuleExportName(); - if (this.eatContextual("as")) { node$2.local = this.parseIdent(); } else { this.checkUnreserved(node$2.imported); node$2.local = node$2.imported; } - this.checkLValSimple(node$2.local, BIND_LEXICAL); nodes.push(this.finishNode(node$2, "ImportSpecifier")); } - return nodes; }; - pp$8.parseModuleExportName = function () { if (this.options.ecmaVersion >= 13 && this.type === types$1.string) { var stringLiteral = this.parseLiteral(this.value); - if (loneSurrogate.test(stringLiteral.value)) { this.raise(stringLiteral.start, "An export name cannot include a lone surrogate."); } - return stringLiteral; } - return this.parseIdent(true); - }; // Set `ExpressionStatement#directive` property for directive prologues. - + }; + // Set `ExpressionStatement#directive` property for directive prologues. pp$8.adaptDirectivePrologue = function (statements) { for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { statements[i].directive = statements[i].expression.raw.slice(1, -1); } }; - pp$8.isDirectiveCandidate = function (statement) { - return this.options.ecmaVersion >= 5 && statement.type === "ExpressionStatement" && statement.expression.type === "Literal" && typeof statement.expression.value === "string" && ( // Reject parenthesized strings. + return this.options.ecmaVersion >= 5 && statement.type === "ExpressionStatement" && statement.expression.type === "Literal" && typeof statement.expression.value === "string" && ( + // Reject parenthesized strings. this.input[statement.start] === "\"" || this.input[statement.start] === "'"); }; + var pp$7 = Parser.prototype; - var pp$7 = Parser.prototype; // Convert existing expression atom to assignable pattern + // Convert existing expression atom to assignable pattern // if possible. pp$7.toAssignable = function (node, isBinding, refDestructuringErrors) { @@ -29773,122 +26876,98 @@ exports.version = version; if (this.inAsync && node.name === "await") { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); } - break; - case "ObjectPattern": case "ArrayPattern": case "AssignmentPattern": case "RestElement": break; - case "ObjectExpression": node.type = "ObjectPattern"; - if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } - for (var i = 0, list = node.properties; i < list.length; i += 1) { var prop = list[i]; - this.toAssignable(prop, isBinding); // Early error: + this.toAssignable(prop, isBinding); + // Early error: // AssignmentRestProperty[Yield, Await] : // `...` DestructuringAssignmentTarget[Yield, Await] // // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|. - if (prop.type === "RestElement" && (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")) { this.raise(prop.argument.start, "Unexpected token"); } } - break; - case "Property": // AssignmentProperty has type === "Property" if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); } - this.toAssignable(node.value, isBinding); break; - case "ArrayExpression": node.type = "ArrayPattern"; - if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } - this.toAssignableList(node.elements, isBinding); break; - case "SpreadElement": node.type = "RestElement"; this.toAssignable(node.argument, isBinding); - if (node.argument.type === "AssignmentPattern") { this.raise(node.argument.start, "Rest elements cannot have a default value"); } - break; - case "AssignmentExpression": if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); } - node.type = "AssignmentPattern"; delete node.operator; this.toAssignable(node.left, isBinding); break; - case "ParenthesizedExpression": this.toAssignable(node.expression, isBinding, refDestructuringErrors); break; - case "ChainExpression": this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side"); break; - case "MemberExpression": if (!isBinding) { break; } - default: this.raise(node.start, "Assigning to rvalue"); } } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } - return node; - }; // Convert list of expression atoms to binding list. + }; + // Convert list of expression atoms to binding list. pp$7.toAssignableList = function (exprList, isBinding) { var end = exprList.length; - for (var i = 0; i < end; i++) { var elt = exprList[i]; - if (elt) { this.toAssignable(elt, isBinding); } } - if (end) { var last = exprList[end - 1]; - if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") { this.unexpected(last.argument.start); } } - return exprList; - }; // Parses spread element. + }; + // Parses spread element. pp$7.parseSpread = function (refDestructuringErrors) { var node = this.startNode(); @@ -29896,19 +26975,19 @@ exports.version = version; node.argument = this.parseMaybeAssign(false, refDestructuringErrors); return this.finishNode(node, "SpreadElement"); }; - pp$7.parseRestBinding = function () { var node = this.startNode(); - this.next(); // RestElement inside of a function parameter must be an identifier + this.next(); + // RestElement inside of a function parameter must be an identifier if (this.options.ecmaVersion === 6 && this.type !== types$1.name) { this.unexpected(); } - node.argument = this.parseBindingAtom(); return this.finishNode(node, "RestElement"); - }; // Parses lvalue (assignable) atom. + }; + // Parses lvalue (assignable) atom. pp$7.parseBindingAtom = function () { if (this.options.ecmaVersion >= 6) { @@ -29918,26 +26997,21 @@ exports.version = version; this.next(); node.elements = this.parseBindingList(types$1.bracketR, true, true); return this.finishNode(node, "ArrayPattern"); - case types$1.braceL: return this.parseObj(true); } } - return this.parseIdent(); }; - pp$7.parseBindingList = function (close, allowEmpty, allowTrailingComma) { var elts = [], - first = true; - + first = true; while (!this.eat(close)) { if (first) { first = false; } else { this.expect(types$1.comma); } - if (allowEmpty && this.type === types$1.comma) { elts.push(null); } else if (allowTrailingComma && this.afterTrailingComma(close)) { @@ -29946,11 +27020,9 @@ exports.version = version; var rest = this.parseRestBinding(); this.parseBindingListItem(rest); elts.push(rest); - if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } - this.expect(close); break; } else { @@ -29959,27 +27031,26 @@ exports.version = version; elts.push(elem); } } - return elts; }; - pp$7.parseBindingListItem = function (param) { return param; - }; // Parses assignment pattern around given atom if possible. + }; + // Parses assignment pattern around given atom if possible. pp$7.parseMaybeDefault = function (startPos, startLoc, left) { left = left || this.parseBindingAtom(); - if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { return left; } - var node = this.startNodeAt(startPos, startLoc); node.left = left; node.right = this.parseMaybeAssign(); return this.finishNode(node, "AssignmentPattern"); - }; // The following three functions all verify that a node is an lvalue — + }; + + // The following three functions all verify that a node is an lvalue — // something that can be bound, or assigned to. In order to do so, they perform // a variety of checks: // @@ -30043,110 +27114,86 @@ exports.version = version; // duplicate argument names. checkClashes is ignored if the provided construct // is an assignment (i.e., bindingType is BIND_NONE). - pp$7.checkLValSimple = function (expr, bindingType, checkClashes) { if (bindingType === void 0) bindingType = BIND_NONE; var isBind = bindingType !== BIND_NONE; - switch (expr.type) { case "Identifier": if (this.strict && this.reservedWordsStrictBind.test(expr.name)) { this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); } - if (isBind) { if (bindingType === BIND_LEXICAL && expr.name === "let") { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); } - if (checkClashes) { if (hasOwn(checkClashes, expr.name)) { this.raiseRecoverable(expr.start, "Argument name clash"); } - checkClashes[expr.name] = true; } - if (bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); } } - break; - case "ChainExpression": this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side"); break; - case "MemberExpression": if (isBind) { this.raiseRecoverable(expr.start, "Binding member expression"); } - break; - case "ParenthesizedExpression": if (isBind) { this.raiseRecoverable(expr.start, "Binding parenthesized expression"); } - return this.checkLValSimple(expr.expression, bindingType, checkClashes); - default: this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue"); } }; - pp$7.checkLValPattern = function (expr, bindingType, checkClashes) { if (bindingType === void 0) bindingType = BIND_NONE; - switch (expr.type) { case "ObjectPattern": for (var i = 0, list = expr.properties; i < list.length; i += 1) { var prop = list[i]; this.checkLValInnerPattern(prop, bindingType, checkClashes); } - break; - case "ArrayPattern": for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { var elem = list$1[i$1]; - if (elem) { this.checkLValInnerPattern(elem, bindingType, checkClashes); } } - break; - default: this.checkLValSimple(expr, bindingType, checkClashes); } }; - pp$7.checkLValInnerPattern = function (expr, bindingType, checkClashes) { if (bindingType === void 0) bindingType = BIND_NONE; - switch (expr.type) { case "Property": // AssignmentProperty has type === "Property" this.checkLValInnerPattern(expr.value, bindingType, checkClashes); break; - case "AssignmentPattern": this.checkLValPattern(expr.left, bindingType, checkClashes); break; - case "RestElement": this.checkLValPattern(expr.argument, bindingType, checkClashes); break; - default: this.checkLValPattern(expr, bindingType, checkClashes); } - }; // The algorithm used to determine whether a regexp can appear at a + }; + // The algorithm used to determine whether a regexp can appear at a var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) { this.token = token; @@ -30155,7 +27202,6 @@ exports.version = version; this.override = override; this.generator = !!generator; }; - var types = { b_stat: new TokContext("{", false), b_expr: new TokContext("{", true), @@ -30171,64 +27217,50 @@ exports.version = version; f_gen: new TokContext("function", false, false, null, true) }; var pp$6 = Parser.prototype; - pp$6.initialContext = function () { return [types.b_stat]; }; - pp$6.curContext = function () { return this.context[this.context.length - 1]; }; - pp$6.braceIsBlock = function (prevType) { var parent = this.curContext(); - if (parent === types.f_expr || parent === types.f_stat) { return true; } - if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr)) { return !parent.isExpr; - } // The check for `tt.name && exprAllowed` detects whether we are + } + + // The check for `tt.name && exprAllowed` detects whether we are // after a `yield` or `of` construct. See the `updateContext` for // `tt.name`. - - if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed) { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); } - if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow) { return true; } - if (prevType === types$1.braceL) { return parent === types.b_stat; } - if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name) { return false; } - return !this.exprAllowed; }; - pp$6.inGeneratorContext = function () { for (var i = this.context.length - 1; i >= 1; i--) { var context = this.context[i]; - if (context.token === "function") { return context.generator; } } - return false; }; - pp$6.updateContext = function (prevType) { var update, - type = this.type; - + type = this.type; if (type.keyword && prevType === types$1.dot) { this.exprAllowed = false; } else if (update = type.updateContext) { @@ -30236,98 +27268,87 @@ exports.version = version; } else { this.exprAllowed = type.beforeExpr; } - }; // Used to handle egde cases when token context could not be inferred correctly during tokenization phase + }; + // Used to handle egde cases when token context could not be inferred correctly during tokenization phase pp$6.overrideContext = function (tokenCtx) { if (this.curContext() !== tokenCtx) { this.context[this.context.length - 1] = tokenCtx; } - }; // Token-specific context update code + }; + // Token-specific context update code types$1.parenR.updateContext = types$1.braceR.updateContext = function () { if (this.context.length === 1) { this.exprAllowed = true; return; } - var out = this.context.pop(); - if (out === types.b_stat && this.curContext().token === "function") { out = this.context.pop(); } - this.exprAllowed = !out.isExpr; }; - types$1.braceL.updateContext = function (prevType) { this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr); this.exprAllowed = true; }; - types$1.dollarBraceL.updateContext = function () { this.context.push(types.b_tmpl); this.exprAllowed = true; }; - types$1.parenL.updateContext = function (prevType) { var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while; this.context.push(statementParens ? types.p_stat : types.p_expr); this.exprAllowed = true; }; - - types$1.incDec.updateContext = function () {// tokExprAllowed stays unchanged + types$1.incDec.updateContext = function () { + // tokExprAllowed stays unchanged }; - types$1._function.updateContext = types$1._class.updateContext = function (prevType) { if (prevType.beforeExpr && prevType !== types$1._else && !(prevType === types$1.semi && this.curContext() !== types.p_stat) && !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat)) { this.context.push(types.f_expr); } else { this.context.push(types.f_stat); } - this.exprAllowed = false; }; - types$1.backQuote.updateContext = function () { if (this.curContext() === types.q_tmpl) { this.context.pop(); } else { this.context.push(types.q_tmpl); } - this.exprAllowed = false; }; - types$1.star.updateContext = function (prevType) { if (prevType === types$1._function) { var index = this.context.length - 1; - if (this.context[index] === types.f_expr) { this.context[index] = types.f_expr_gen; } else { this.context[index] = types.f_gen; } } - this.exprAllowed = true; }; - types$1.name.updateContext = function (prevType) { var allowed = false; - if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) { if (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) { allowed = true; } } - this.exprAllowed = allowed; - }; // A recursive descent parser operates by defining functions for all + }; + // A recursive descent parser operates by defining functions for all - var pp$5 = Parser.prototype; // Check if property name clashes with already added. + var pp$5 = Parser.prototype; + + // Check if property name clashes with already added. // Object/class getters and setters are not allowed to clash — // either with each other or with an init property — and in // strict mode, init properties are also not allowed to be repeated. @@ -30336,29 +27357,22 @@ exports.version = version; if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") { return; } - if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) { return; } - var key = prop.key; var name; - switch (key.type) { case "Identifier": name = key.name; break; - case "Literal": name = String(key.value); break; - default: return; } - var kind = prop.kind; - if (this.options.ecmaVersion >= 6) { if (name === "__proto__" && kind === "init") { if (propHash.proto) { @@ -30370,25 +27384,19 @@ exports.version = version; this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); } } - propHash.proto = true; } - return; } - name = "$" + name; var other = propHash[name]; - if (other) { var redefinition; - if (kind === "init") { redefinition = this.strict && other.init || other.get || other.set; } else { redefinition = other.init || other[kind]; } - if (redefinition) { this.raiseRecoverable(key.start, "Redefinition of property"); } @@ -30399,14 +27407,17 @@ exports.version = version; set: false }; } - other[kind] = true; - }; // ### Expression parsing + }; + + // ### Expression parsing + // These nest, from the most general expression type at the top to // 'atomic', nondivisible expression types at the bottom. Most of // the functions will simply let the function(s) below them parse, // and, *if* the syntactic construct they handle is present, wrap // the AST node that the inner parser gave them in another node. + // Parse a full expression. The optional arguments are used to // forbid the `in` operator (in for loops initalization expressions) // and provide reference for storing '=' operator inside shorthand @@ -30414,44 +27425,39 @@ exports.version = version; // and object pattern might appear (so it's possible to raise // delayed syntax error at correct position). - pp$5.parseExpression = function (forInit, refDestructuringErrors) { var startPos = this.start, - startLoc = this.startLoc; + startLoc = this.startLoc; var expr = this.parseMaybeAssign(forInit, refDestructuringErrors); - if (this.type === types$1.comma) { var node = this.startNodeAt(startPos, startLoc); node.expressions = [expr]; - while (this.eat(types$1.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); } - return this.finishNode(node, "SequenceExpression"); } - return expr; - }; // Parse an assignment expression. This includes applications of - // operators like `+=`. + }; + // Parse an assignment expression. This includes applications of + // operators like `+=`. pp$5.parseMaybeAssign = function (forInit, refDestructuringErrors, afterLeftParse) { if (this.isContextual("yield")) { if (this.inGenerator) { return this.parseYield(forInit); - } // The tokenizer will assume an expression is allowed after + } + // The tokenizer will assume an expression is allowed after // `yield`, but this isn't that kind of yield else { this.exprAllowed = false; } } - var ownDestructuringErrors = false, - oldParenAssign = -1, - oldTrailingComma = -1, - oldDoubleProto = -1; - + oldParenAssign = -1, + oldTrailingComma = -1, + oldDoubleProto = -1; if (refDestructuringErrors) { oldParenAssign = refDestructuringErrors.parenthesizedAssign; oldTrailingComma = refDestructuringErrors.trailingComma; @@ -30461,80 +27467,63 @@ exports.version = version; refDestructuringErrors = new DestructuringErrors(); ownDestructuringErrors = true; } - var startPos = this.start, - startLoc = this.startLoc; - + startLoc = this.startLoc; if (this.type === types$1.parenL || this.type === types$1.name) { this.potentialArrowAt = this.start; this.potentialArrowInForAwait = forInit === "await"; } - var left = this.parseMaybeConditional(forInit, refDestructuringErrors); - if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); } - if (this.type.isAssign) { var node = this.startNodeAt(startPos, startLoc); node.operator = this.value; - if (this.type === types$1.eq) { left = this.toAssignable(left, false, refDestructuringErrors); } - if (!ownDestructuringErrors) { refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; } - if (refDestructuringErrors.shorthandAssign >= left.start) { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly - - if (this.type === types$1.eq) { this.checkLValPattern(left); } else { this.checkLValSimple(left); } - node.left = left; this.next(); node.right = this.parseMaybeAssign(forInit); - if (oldDoubleProto > -1) { refDestructuringErrors.doubleProto = oldDoubleProto; } - return this.finishNode(node, "AssignmentExpression"); } else { if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); } } - if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; } - if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; } - return left; - }; // Parse a ternary conditional (`?:`) operator. + }; + // Parse a ternary conditional (`?:`) operator. pp$5.parseMaybeConditional = function (forInit, refDestructuringErrors) { var startPos = this.start, - startLoc = this.startLoc; + startLoc = this.startLoc; var expr = this.parseExprOps(forInit, refDestructuringErrors); - if (this.checkExpressionErrors(refDestructuringErrors)) { return expr; } - if (this.eat(types$1.question)) { var node = this.startNodeAt(startPos, startLoc); node.test = expr; @@ -30543,90 +27532,80 @@ exports.version = version; node.alternate = this.parseMaybeAssign(forInit); return this.finishNode(node, "ConditionalExpression"); } - return expr; - }; // Start the precedence parser. + }; + // Start the precedence parser. pp$5.parseExprOps = function (forInit, refDestructuringErrors) { var startPos = this.start, - startLoc = this.startLoc; + startLoc = this.startLoc; var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit); - if (this.checkExpressionErrors(refDestructuringErrors)) { return expr; } - return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit); - }; // Parse binary operators with the operator precedence parsing + }; + + // Parse binary operators with the operator precedence parsing // algorithm. `left` is the left-hand side of the operator. // `minPrec` provides context that allows the function to stop and // defer further parser to one of its callers when it encounters an // operator that has a lower precedence than the set it is parsing. - pp$5.parseExprOp = function (left, leftStartPos, leftStartLoc, minPrec, forInit) { var prec = this.type.binop; - if (prec != null && (!forInit || this.type !== types$1._in)) { if (prec > minPrec) { var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND; var coalesce = this.type === types$1.coalesce; - if (coalesce) { // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions. // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error. prec = types$1.logicalAND.binop; } - var op = this.value; this.next(); var startPos = this.start, - startLoc = this.startLoc; + startLoc = this.startLoc; var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit); var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); - if (logical && this.type === types$1.coalesce || coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND)) { this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); } - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit); } } - return left; }; - pp$5.buildBinary = function (startPos, startLoc, left, right, op, logical) { if (right.type === "PrivateIdentifier") { this.raise(right.start, "Private identifier can only be left side of binary expression"); } - var node = this.startNodeAt(startPos, startLoc); node.left = left; node.operator = op; node.right = right; return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression"); - }; // Parse unary operators, both prefix and postfix. + }; + // Parse unary operators, both prefix and postfix. pp$5.parseMaybeUnary = function (refDestructuringErrors, sawUnary, incDec, forInit) { var startPos = this.start, - startLoc = this.startLoc, - expr; - + startLoc = this.startLoc, + expr; if (this.isContextual("await") && this.canAwait) { expr = this.parseAwait(forInit); sawUnary = true; } else if (this.type.prefix) { var node = this.startNode(), - update = this.type === types$1.incDec; + update = this.type === types$1.incDec; node.operator = this.value; node.prefix = true; this.next(); node.argument = this.parseMaybeUnary(null, true, update, forInit); this.checkExpressionErrors(refDestructuringErrors, true); - if (update) { this.checkLValSimple(node.argument); } else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") { @@ -30636,25 +27615,21 @@ exports.version = version; } else { sawUnary = true; } - expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); } else if (!sawUnary && this.type === types$1.privateId) { if (forInit || this.privateNameStack.length === 0) { this.unexpected(); } - - expr = this.parsePrivateIdent(); // only could be private fields in 'in', such as #x in obj - + expr = this.parsePrivateIdent(); + // only could be private fields in 'in', such as #x in obj if (this.type !== types$1._in) { this.unexpected(); } } else { expr = this.parseExprSubscripts(refDestructuringErrors, forInit); - if (this.checkExpressionErrors(refDestructuringErrors)) { return expr; } - while (this.type.postfix && !this.canInsertSemicolon()) { var node$1 = this.startNodeAt(startPos, startLoc); node$1.operator = this.value; @@ -30665,7 +27640,6 @@ exports.version = version; expr = this.finishNode(node$1, "UpdateExpression"); } } - if (!incDec && this.eat(types$1.starstar)) { if (sawUnary) { this.unexpected(this.lastTokStart); @@ -30676,79 +27650,62 @@ exports.version = version; return expr; } }; - function isPrivateFieldAccess(node) { return node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || node.type === "ChainExpression" && isPrivateFieldAccess(node.expression); - } // Parse call, dot, and `[]`-subscript expressions. + } + // Parse call, dot, and `[]`-subscript expressions. pp$5.parseExprSubscripts = function (refDestructuringErrors, forInit) { var startPos = this.start, - startLoc = this.startLoc; + startLoc = this.startLoc; var expr = this.parseExprAtom(refDestructuringErrors, forInit); - if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") { return expr; } - var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit); - if (refDestructuringErrors && result.type === "MemberExpression") { if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; } - if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; } - if (refDestructuringErrors.trailingComma >= result.start) { refDestructuringErrors.trailingComma = -1; } } - return result; }; - pp$5.parseSubscripts = function (base, startPos, startLoc, noCalls, forInit) { var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && this.potentialArrowAt === base.start; var optionalChained = false; - while (true) { var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit); - if (element.optional) { optionalChained = true; } - if (element === base || element.type === "ArrowFunctionExpression") { if (optionalChained) { var chainNode = this.startNodeAt(startPos, startLoc); chainNode.expression = element; element = this.finishNode(chainNode, "ChainExpression"); } - return element; } - base = element; } }; - pp$5.parseSubscript = function (base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { var optionalSupported = this.options.ecmaVersion >= 11; var optional = optionalSupported && this.eat(types$1.questionDot); - if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); } - var computed = this.eat(types$1.bracketL); - if (computed || optional && this.type !== types$1.parenL && this.type !== types$1.backQuote || this.eat(types$1.dot)) { var node = this.startNodeAt(startPos, startLoc); node.object = base; - if (computed) { node.property = this.parseExpression(); this.expect(types$1.bracketR); @@ -30757,38 +27714,31 @@ exports.version = version; } else { node.property = this.parseIdent(this.options.allowReserved !== "never"); } - node.computed = !!computed; - if (optionalSupported) { node.optional = optional; } - base = this.finishNode(node, "MemberExpression"); } else if (!noCalls && this.eat(types$1.parenL)) { var refDestructuringErrors = new DestructuringErrors(), - oldYieldPos = this.yieldPos, - oldAwaitPos = this.awaitPos, - oldAwaitIdentPos = this.awaitIdentPos; + oldYieldPos = this.yieldPos, + oldAwaitPos = this.awaitPos, + oldAwaitIdentPos = this.awaitIdentPos; this.yieldPos = 0; this.awaitPos = 0; this.awaitIdentPos = 0; var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); - if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { this.checkPatternErrors(refDestructuringErrors, false); this.checkYieldAwaitInDefaultParams(); - if (this.awaitIdentPos > 0) { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); } - this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; this.awaitIdentPos = oldAwaitIdentPos; return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit); } - this.checkExpressionErrors(refDestructuringErrors, true); this.yieldPos = oldYieldPos || this.yieldPos; this.awaitPos = oldAwaitPos || this.awaitPos; @@ -30796,17 +27746,14 @@ exports.version = version; var node$1 = this.startNodeAt(startPos, startLoc); node$1.callee = base; node$1.arguments = exprList; - if (optionalSupported) { node$1.optional = optional; } - base = this.finishNode(node$1, "CallExpression"); } else if (this.type === types$1.backQuote) { if (optional || optionalChained) { this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); } - var node$2 = this.startNodeAt(startPos, startLoc); node$2.tag = base; node$2.quasi = this.parseTemplate({ @@ -30814,83 +27761,68 @@ exports.version = version; }); base = this.finishNode(node$2, "TaggedTemplateExpression"); } - return base; - }; // Parse an atomic expression — either a single token that is an + }; + + // Parse an atomic expression — either a single token that is an // expression, an expression started by a keyword like `function` or // `new`, or an expression wrapped in punctuation like `()`, `[]`, // or `{}`. - pp$5.parseExprAtom = function (refDestructuringErrors, forInit) { // If a division operator appears in an expression position, the // tokenizer got confused, and we force it to read a regexp instead. if (this.type === types$1.slash) { this.readRegexp(); } - var node, - canBeArrow = this.potentialArrowAt === this.start; - + canBeArrow = this.potentialArrowAt === this.start; switch (this.type) { case types$1._super: if (!this.allowSuper) { this.raise(this.start, "'super' keyword outside a method"); } - node = this.startNode(); this.next(); - if (this.type === types$1.parenL && !this.allowDirectSuper) { this.raise(node.start, "super() call outside constructor of a subclass"); - } // The `super` keyword can appear at below: + } + // The `super` keyword can appear at below: // SuperProperty: // super [ Expression ] // super . IdentifierName // SuperCall: // super ( Arguments ) - - if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL) { this.unexpected(); } - return this.finishNode(node, "Super"); - case types$1._this: node = this.startNode(); this.next(); return this.finishNode(node, "ThisExpression"); - case types$1.name: var startPos = this.start, - startLoc = this.startLoc, - containsEsc = this.containsEsc; + startLoc = this.startLoc, + containsEsc = this.containsEsc; var id = this.parseIdent(false); - if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) { this.overrideContext(types.f_expr); return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit); } - if (canBeArrow && !this.canInsertSemicolon()) { if (this.eat(types$1.arrow)) { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit); } - if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$1.name && !containsEsc && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) { id = this.parseIdent(false); - if (this.canInsertSemicolon() || !this.eat(types$1.arrow)) { this.unexpected(); } - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit); } } - return id; - case types$1.regexp: var value = this.value; node = this.parseLiteral(value.value); @@ -30899,11 +27831,9 @@ exports.version = version; flags: value.flags }; return node; - case types$1.num: case types$1.string: return this.parseLiteral(this.value); - case types$1._null: case types$1._true: case types$1._false: @@ -30912,186 +27842,152 @@ exports.version = version; node.raw = this.type.keyword; this.next(); return this.finishNode(node, "Literal"); - case types$1.parenL: var start = this.start, - expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit); - + expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit); if (refDestructuringErrors) { if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) { refDestructuringErrors.parenthesizedAssign = start; } - if (refDestructuringErrors.parenthesizedBind < 0) { refDestructuringErrors.parenthesizedBind = start; } } - return expr; - case types$1.bracketL: node = this.startNode(); this.next(); node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors); return this.finishNode(node, "ArrayExpression"); - case types$1.braceL: this.overrideContext(types.b_expr); return this.parseObj(false, refDestructuringErrors); - case types$1._function: node = this.startNode(); this.next(); return this.parseFunction(node, 0); - case types$1._class: return this.parseClass(this.startNode(), false); - case types$1._new: return this.parseNew(); - case types$1.backQuote: return this.parseTemplate(); - case types$1._import: if (this.options.ecmaVersion >= 11) { return this.parseExprImport(); } else { return this.unexpected(); } - default: this.unexpected(); } }; - pp$5.parseExprImport = function () { - var node = this.startNode(); // Consume `import` as an identifier for `import.meta`. - // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`. + var node = this.startNode(); + // Consume `import` as an identifier for `import.meta`. + // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`. if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); } - var meta = this.parseIdent(true); - switch (this.type) { case types$1.parenL: return this.parseDynamicImport(node); - case types$1.dot: node.meta = meta; return this.parseImportMeta(node); - default: this.unexpected(); } }; - pp$5.parseDynamicImport = function (node) { this.next(); // skip `(` + // Parse node.source. + node.source = this.parseMaybeAssign(); - node.source = this.parseMaybeAssign(); // Verify ending. - + // Verify ending. if (!this.eat(types$1.parenR)) { var errorPos = this.start; - if (this.eat(types$1.comma) && this.eat(types$1.parenR)) { this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); } else { this.unexpected(errorPos); } } - return this.finishNode(node, "ImportExpression"); }; - pp$5.parseImportMeta = function (node) { this.next(); // skip `.` var containsEsc = this.containsEsc; node.property = this.parseIdent(true); - if (node.property.name !== "meta") { this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); } - if (containsEsc) { this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); } - if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere) { this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); } - return this.finishNode(node, "MetaProperty"); }; - pp$5.parseLiteral = function (value) { var node = this.startNode(); node.value = value; node.raw = this.input.slice(this.start, this.end); - if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); } - this.next(); return this.finishNode(node, "Literal"); }; - pp$5.parseParenExpression = function () { this.expect(types$1.parenL); var val = this.parseExpression(); this.expect(types$1.parenR); return val; }; - pp$5.parseParenAndDistinguishExpression = function (canBeArrow, forInit) { var startPos = this.start, - startLoc = this.startLoc, - val, - allowTrailingComma = this.options.ecmaVersion >= 8; - + startLoc = this.startLoc, + val, + allowTrailingComma = this.options.ecmaVersion >= 8; if (this.options.ecmaVersion >= 6) { this.next(); var innerStartPos = this.start, - innerStartLoc = this.startLoc; + innerStartLoc = this.startLoc; var exprList = [], - first = true, - lastIsComma = false; + first = true, + lastIsComma = false; var refDestructuringErrors = new DestructuringErrors(), - oldYieldPos = this.yieldPos, - oldAwaitPos = this.awaitPos, - spreadStart; + oldYieldPos = this.yieldPos, + oldAwaitPos = this.awaitPos, + spreadStart; this.yieldPos = 0; - this.awaitPos = 0; // Do not save awaitIdentPos to allow checking awaits nested in parameters - + this.awaitPos = 0; + // Do not save awaitIdentPos to allow checking awaits nested in parameters while (this.type !== types$1.parenR) { first ? first = false : this.expect(types$1.comma); - if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) { lastIsComma = true; break; } else if (this.type === types$1.ellipsis) { spreadStart = this.start; exprList.push(this.parseParenItem(this.parseRestBinding())); - if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } - break; } else { exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); } } - var innerEndPos = this.lastTokEnd, - innerEndLoc = this.lastTokEndLoc; + innerEndLoc = this.lastTokEndLoc; this.expect(types$1.parenR); - if (canBeArrow && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { this.checkPatternErrors(refDestructuringErrors, false); this.checkYieldAwaitInDefaultParams(); @@ -31099,19 +27995,15 @@ exports.version = version; this.awaitPos = oldAwaitPos; return this.parseParenArrowList(startPos, startLoc, exprList, forInit); } - if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); } - if (spreadStart) { this.unexpected(spreadStart); } - this.checkExpressionErrors(refDestructuringErrors, true); this.yieldPos = oldYieldPos || this.yieldPos; this.awaitPos = oldAwaitPos || this.awaitPos; - if (exprList.length > 1) { val = this.startNodeAt(innerStartPos, innerStartLoc); val.expressions = exprList; @@ -31122,7 +28014,6 @@ exports.version = version; } else { val = this.parseParenExpression(); } - if (this.options.preserveParens) { var par = this.startNodeAt(startPos, startLoc); par.expression = val; @@ -31131,78 +28022,65 @@ exports.version = version; return val; } }; - pp$5.parseParenItem = function (item) { return item; }; - pp$5.parseParenArrowList = function (startPos, startLoc, exprList, forInit) { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit); - }; // New's precedence is slightly tricky. It must allow its argument to + }; + + // New's precedence is slightly tricky. It must allow its argument to // be a `[]` or dot subscript expression, but not a call — at least, // not without wrapping it in parentheses. Thus, it uses the noCalls // argument to parseSubscripts to prevent it from consuming the // argument list. - var empty = []; - pp$5.parseNew = function () { if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); } - var node = this.startNode(); var meta = this.parseIdent(true); - if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) { node.meta = meta; var containsEsc = this.containsEsc; node.property = this.parseIdent(true); - if (node.property.name !== "target") { this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); } - if (containsEsc) { this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); } - if (!this.allowNewDotTarget) { this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); } - return this.finishNode(node, "MetaProperty"); } - var startPos = this.start, - startLoc = this.startLoc, - isImport = this.type === types$1._import; + startLoc = this.startLoc, + isImport = this.type === types$1._import; node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false); - if (isImport && node.callee.type === "ImportExpression") { this.raise(startPos, "Cannot use new with import()"); } - if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); } else { node.arguments = empty; } - return this.finishNode(node, "NewExpression"); - }; // Parse template expression. + }; + // Parse template expression. pp$5.parseTemplateElement = function (ref) { var isTagged = ref.isTagged; var elem = this.startNode(); - if (this.type === types$1.invalidTemplate) { if (!isTagged) { this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); } - elem.value = { raw: this.value, cooked: null @@ -31213,12 +28091,10 @@ exports.version = version; cooked: this.value }; } - this.next(); elem.tail = this.type === types$1.backQuote; return this.finishNode(elem, "TemplateElement"); }; - pp$5.parseTemplate = function (ref) { if (ref === void 0) ref = {}; var isTagged = ref.isTagged; @@ -31230,12 +28106,10 @@ exports.version = version; isTagged: isTagged }); node.quasis = [curElt]; - while (!curElt.tail) { if (this.type === types$1.eof) { this.raise(this.pos, "Unterminated template literal"); } - this.expect(types$1.dollarBraceL); node.expressions.push(this.parseExpression()); this.expect(types$1.braceR); @@ -31243,109 +28117,88 @@ exports.version = version; isTagged: isTagged })); } - this.next(); return this.finishNode(node, "TemplateLiteral"); }; - pp$5.isAsyncProp = function (prop) { return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === types$1.star) && !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); - }; // Parse an object literal or binding pattern. + }; + // Parse an object literal or binding pattern. pp$5.parseObj = function (isPattern, refDestructuringErrors) { var node = this.startNode(), - first = true, - propHash = {}; + first = true, + propHash = {}; node.properties = []; this.next(); - while (!this.eat(types$1.braceR)) { if (!first) { this.expect(types$1.comma); - if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { break; } } else { first = false; } - var prop = this.parseProperty(isPattern, refDestructuringErrors); - if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); } - node.properties.push(prop); } - return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); }; - pp$5.parseProperty = function (isPattern, refDestructuringErrors) { var prop = this.startNode(), - isGenerator, - isAsync, - startPos, - startLoc; - + isGenerator, + isAsync, + startPos, + startLoc; if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) { if (isPattern) { prop.argument = this.parseIdent(false); - if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } - return this.finishNode(prop, "RestElement"); - } // Parse argument. - - - prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); // To disallow trailing comma via `this.toAssignable()`. - + } + // Parse argument. + prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); + // To disallow trailing comma via `this.toAssignable()`. if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { refDestructuringErrors.trailingComma = this.start; - } // Finish - - + } + // Finish return this.finishNode(prop, "SpreadElement"); } - if (this.options.ecmaVersion >= 6) { prop.method = false; prop.shorthand = false; - if (isPattern || refDestructuringErrors) { startPos = this.start; startLoc = this.startLoc; } - if (!isPattern) { isGenerator = this.eat(types$1.star); } } - var containsEsc = this.containsEsc; this.parsePropertyName(prop); - if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { isAsync = true; isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star); - this.parsePropertyName(prop, refDestructuringErrors); + this.parsePropertyName(prop); } else { isAsync = false; } - this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); return this.finishNode(prop, "Property"); }; - pp$5.parsePropertyValue = function (prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { if ((isGenerator || isAsync) && this.type === types$1.colon) { this.unexpected(); } - if (this.eat(types$1.colon)) { prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); prop.kind = "init"; @@ -31353,7 +28206,6 @@ exports.version = version; if (isPattern) { this.unexpected(); } - prop.kind = "init"; prop.method = true; prop.value = this.parseMethod(isGenerator, isAsync); @@ -31361,15 +28213,12 @@ exports.version = version; if (isGenerator || isAsync) { this.unexpected(); } - prop.kind = prop.key.name; this.parsePropertyName(prop); prop.value = this.parseMethod(false); var paramCount = prop.kind === "get" ? 0 : 1; - if (prop.value.params.length !== paramCount) { var start = prop.value.start; - if (prop.kind === "get") { this.raiseRecoverable(start, "getter should have no params"); } else { @@ -31384,33 +28233,26 @@ exports.version = version; if (isGenerator || isAsync) { this.unexpected(); } - this.checkUnreserved(prop.key); - if (prop.key.name === "await" && !this.awaitIdentPos) { this.awaitIdentPos = startPos; } - prop.kind = "init"; - if (isPattern) { prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); } else if (this.type === types$1.eq && refDestructuringErrors) { if (refDestructuringErrors.shorthandAssign < 0) { refDestructuringErrors.shorthandAssign = this.start; } - prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); } else { prop.value = this.copyNode(prop.key); } - prop.shorthand = true; } else { this.unexpected(); } }; - pp$5.parsePropertyName = function (prop) { if (this.options.ecmaVersion >= 6) { if (this.eat(types$1.bracketL)) { @@ -31422,39 +28264,35 @@ exports.version = version; prop.computed = false; } } - return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"); - }; // Initialize empty function node. + }; + // Initialize empty function node. pp$5.initFunction = function (node) { node.id = null; - if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; } - if (this.options.ecmaVersion >= 8) { node.async = false; } - }; // Parse object or class method. + }; + // Parse object or class method. pp$5.parseMethod = function (isGenerator, isAsync, allowDirectSuper) { var node = this.startNode(), - oldYieldPos = this.yieldPos, - oldAwaitPos = this.awaitPos, - oldAwaitIdentPos = this.awaitIdentPos; + oldYieldPos = this.yieldPos, + oldAwaitPos = this.awaitPos, + oldAwaitIdentPos = this.awaitIdentPos; this.initFunction(node); - if (this.options.ecmaVersion >= 6) { node.generator = isGenerator; } - if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } - this.yieldPos = 0; this.awaitPos = 0; this.awaitIdentPos = 0; @@ -31467,20 +28305,19 @@ exports.version = version; this.awaitPos = oldAwaitPos; this.awaitIdentPos = oldAwaitIdentPos; return this.finishNode(node, "FunctionExpression"); - }; // Parse arrow function expression with given parameters. + }; + // Parse arrow function expression with given parameters. pp$5.parseArrowExpression = function (node, params, isAsync, forInit) { var oldYieldPos = this.yieldPos, - oldAwaitPos = this.awaitPos, - oldAwaitIdentPos = this.awaitIdentPos; + oldAwaitPos = this.awaitPos, + oldAwaitIdentPos = this.awaitIdentPos; this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); this.initFunction(node); - if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } - this.yieldPos = 0; this.awaitPos = 0; this.awaitIdentPos = 0; @@ -31490,225 +28327,194 @@ exports.version = version; this.awaitPos = oldAwaitPos; this.awaitIdentPos = oldAwaitIdentPos; return this.finishNode(node, "ArrowFunctionExpression"); - }; // Parse function body and check parameters. + }; + // Parse function body and check parameters. pp$5.parseFunctionBody = function (node, isArrowFunction, isMethod, forInit) { var isExpression = isArrowFunction && this.type !== types$1.braceL; var oldStrict = this.strict, - useStrict = false; - + useStrict = false; if (isExpression) { node.body = this.parseMaybeAssign(forInit); node.expression = true; this.checkParams(node, false); } else { var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); - if (!oldStrict || nonSimple) { - useStrict = this.strictDirective(this.end); // If this is a strict mode function, verify that argument names + useStrict = this.strictDirective(this.end); + // If this is a strict mode function, verify that argument names // are not repeated, and it does not try to bind the words `eval` // or `arguments`. - if (useStrict && nonSimple) { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); } - } // Start a new scope with regard to labels and the `inFunction` + } + // Start a new scope with regard to labels and the `inFunction` // flag (restore them to their old value afterwards). - - var oldLabels = this.labels; this.labels = []; - if (useStrict) { this.strict = true; - } // Add the params to varDeclaredNames to ensure that an error is thrown + } + + // Add the params to varDeclaredNames to ensure that an error is thrown // if a let/const declaration in the function clashes with one of the params. - - - this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval' - + this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); + // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval' if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); } - node.body = this.parseBlock(false, undefined, useStrict && !oldStrict); node.expression = false; this.adaptDirectivePrologue(node.body.body); this.labels = oldLabels; } - this.exitScope(); }; - pp$5.isSimpleParamList = function (params) { for (var i = 0, list = params; i < list.length; i += 1) { var param = list[i]; - if (param.type !== "Identifier") { return false; } } - return true; - }; // Checks function params for various disallowed patterns such as using "eval" - // or "arguments" and duplicate parameters. + }; + // Checks function params for various disallowed patterns such as using "eval" + // or "arguments" and duplicate parameters. pp$5.checkParams = function (node, allowDuplicates) { var nameHash = Object.create(null); - for (var i = 0, list = node.params; i < list.length; i += 1) { var param = list[i]; this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash); } - }; // Parses a comma-separated list of expressions, and returns them as + }; + + // Parses a comma-separated list of expressions, and returns them as // an array. `close` is the token type that ends the list, and // `allowEmpty` can be turned on to allow subsequent commas with // nothing in between them to be parsed as `null` (which is needed // for array literals). - pp$5.parseExprList = function (close, allowTrailingComma, allowEmpty, refDestructuringErrors) { var elts = [], - first = true; - + first = true; while (!this.eat(close)) { if (!first) { this.expect(types$1.comma); - if (allowTrailingComma && this.afterTrailingComma(close)) { break; } } else { first = false; } - var elt = void 0; - if (allowEmpty && this.type === types$1.comma) { elt = null; } else if (this.type === types$1.ellipsis) { elt = this.parseSpread(refDestructuringErrors); - if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0) { refDestructuringErrors.trailingComma = this.start; } } else { elt = this.parseMaybeAssign(false, refDestructuringErrors); } - elts.push(elt); } - return elts; }; - pp$5.checkUnreserved = function (ref) { var start = ref.start; var end = ref.end; var name = ref.name; - if (this.inGenerator && name === "yield") { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); } - if (this.inAsync && name === "await") { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); } - if (this.currentThisScope().inClassFieldInit && name === "arguments") { this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer"); } - if (this.inClassStaticBlock && (name === "arguments" || name === "await")) { this.raise(start, "Cannot use " + name + " in class static initialization block"); } - if (this.keywords.test(name)) { this.raise(start, "Unexpected keyword '" + name + "'"); } - if (this.options.ecmaVersion < 6 && this.input.slice(start, end).indexOf("\\") !== -1) { return; } - var re = this.strict ? this.reservedWordsStrict : this.reservedWords; - if (re.test(name)) { if (!this.inAsync && name === "await") { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); } - this.raiseRecoverable(start, "The keyword '" + name + "' is reserved"); } - }; // Parse the next token as an identifier. If `liberal` is true (used + }; + + // Parse the next token as an identifier. If `liberal` is true (used // when parsing properties), it will also convert keywords into // identifiers. - - pp$5.parseIdent = function (liberal, isBinding) { + pp$5.parseIdent = function (liberal) { var node = this.startNode(); - if (this.type === types$1.name) { node.name = this.value; } else if (this.type.keyword) { - node.name = this.type.keyword; // To fix https://github.com/acornjs/acorn/issues/575 + node.name = this.type.keyword; + + // To fix https://github.com/acornjs/acorn/issues/575 // `class` and `function` keywords push new context into this.context. // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name. // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword - if ((node.name === "class" || node.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { this.context.pop(); } } else { this.unexpected(); } - this.next(!!liberal); this.finishNode(node, "Identifier"); - if (!liberal) { this.checkUnreserved(node); - if (node.name === "await" && !this.awaitIdentPos) { this.awaitIdentPos = node.start; } } - return node; }; - pp$5.parsePrivateIdent = function () { var node = this.startNode(); - if (this.type === types$1.privateId) { node.name = this.value; } else { this.unexpected(); } - this.next(); - this.finishNode(node, "PrivateIdentifier"); // For validating existence + this.finishNode(node, "PrivateIdentifier"); + // For validating existence if (this.privateNameStack.length === 0) { this.raise(node.start, "Private field '#" + node.name + "' must be declared in an enclosing class"); } else { this.privateNameStack[this.privateNameStack.length - 1].used.push(node); } - return node; - }; // Parses yield expression inside generator. + }; + // Parses yield expression inside generator. pp$5.parseYield = function (forInit) { if (!this.yieldPos) { this.yieldPos = this.start; } - var node = this.startNode(); this.next(); - if (this.type === types$1.semi || this.canInsertSemicolon() || this.type !== types$1.star && !this.type.startsExpr) { node.delegate = false; node.argument = null; @@ -31716,22 +28522,20 @@ exports.version = version; node.delegate = this.eat(types$1.star); node.argument = this.parseMaybeAssign(forInit); } - return this.finishNode(node, "YieldExpression"); }; - pp$5.parseAwait = function (forInit) { if (!this.awaitPos) { this.awaitPos = this.start; } - var node = this.startNode(); this.next(); node.argument = this.parseMaybeUnary(null, true, false, forInit); return this.finishNode(node, "AwaitExpression"); }; + var pp$4 = Parser.prototype; - var pp$4 = Parser.prototype; // This function is used to raise exceptions on parse errors. It + // This function is used to raise exceptions on parse errors. It // takes an offset integer (into the current `input`) to indicate // the location of the error, attaches the position to the end // of the error message, and then raises a `SyntaxError` with that @@ -31746,53 +28550,46 @@ exports.version = version; err.raisedAt = this.pos; throw err; }; - pp$4.raiseRecoverable = pp$4.raise; - pp$4.curPosition = function () { if (this.options.locations) { return new Position(this.curLine, this.pos - this.lineStart); } }; - var pp$3 = Parser.prototype; - var Scope = function Scope(flags) { - this.flags = flags; // A list of var-declared names in the current lexical scope - - this.var = []; // A list of lexically-declared names in the current lexical scope - - this.lexical = []; // A list of lexically-declared FunctionDeclaration names in the current lexical scope - - this.functions = []; // A switch to disallow the identifier reference 'arguments' - + this.flags = flags; + // A list of var-declared names in the current lexical scope + this.var = []; + // A list of lexically-declared names in the current lexical scope + this.lexical = []; + // A list of lexically-declared FunctionDeclaration names in the current lexical scope + this.functions = []; + // A switch to disallow the identifier reference 'arguments' this.inClassFieldInit = false; - }; // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. + }; + // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. pp$3.enterScope = function (flags) { this.scopeStack.push(new Scope(flags)); }; - pp$3.exitScope = function () { this.scopeStack.pop(); - }; // The spec says: + }; + + // The spec says: // > At the top level of a function, or script, function declarations are // > treated like var declarations rather than like lexical declarations. - - pp$3.treatFunctionsAsVarInScope = function (scope) { return scope.flags & SCOPE_FUNCTION || !this.inModule && scope.flags & SCOPE_TOP; }; - pp$3.declareName = function (name, bindingType, pos) { var redeclared = false; - if (bindingType === BIND_LEXICAL) { var scope = this.currentScope(); redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1; scope.lexical.push(name); - if (this.inModule && scope.flags & SCOPE_TOP) { delete this.undefinedExports[name]; } @@ -31801,169 +28598,153 @@ exports.version = version; scope$1.lexical.push(name); } else if (bindingType === BIND_FUNCTION) { var scope$2 = this.currentScope(); - if (this.treatFunctionsAsVar) { redeclared = scope$2.lexical.indexOf(name) > -1; } else { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; } - scope$2.functions.push(name); } else { for (var i = this.scopeStack.length - 1; i >= 0; --i) { var scope$3 = this.scopeStack[i]; - if (scope$3.lexical.indexOf(name) > -1 && !(scope$3.flags & SCOPE_SIMPLE_CATCH && scope$3.lexical[0] === name) || !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) { redeclared = true; break; } - scope$3.var.push(name); - if (this.inModule && scope$3.flags & SCOPE_TOP) { delete this.undefinedExports[name]; } - if (scope$3.flags & SCOPE_VAR) { break; } } } - if (redeclared) { this.raiseRecoverable(pos, "Identifier '" + name + "' has already been declared"); } }; - pp$3.checkLocalExport = function (id) { // scope.functions must be empty as Module code is always strict. if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1) { this.undefinedExports[id.name] = id; } }; - pp$3.currentScope = function () { return this.scopeStack[this.scopeStack.length - 1]; }; - pp$3.currentVarScope = function () { for (var i = this.scopeStack.length - 1;; i--) { var scope = this.scopeStack[i]; - if (scope.flags & SCOPE_VAR) { return scope; } } - }; // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. - + }; + // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. pp$3.currentThisScope = function () { for (var i = this.scopeStack.length - 1;; i--) { var scope = this.scopeStack[i]; - if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope; } } }; - var Node = function Node(parser, pos, loc) { this.type = ""; this.start = pos; this.end = 0; - if (parser.options.locations) { this.loc = new SourceLocation(parser, loc); } - if (parser.options.directSourceFile) { this.sourceFile = parser.options.directSourceFile; } - if (parser.options.ranges) { this.range = [pos, 0]; } - }; // Start an AST node, attaching a start offset. + }; + // Start an AST node, attaching a start offset. var pp$2 = Parser.prototype; - pp$2.startNode = function () { return new Node(this, this.start, this.startLoc); }; - pp$2.startNodeAt = function (pos, loc) { return new Node(this, pos, loc); - }; // Finish an AST node, adding `type` and `end` properties. + }; + // Finish an AST node, adding `type` and `end` properties. function finishNodeAt(node, type, pos, loc) { node.type = type; node.end = pos; - if (this.options.locations) { node.loc.end = loc; } - if (this.options.ranges) { node.range[1] = pos; } - return node; } - pp$2.finishNode = function (node, type) { return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc); - }; // Finish node at given position + }; + // Finish node at given position pp$2.finishNodeAt = function (node, type, pos, loc) { return finishNodeAt.call(this, node, type, pos, loc); }; - pp$2.copyNode = function (node) { var newNode = new Node(this, node.start, this.startLoc); - for (var prop in node) { newNode[prop] = node[prop]; } - return newNode; - }; // This file contains Unicode properties extracted from the ECMAScript - // specification. The lists are extracted like so: + }; + + // This file contains Unicode properties extracted from the ECMAScript specification. + // The lists are extracted like so: // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText) + // #table-binary-unicode-properties - - var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"; var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; var ecma11BinaryProperties = ecma10BinaryProperties; var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict"; var ecma13BinaryProperties = ecma12BinaryProperties; + var ecma14BinaryProperties = ecma13BinaryProperties; var unicodeBinaryProperties = { 9: ecma9BinaryProperties, 10: ecma10BinaryProperties, 11: ecma11BinaryProperties, 12: ecma12BinaryProperties, - 13: ecma13BinaryProperties - }; // #table-unicode-general-category-values + 13: ecma13BinaryProperties, + 14: ecma14BinaryProperties + }; - var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; // #table-unicode-script-values + // #table-unicode-general-category-values + var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; + // #table-unicode-script-values var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"; var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"; + var ecma14ScriptValues = ecma13ScriptValues + " Kawi Nag_Mundari Nagm"; var unicodeScriptValues = { 9: ecma9ScriptValues, 10: ecma10ScriptValues, 11: ecma11ScriptValues, 12: ecma12ScriptValues, - 13: ecma13ScriptValues + 13: ecma13ScriptValues, + 14: ecma14ScriptValues }; var data = {}; - function buildUnicodeData(ecmaVersion) { var d = data[ecmaVersion] = { binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues), @@ -31977,18 +28758,15 @@ exports.version = version; d.nonBinary.sc = d.nonBinary.Script; d.nonBinary.scx = d.nonBinary.Script_Extensions; } - - for (var i = 0, list = [9, 10, 11, 12, 13]; i < list.length; i += 1) { + for (var i = 0, list = [9, 10, 11, 12, 13, 14]; i < list.length; i += 1) { var ecmaVersion = list[i]; buildUnicodeData(ecmaVersion); } - var pp$1 = Parser.prototype; - var RegExpValidationState = function RegExpValidationState(parser) { this.parser = parser; this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : ""); - this.unicodeProperties = data[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion]; + this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion]; this.source = ""; this.flags = ""; this.start = 0; @@ -32003,7 +28781,6 @@ exports.version = version; this.groupNames = []; this.backReferenceNames = []; }; - RegExpValidationState.prototype.reset = function reset(start, pattern, flags) { var unicode = flags.indexOf("u") !== -1; this.start = start | 0; @@ -32012,122 +28789,102 @@ exports.version = version; this.switchU = unicode && this.parser.options.ecmaVersion >= 6; this.switchN = unicode && this.parser.options.ecmaVersion >= 9; }; - RegExpValidationState.prototype.raise = function raise(message) { this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + message); - }; // If u flag is given, this returns the code point at the index (it combines a surrogate pair). + }; + + // If u flag is given, this returns the code point at the index (it combines a surrogate pair). // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair). - - RegExpValidationState.prototype.at = function at(i, forceU) { if (forceU === void 0) forceU = false; var s = this.source; var l = s.length; - if (i >= l) { return -1; } - var c = s.charCodeAt(i); - if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { return c; } - var next = s.charCodeAt(i + 1); return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c; }; - RegExpValidationState.prototype.nextIndex = function nextIndex(i, forceU) { if (forceU === void 0) forceU = false; var s = this.source; var l = s.length; - if (i >= l) { return l; } - var c = s.charCodeAt(i), - next; - + next; if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l || (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) { return i + 1; } - return i + 2; }; - RegExpValidationState.prototype.current = function current(forceU) { if (forceU === void 0) forceU = false; return this.at(this.pos, forceU); }; - RegExpValidationState.prototype.lookahead = function lookahead(forceU) { if (forceU === void 0) forceU = false; return this.at(this.nextIndex(this.pos, forceU), forceU); }; - RegExpValidationState.prototype.advance = function advance(forceU) { if (forceU === void 0) forceU = false; this.pos = this.nextIndex(this.pos, forceU); }; - RegExpValidationState.prototype.eat = function eat(ch, forceU) { if (forceU === void 0) forceU = false; - if (this.current(forceU) === ch) { this.advance(forceU); return true; } - return false; }; + /** * Validate the flags part of a given RegExpLiteral. * * @param {RegExpValidationState} state The state to validate RegExp. * @returns {void} */ - - pp$1.validateRegExpFlags = function (state) { var validFlags = state.validFlags; var flags = state.flags; - for (var i = 0; i < flags.length; i++) { var flag = flags.charAt(i); - if (validFlags.indexOf(flag) === -1) { this.raise(state.start, "Invalid regular expression flag"); } - if (flags.indexOf(flag, i + 1) > -1) { this.raise(state.start, "Duplicate regular expression flag"); } } }; + /** * Validate the pattern part of a given RegExpLiteral. * * @param {RegExpValidationState} state The state to validate RegExp. * @returns {void} */ - - pp$1.validateRegExpPattern = function (state) { - this.regexp_pattern(state); // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of + this.regexp_pattern(state); + + // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of // parsing contains a |GroupName|, reparse with the goal symbol // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError* // exception if _P_ did not conform to the grammar, if any elements of _P_ // were not matched by the parse, or if any Early Error conditions exist. - if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { state.switchN = true; this.regexp_pattern(state); } - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern - + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern pp$1.regexp_pattern = function (state) { state.pos = 0; state.lastIntValue = 0; @@ -32138,65 +28895,48 @@ exports.version = version; state.groupNames.length = 0; state.backReferenceNames.length = 0; this.regexp_disjunction(state); - if (state.pos !== state.source.length) { // Make the same messages as V8. - if (state.eat(0x29 - /* ) */ - )) { + if (state.eat(0x29 /* ) */)) { state.raise("Unmatched ')'"); } - - if (state.eat(0x5D - /* ] */ - ) || state.eat(0x7D - /* } */ - )) { + if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) { state.raise("Lone quantifier brackets"); } } - if (state.maxBackReference > state.numCapturingParens) { state.raise("Invalid escape"); } - for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) { var name = list[i]; - if (state.groupNames.indexOf(name) === -1) { state.raise("Invalid named capture referenced"); } } - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction - + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction pp$1.regexp_disjunction = function (state) { this.regexp_alternative(state); - - while (state.eat(0x7C - /* | */ - )) { + while (state.eat(0x7C /* | */)) { this.regexp_alternative(state); - } // Make the same message as V8. - + } + // Make the same message as V8. if (this.regexp_eatQuantifier(state, true)) { state.raise("Nothing to repeat"); } - - if (state.eat(0x7B - /* { */ - )) { + if (state.eat(0x7B /* { */)) { state.raise("Lone quantifier brackets"); } - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative - + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative pp$1.regexp_alternative = function (state) { while (state.pos < state.source.length && this.regexp_eatTerm(state)) {} - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term - + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term pp$1.regexp_eatTerm = function (state) { if (this.regexp_eatAssertion(state)) { // Handle `QuantifiableAssertion Quantifier` alternative. @@ -32208,1124 +28948,715 @@ exports.version = version; state.raise("Invalid quantifier"); } } - return true; } - if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { this.regexp_eatQuantifier(state); return true; } - return false; - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion - + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion pp$1.regexp_eatAssertion = function (state) { var start = state.pos; - state.lastAssertionIsQuantifiable = false; // ^, $ + state.lastAssertionIsQuantifiable = false; - if (state.eat(0x5E - /* ^ */ - ) || state.eat(0x24 - /* $ */ - )) { + // ^, $ + if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) { return true; - } // \b \B + } - - if (state.eat(0x5C - /* \ */ - )) { - if (state.eat(0x42 - /* B */ - ) || state.eat(0x62 - /* b */ - )) { + // \b \B + if (state.eat(0x5C /* \ */)) { + if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) { return true; } - state.pos = start; - } // Lookahead / Lookbehind + } - - if (state.eat(0x28 - /* ( */ - ) && state.eat(0x3F - /* ? */ - )) { + // Lookahead / Lookbehind + if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) { var lookbehind = false; - if (this.options.ecmaVersion >= 9) { - lookbehind = state.eat(0x3C - /* < */ - ); + lookbehind = state.eat(0x3C /* < */); } - if (state.eat(0x3D - /* = */ - ) || state.eat(0x21 - /* ! */ - )) { + if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) { this.regexp_disjunction(state); - - if (!state.eat(0x29 - /* ) */ - )) { + if (!state.eat(0x29 /* ) */)) { state.raise("Unterminated group"); } - state.lastAssertionIsQuantifiable = !lookbehind; return true; } } - state.pos = start; return false; - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier - - - pp$1.regexp_eatQuantifier = function (state, noError) { - if (noError === void 0) noError = false; - - if (this.regexp_eatQuantifierPrefix(state, noError)) { - state.eat(0x3F - /* ? */ - ); - return true; - } - - return false; - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix - - - pp$1.regexp_eatQuantifierPrefix = function (state, noError) { - return state.eat(0x2A - /* * */ - ) || state.eat(0x2B - /* + */ - ) || state.eat(0x3F - /* ? */ - ) || this.regexp_eatBracedQuantifier(state, noError); }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier + pp$1.regexp_eatQuantifier = function (state, noError) { + if (noError === void 0) noError = false; + if (this.regexp_eatQuantifierPrefix(state, noError)) { + state.eat(0x3F /* ? */); + return true; + } + return false; + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix + pp$1.regexp_eatQuantifierPrefix = function (state, noError) { + return state.eat(0x2A /* * */) || state.eat(0x2B /* + */) || state.eat(0x3F /* ? */) || this.regexp_eatBracedQuantifier(state, noError); + }; pp$1.regexp_eatBracedQuantifier = function (state, noError) { var start = state.pos; - - if (state.eat(0x7B - /* { */ - )) { + if (state.eat(0x7B /* { */)) { var min = 0, - max = -1; - + max = -1; if (this.regexp_eatDecimalDigits(state)) { min = state.lastIntValue; - - if (state.eat(0x2C - /* , */ - ) && this.regexp_eatDecimalDigits(state)) { + if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) { max = state.lastIntValue; } - - if (state.eat(0x7D - /* } */ - )) { + if (state.eat(0x7D /* } */)) { // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term if (max !== -1 && max < min && !noError) { state.raise("numbers out of order in {} quantifier"); } - return true; } } - if (state.switchU && !noError) { state.raise("Incomplete quantifier"); } - state.pos = start; } - return false; - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom - - - pp$1.regexp_eatAtom = function (state) { - return this.regexp_eatPatternCharacters(state) || state.eat(0x2E - /* . */ - ) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state); }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom + pp$1.regexp_eatAtom = function (state) { + return this.regexp_eatPatternCharacters(state) || state.eat(0x2E /* . */) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state); + }; pp$1.regexp_eatReverseSolidusAtomEscape = function (state) { var start = state.pos; - - if (state.eat(0x5C - /* \ */ - )) { + if (state.eat(0x5C /* \ */)) { if (this.regexp_eatAtomEscape(state)) { return true; } - state.pos = start; } - return false; }; - pp$1.regexp_eatUncapturingGroup = function (state) { var start = state.pos; - - if (state.eat(0x28 - /* ( */ - )) { - if (state.eat(0x3F - /* ? */ - ) && state.eat(0x3A - /* : */ - )) { + if (state.eat(0x28 /* ( */)) { + if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) { this.regexp_disjunction(state); - - if (state.eat(0x29 - /* ) */ - )) { + if (state.eat(0x29 /* ) */)) { return true; } - state.raise("Unterminated group"); } - state.pos = start; } - return false; }; - pp$1.regexp_eatCapturingGroup = function (state) { - if (state.eat(0x28 - /* ( */ - )) { + if (state.eat(0x28 /* ( */)) { if (this.options.ecmaVersion >= 9) { this.regexp_groupSpecifier(state); - } else if (state.current() === 0x3F - /* ? */ - ) { + } else if (state.current() === 0x3F /* ? */) { state.raise("Invalid group"); } - this.regexp_disjunction(state); - - if (state.eat(0x29 - /* ) */ - )) { + if (state.eat(0x29 /* ) */)) { state.numCapturingParens += 1; return true; } - state.raise("Unterminated group"); } - return false; - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom - + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom pp$1.regexp_eatExtendedAtom = function (state) { - return state.eat(0x2E - /* . */ - ) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state) || this.regexp_eatInvalidBracedQuantifier(state) || this.regexp_eatExtendedPatternCharacter(state); - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier - + return state.eat(0x2E /* . */) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state) || this.regexp_eatInvalidBracedQuantifier(state) || this.regexp_eatExtendedPatternCharacter(state); + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier pp$1.regexp_eatInvalidBracedQuantifier = function (state) { if (this.regexp_eatBracedQuantifier(state, true)) { state.raise("Nothing to repeat"); } - return false; - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter - + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter pp$1.regexp_eatSyntaxCharacter = function (state) { var ch = state.current(); - if (isSyntaxCharacter(ch)) { state.lastIntValue = ch; state.advance(); return true; } - return false; }; - function isSyntaxCharacter(ch) { - return ch === 0x24 - /* $ */ - || ch >= 0x28 - /* ( */ - && ch <= 0x2B - /* + */ - || ch === 0x2E - /* . */ - || ch === 0x3F - /* ? */ - || ch >= 0x5B - /* [ */ - && ch <= 0x5E - /* ^ */ - || ch >= 0x7B - /* { */ - && ch <= 0x7D - /* } */ - ; - } // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter + return ch === 0x24 /* $ */ || ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ || ch === 0x2E /* . */ || ch === 0x3F /* ? */ || ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ || ch >= 0x7B /* { */ && ch <= 0x7D /* } */; + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter // But eat eager. - - pp$1.regexp_eatPatternCharacters = function (state) { var start = state.pos; var ch = 0; - while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { state.advance(); } - return state.pos !== start; - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter - + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter pp$1.regexp_eatExtendedPatternCharacter = function (state) { var ch = state.current(); - - if (ch !== -1 && ch !== 0x24 - /* $ */ - && !(ch >= 0x28 - /* ( */ - && ch <= 0x2B - /* + */ - ) && ch !== 0x2E - /* . */ - && ch !== 0x3F - /* ? */ - && ch !== 0x5B - /* [ */ - && ch !== 0x5E - /* ^ */ - && ch !== 0x7C - /* | */ - ) { + if (ch !== -1 && ch !== 0x24 /* $ */ && !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) && ch !== 0x2E /* . */ && ch !== 0x3F /* ? */ && ch !== 0x5B /* [ */ && ch !== 0x5E /* ^ */ && ch !== 0x7C /* | */) { state.advance(); return true; } - return false; - }; // GroupSpecifier :: + }; + + // GroupSpecifier :: // [empty] // `?` GroupName - - pp$1.regexp_groupSpecifier = function (state) { - if (state.eat(0x3F - /* ? */ - )) { + if (state.eat(0x3F /* ? */)) { if (this.regexp_eatGroupName(state)) { if (state.groupNames.indexOf(state.lastStringValue) !== -1) { state.raise("Duplicate capture group name"); } - state.groupNames.push(state.lastStringValue); return; } - state.raise("Invalid group"); } - }; // GroupName :: + }; + + // GroupName :: // `<` RegExpIdentifierName `>` // Note: this updates `state.lastStringValue` property with the eaten name. - - pp$1.regexp_eatGroupName = function (state) { state.lastStringValue = ""; - - if (state.eat(0x3C - /* < */ - )) { - if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E - /* > */ - )) { + if (state.eat(0x3C /* < */)) { + if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) { return true; } - state.raise("Invalid capture group name"); } - return false; - }; // RegExpIdentifierName :: + }; + + // RegExpIdentifierName :: // RegExpIdentifierStart // RegExpIdentifierName RegExpIdentifierPart // Note: this updates `state.lastStringValue` property with the eaten name. - - pp$1.regexp_eatRegExpIdentifierName = function (state) { state.lastStringValue = ""; - if (this.regexp_eatRegExpIdentifierStart(state)) { state.lastStringValue += codePointToString(state.lastIntValue); - while (this.regexp_eatRegExpIdentifierPart(state)) { state.lastStringValue += codePointToString(state.lastIntValue); } - return true; } - return false; - }; // RegExpIdentifierStart :: + }; + + // RegExpIdentifierStart :: // UnicodeIDStart // `$` // `_` // `\` RegExpUnicodeEscapeSequence[+U] - - pp$1.regexp_eatRegExpIdentifierStart = function (state) { var start = state.pos; var forceU = this.options.ecmaVersion >= 11; var ch = state.current(forceU); state.advance(forceU); - - if (ch === 0x5C - /* \ */ - && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { ch = state.lastIntValue; } - if (isRegExpIdentifierStart(ch)) { state.lastIntValue = ch; return true; } - state.pos = start; return false; }; - function isRegExpIdentifierStart(ch) { - return isIdentifierStart(ch, true) || ch === 0x24 - /* $ */ - || ch === 0x5F; - /* _ */ - } // RegExpIdentifierPart :: + return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F; /* _ */ + } + + // RegExpIdentifierPart :: // UnicodeIDContinue // `$` // `_` // `\` RegExpUnicodeEscapeSequence[+U] // // - - pp$1.regexp_eatRegExpIdentifierPart = function (state) { var start = state.pos; var forceU = this.options.ecmaVersion >= 11; var ch = state.current(forceU); state.advance(forceU); - - if (ch === 0x5C - /* \ */ - && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { ch = state.lastIntValue; } - if (isRegExpIdentifierPart(ch)) { state.lastIntValue = ch; return true; } - state.pos = start; return false; }; - function isRegExpIdentifierPart(ch) { - return isIdentifierChar(ch, true) || ch === 0x24 - /* $ */ - || ch === 0x5F - /* _ */ - || ch === 0x200C - /* */ - || ch === 0x200D; - /* */ - } // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape - + return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D; /* */ + } + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape pp$1.regexp_eatAtomEscape = function (state) { if (this.regexp_eatBackReference(state) || this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state) || state.switchN && this.regexp_eatKGroupName(state)) { return true; } - if (state.switchU) { // Make the same message as V8. - if (state.current() === 0x63 - /* c */ - ) { + if (state.current() === 0x63 /* c */) { state.raise("Invalid unicode escape"); } - state.raise("Invalid escape"); } - return false; }; - pp$1.regexp_eatBackReference = function (state) { var start = state.pos; - if (this.regexp_eatDecimalEscape(state)) { var n = state.lastIntValue; - if (state.switchU) { // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape if (n > state.maxBackReference) { state.maxBackReference = n; } - return true; } - if (n <= state.numCapturingParens) { return true; } - state.pos = start; } - return false; }; - pp$1.regexp_eatKGroupName = function (state) { - if (state.eat(0x6B - /* k */ - )) { + if (state.eat(0x6B /* k */)) { if (this.regexp_eatGroupName(state)) { state.backReferenceNames.push(state.lastStringValue); return true; } - state.raise("Invalid named reference"); } - return false; - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape - + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape pp$1.regexp_eatCharacterEscape = function (state) { return this.regexp_eatControlEscape(state) || this.regexp_eatCControlLetter(state) || this.regexp_eatZero(state) || this.regexp_eatHexEscapeSequence(state) || this.regexp_eatRegExpUnicodeEscapeSequence(state, false) || !state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state) || this.regexp_eatIdentityEscape(state); }; - pp$1.regexp_eatCControlLetter = function (state) { var start = state.pos; - - if (state.eat(0x63 - /* c */ - )) { + if (state.eat(0x63 /* c */)) { if (this.regexp_eatControlLetter(state)) { return true; } - state.pos = start; } - return false; }; - pp$1.regexp_eatZero = function (state) { - if (state.current() === 0x30 - /* 0 */ - && !isDecimalDigit(state.lookahead())) { + if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { state.lastIntValue = 0; state.advance(); return true; } - return false; - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape - + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape pp$1.regexp_eatControlEscape = function (state) { var ch = state.current(); - - if (ch === 0x74 - /* t */ - ) { - state.lastIntValue = 0x09; - /* \t */ - + if (ch === 0x74 /* t */) { + state.lastIntValue = 0x09; /* \t */ state.advance(); return true; } - - if (ch === 0x6E - /* n */ - ) { - state.lastIntValue = 0x0A; - /* \n */ - + if (ch === 0x6E /* n */) { + state.lastIntValue = 0x0A; /* \n */ state.advance(); return true; } - - if (ch === 0x76 - /* v */ - ) { - state.lastIntValue = 0x0B; - /* \v */ - + if (ch === 0x76 /* v */) { + state.lastIntValue = 0x0B; /* \v */ state.advance(); return true; } - - if (ch === 0x66 - /* f */ - ) { - state.lastIntValue = 0x0C; - /* \f */ - + if (ch === 0x66 /* f */) { + state.lastIntValue = 0x0C; /* \f */ state.advance(); return true; } - - if (ch === 0x72 - /* r */ - ) { - state.lastIntValue = 0x0D; - /* \r */ - + if (ch === 0x72 /* r */) { + state.lastIntValue = 0x0D; /* \r */ state.advance(); return true; } - return false; - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter - + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter pp$1.regexp_eatControlLetter = function (state) { var ch = state.current(); - if (isControlLetter(ch)) { state.lastIntValue = ch % 0x20; state.advance(); return true; } - return false; }; - function isControlLetter(ch) { - return ch >= 0x41 - /* A */ - && ch <= 0x5A - /* Z */ - || ch >= 0x61 - /* a */ - && ch <= 0x7A - /* z */ - ; - } // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence - + return ch >= 0x41 /* A */ && ch <= 0x5A /* Z */ || ch >= 0x61 /* a */ && ch <= 0x7A /* z */; + } + // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence pp$1.regexp_eatRegExpUnicodeEscapeSequence = function (state, forceU) { if (forceU === void 0) forceU = false; var start = state.pos; var switchU = forceU || state.switchU; - - if (state.eat(0x75 - /* u */ - )) { + if (state.eat(0x75 /* u */)) { if (this.regexp_eatFixedHexDigits(state, 4)) { var lead = state.lastIntValue; - if (switchU && lead >= 0xD800 && lead <= 0xDBFF) { var leadSurrogateEnd = state.pos; - - if (state.eat(0x5C - /* \ */ - ) && state.eat(0x75 - /* u */ - ) && this.regexp_eatFixedHexDigits(state, 4)) { + if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) { var trail = state.lastIntValue; - if (trail >= 0xDC00 && trail <= 0xDFFF) { state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; return true; } } - state.pos = leadSurrogateEnd; state.lastIntValue = lead; } - return true; } - - if (switchU && state.eat(0x7B - /* { */ - ) && this.regexp_eatHexDigits(state) && state.eat(0x7D - /* } */ - ) && isValidUnicode(state.lastIntValue)) { + if (switchU && state.eat(0x7B /* { */) && this.regexp_eatHexDigits(state) && state.eat(0x7D /* } */) && isValidUnicode(state.lastIntValue)) { return true; } - if (switchU) { state.raise("Invalid unicode escape"); } - state.pos = start; } - return false; }; - function isValidUnicode(ch) { return ch >= 0 && ch <= 0x10FFFF; - } // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape - + } + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape pp$1.regexp_eatIdentityEscape = function (state) { if (state.switchU) { if (this.regexp_eatSyntaxCharacter(state)) { return true; } - - if (state.eat(0x2F - /* / */ - )) { - state.lastIntValue = 0x2F; - /* / */ - + if (state.eat(0x2F /* / */)) { + state.lastIntValue = 0x2F; /* / */ return true; } - return false; } - var ch = state.current(); - - if (ch !== 0x63 - /* c */ - && (!state.switchN || ch !== 0x6B - /* k */ - )) { + if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) { state.lastIntValue = ch; state.advance(); return true; } - return false; - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape - + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape pp$1.regexp_eatDecimalEscape = function (state) { state.lastIntValue = 0; var ch = state.current(); - - if (ch >= 0x31 - /* 1 */ - && ch <= 0x39 - /* 9 */ - ) { + if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) { do { - state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 - /* 0 */ - ); + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); state.advance(); - } while ((ch = state.current()) >= 0x30 - /* 0 */ - && ch <= 0x39 - /* 9 */ - ); - + } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */); return true; } - return false; - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape - + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape pp$1.regexp_eatCharacterClassEscape = function (state) { var ch = state.current(); - if (isCharacterClassEscape(ch)) { state.lastIntValue = -1; state.advance(); return true; } - - if (state.switchU && this.options.ecmaVersion >= 9 && (ch === 0x50 - /* P */ - || ch === 0x70 - /* p */ - )) { + if (state.switchU && this.options.ecmaVersion >= 9 && (ch === 0x50 /* P */ || ch === 0x70 /* p */)) { state.lastIntValue = -1; state.advance(); - - if (state.eat(0x7B - /* { */ - ) && this.regexp_eatUnicodePropertyValueExpression(state) && state.eat(0x7D - /* } */ - )) { + if (state.eat(0x7B /* { */) && this.regexp_eatUnicodePropertyValueExpression(state) && state.eat(0x7D /* } */)) { return true; } - state.raise("Invalid property name"); } - return false; }; - function isCharacterClassEscape(ch) { - return ch === 0x64 - /* d */ - || ch === 0x44 - /* D */ - || ch === 0x73 - /* s */ - || ch === 0x53 - /* S */ - || ch === 0x77 - /* w */ - || ch === 0x57 - /* W */ - ; - } // UnicodePropertyValueExpression :: + return ch === 0x64 /* d */ || ch === 0x44 /* D */ || ch === 0x73 /* s */ || ch === 0x53 /* S */ || ch === 0x77 /* w */ || ch === 0x57 /* W */; + } + + // UnicodePropertyValueExpression :: // UnicodePropertyName `=` UnicodePropertyValue // LoneUnicodePropertyNameOrValue - - pp$1.regexp_eatUnicodePropertyValueExpression = function (state) { - var start = state.pos; // UnicodePropertyName `=` UnicodePropertyValue + var start = state.pos; - if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D - /* = */ - )) { + // UnicodePropertyName `=` UnicodePropertyValue + if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) { var name = state.lastStringValue; - if (this.regexp_eatUnicodePropertyValue(state)) { var value = state.lastStringValue; this.regexp_validateUnicodePropertyNameAndValue(state, name, value); return true; } } + state.pos = start; - state.pos = start; // LoneUnicodePropertyNameOrValue - + // LoneUnicodePropertyNameOrValue if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { var nameOrValue = state.lastStringValue; this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); return true; } - return false; }; - pp$1.regexp_validateUnicodePropertyNameAndValue = function (state, name, value) { if (!hasOwn(state.unicodeProperties.nonBinary, name)) { state.raise("Invalid property name"); } - if (!state.unicodeProperties.nonBinary[name].test(value)) { state.raise("Invalid property value"); } }; - pp$1.regexp_validateUnicodePropertyNameOrValue = function (state, nameOrValue) { if (!state.unicodeProperties.binary.test(nameOrValue)) { state.raise("Invalid property name"); } - }; // UnicodePropertyName :: + }; + + // UnicodePropertyName :: // UnicodePropertyNameCharacters - - pp$1.regexp_eatUnicodePropertyName = function (state) { var ch = 0; state.lastStringValue = ""; - while (isUnicodePropertyNameCharacter(ch = state.current())) { state.lastStringValue += codePointToString(ch); state.advance(); } - return state.lastStringValue !== ""; }; - function isUnicodePropertyNameCharacter(ch) { - return isControlLetter(ch) || ch === 0x5F; - /* _ */ - } // UnicodePropertyValue :: + return isControlLetter(ch) || ch === 0x5F; /* _ */ + } + + // UnicodePropertyValue :: // UnicodePropertyValueCharacters - - pp$1.regexp_eatUnicodePropertyValue = function (state) { var ch = 0; state.lastStringValue = ""; - while (isUnicodePropertyValueCharacter(ch = state.current())) { state.lastStringValue += codePointToString(ch); state.advance(); } - return state.lastStringValue !== ""; }; - function isUnicodePropertyValueCharacter(ch) { return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch); - } // LoneUnicodePropertyNameOrValue :: + } + + // LoneUnicodePropertyNameOrValue :: // UnicodePropertyValueCharacters - - pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function (state) { return this.regexp_eatUnicodePropertyValue(state); - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass - + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass pp$1.regexp_eatCharacterClass = function (state) { - if (state.eat(0x5B - /* [ */ - )) { - state.eat(0x5E - /* ^ */ - ); + if (state.eat(0x5B /* [ */)) { + state.eat(0x5E /* ^ */); this.regexp_classRanges(state); - - if (state.eat(0x5D - /* ] */ - )) { + if (state.eat(0x5D /* ] */)) { return true; - } // Unreachable since it threw "unterminated regular expression" error before. - - + } + // Unreachable since it threw "unterminated regular expression" error before. state.raise("Unterminated character class"); } - return false; - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash - - pp$1.regexp_classRanges = function (state) { while (this.regexp_eatClassAtom(state)) { var left = state.lastIntValue; - - if (state.eat(0x2D - /* - */ - ) && this.regexp_eatClassAtom(state)) { + if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) { var right = state.lastIntValue; - if (state.switchU && (left === -1 || right === -1)) { state.raise("Invalid character class"); } - if (left !== -1 && right !== -1 && left > right) { state.raise("Range out of order in character class"); } } } - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash - - pp$1.regexp_eatClassAtom = function (state) { var start = state.pos; - - if (state.eat(0x5C - /* \ */ - )) { + if (state.eat(0x5C /* \ */)) { if (this.regexp_eatClassEscape(state)) { return true; } - if (state.switchU) { // Make the same message as V8. var ch$1 = state.current(); - - if (ch$1 === 0x63 - /* c */ - || isOctalDigit(ch$1)) { + if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) { state.raise("Invalid class escape"); } - state.raise("Invalid escape"); } - state.pos = start; } - var ch = state.current(); - - if (ch !== 0x5D - /* ] */ - ) { + if (ch !== 0x5D /* ] */) { state.lastIntValue = ch; state.advance(); return true; } - return false; - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape - + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape pp$1.regexp_eatClassEscape = function (state) { var start = state.pos; - - if (state.eat(0x62 - /* b */ - )) { - state.lastIntValue = 0x08; - /* */ - + if (state.eat(0x62 /* b */)) { + state.lastIntValue = 0x08; /* */ return true; } - - if (state.switchU && state.eat(0x2D - /* - */ - )) { - state.lastIntValue = 0x2D; - /* - */ - + if (state.switchU && state.eat(0x2D /* - */)) { + state.lastIntValue = 0x2D; /* - */ return true; } - - if (!state.switchU && state.eat(0x63 - /* c */ - )) { + if (!state.switchU && state.eat(0x63 /* c */)) { if (this.regexp_eatClassControlLetter(state)) { return true; } - state.pos = start; } - return this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state); - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter - + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter pp$1.regexp_eatClassControlLetter = function (state) { var ch = state.current(); - - if (isDecimalDigit(ch) || ch === 0x5F - /* _ */ - ) { + if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { state.lastIntValue = ch % 0x20; state.advance(); return true; } - return false; - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence - + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence pp$1.regexp_eatHexEscapeSequence = function (state) { var start = state.pos; - - if (state.eat(0x78 - /* x */ - )) { + if (state.eat(0x78 /* x */)) { if (this.regexp_eatFixedHexDigits(state, 2)) { return true; } - if (state.switchU) { state.raise("Invalid escape"); } - state.pos = start; } - return false; - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits - + }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits pp$1.regexp_eatDecimalDigits = function (state) { var start = state.pos; var ch = 0; state.lastIntValue = 0; - while (isDecimalDigit(ch = state.current())) { - state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 - /* 0 */ - ); + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); state.advance(); } - return state.pos !== start; }; - function isDecimalDigit(ch) { - return ch >= 0x30 - /* 0 */ - && ch <= 0x39; - /* 9 */ - } // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits - + return ch >= 0x30 /* 0 */ && ch <= 0x39; /* 9 */ + } + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits pp$1.regexp_eatHexDigits = function (state) { var start = state.pos; var ch = 0; state.lastIntValue = 0; - while (isHexDigit(ch = state.current())) { state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); state.advance(); } - return state.pos !== start; }; - function isHexDigit(ch) { - return ch >= 0x30 - /* 0 */ - && ch <= 0x39 - /* 9 */ - || ch >= 0x41 - /* A */ - && ch <= 0x46 - /* F */ - || ch >= 0x61 - /* a */ - && ch <= 0x66 - /* f */ - ; + return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */ || ch >= 0x41 /* A */ && ch <= 0x46 /* F */ || ch >= 0x61 /* a */ && ch <= 0x66 /* f */; } function hexToInt(ch) { - if (ch >= 0x41 - /* A */ - && ch <= 0x46 - /* F */ - ) { - return 10 + (ch - 0x41 - /* A */ - ); + if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) { + return 10 + (ch - 0x41 /* A */); } - if (ch >= 0x61 - /* a */ - && ch <= 0x66 - /* f */ - ) { - return 10 + (ch - 0x61 - /* a */ - ); + if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) { + return 10 + (ch - 0x61 /* a */); } - return ch - 0x30; - /* 0 */ - } // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence + return ch - 0x30; /* 0 */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence // Allows only 0-377(octal) i.e. 0-255(decimal). - - pp$1.regexp_eatLegacyOctalEscapeSequence = function (state) { if (this.regexp_eatOctalDigit(state)) { var n1 = state.lastIntValue; - if (this.regexp_eatOctalDigit(state)) { var n2 = state.lastIntValue; - if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; } else { @@ -33334,101 +29665,86 @@ exports.version = version; } else { state.lastIntValue = n1; } - return true; } - - return false; - }; // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit - - - pp$1.regexp_eatOctalDigit = function (state) { - var ch = state.current(); - - if (isOctalDigit(ch)) { - state.lastIntValue = ch - 0x30; - /* 0 */ - - state.advance(); - return true; - } - - state.lastIntValue = 0; return false; }; + // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit + pp$1.regexp_eatOctalDigit = function (state) { + var ch = state.current(); + if (isOctalDigit(ch)) { + state.lastIntValue = ch - 0x30; /* 0 */ + state.advance(); + return true; + } + state.lastIntValue = 0; + return false; + }; function isOctalDigit(ch) { - return ch >= 0x30 - /* 0 */ - && ch <= 0x37; - /* 7 */ - } // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits + return ch >= 0x30 /* 0 */ && ch <= 0x37; /* 7 */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence - - pp$1.regexp_eatFixedHexDigits = function (state, length) { var start = state.pos; state.lastIntValue = 0; - for (var i = 0; i < length; ++i) { var ch = state.current(); - if (!isHexDigit(ch)) { state.pos = start; return false; } - state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); state.advance(); } - return true; - }; // Object type used to represent tokens. Note that normally, tokens + }; + + // Object type used to represent tokens. Note that normally, tokens // simply exist as properties on the parser object. This is only // used for the onToken callback and the external tokenizer. - var Token = function Token(p) { this.type = p.type; this.value = p.value; this.start = p.start; this.end = p.end; - if (p.options.locations) { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); } - if (p.options.ranges) { this.range = [p.start, p.end]; } - }; // ## Tokenizer + }; + // ## Tokenizer - var pp = Parser.prototype; // Move to the next token + var pp = Parser.prototype; + + // Move to the next token pp.next = function (ignoreEscapeSequenceInKeyword) { if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); } - if (this.options.onToken) { this.options.onToken(new Token(this)); } - this.lastTokEnd = this.end; this.lastTokStart = this.start; this.lastTokEndLoc = this.endLoc; this.lastTokStartLoc = this.startLoc; this.nextToken(); }; - pp.getToken = function () { this.next(); return new Token(this); - }; // If we're in an ES6 environment, make parsers iterable - + }; + // If we're in an ES6 environment, make parsers iterable if (typeof Symbol !== "undefined") { pp[Symbol.iterator] = function () { var this$1$1 = this; @@ -33442,126 +29758,103 @@ exports.version = version; } }; }; - } // Toggle strict mode. Re-reads the next number or string to please + } + + // Toggle strict mode. Re-reads the next number or string to please // pedantic tests (`"use strict"; 010;` should fail). + // Read a single token, updating the parser object's token-related // properties. - pp.nextToken = function () { var curContext = this.curContext(); - if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } - this.start = this.pos; - if (this.options.locations) { this.startLoc = this.curPosition(); } - if (this.pos >= this.input.length) { return this.finishToken(types$1.eof); } - if (curContext.override) { return curContext.override(this); } else { this.readToken(this.fullCharCodeAtPos()); } }; - pp.readToken = function (code) { // Identifier or keyword. '\uXXXX' sequences are allowed in // identifiers, so '\' also dispatches to that. - if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 - /* '\' */ - ) { + if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) { return this.readWord(); } - return this.getTokenFromCode(code); }; - pp.fullCharCodeAtPos = function () { var code = this.input.charCodeAt(this.pos); - if (code <= 0xd7ff || code >= 0xdc00) { return code; } - var next = this.input.charCodeAt(this.pos + 1); return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00; }; - pp.skipBlockComment = function () { var startLoc = this.options.onComment && this.curPosition(); var start = this.pos, - end = this.input.indexOf("*/", this.pos += 2); - + end = this.input.indexOf("*/", this.pos += 2); if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); } - this.pos = end + 2; - if (this.options.locations) { for (var nextBreak = void 0, pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) { ++this.curLine; pos = this.lineStart = nextBreak; } } - if (this.options.onComment) { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos, startLoc, this.curPosition()); } }; - pp.skipLineComment = function (startSkip) { var start = this.pos; var startLoc = this.options.onComment && this.curPosition(); var ch = this.input.charCodeAt(this.pos += startSkip); - while (this.pos < this.input.length && !isNewLine(ch)) { ch = this.input.charCodeAt(++this.pos); } - if (this.options.onComment) { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos, startLoc, this.curPosition()); } - }; // Called at the start of the parse and after every token. Skips - // whitespace and comments, and. + }; + // Called at the start of the parse and after every token. Skips + // whitespace and comments, and. pp.skipSpace = function () { loop: while (this.pos < this.input.length) { var ch = this.input.charCodeAt(this.pos); - switch (ch) { case 32: case 160: // ' ' ++this.pos; break; - case 13: if (this.input.charCodeAt(this.pos + 1) === 10) { ++this.pos; } - case 10: case 8232: case 8233: ++this.pos; - if (this.options.locations) { ++this.curLine; this.lineStart = this.pos; } - break; - case 47: // '/' switch (this.input.charCodeAt(this.pos + 1)) { @@ -33569,44 +29862,41 @@ exports.version = version; // '*' this.skipBlockComment(); break; - case 47: this.skipLineComment(2); break; - default: break loop; } - break; - default: if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { ++this.pos; } else { break loop; } - } } - }; // Called at the end of every token. Sets `end`, `val`, and + }; + + // Called at the end of every token. Sets `end`, `val`, and // maintains `context` and `exprAllowed`, and skips the space after // the token, so that the next one's `start` will point at the // right position. - pp.finishToken = function (type, val) { this.end = this.pos; - if (this.options.locations) { this.endLoc = this.curPosition(); } - var prevType = this.type; this.type = type; this.value = val; this.updateContext(prevType); - }; // ### Token reading + }; + + // ### Token reading + // This is the function that is called to fetch the next token. It // is somewhat obscure, because it works in character codes rather // than characters, and because operator parsing has been inlined @@ -33614,17 +29904,12 @@ exports.version = version; // // All in the name of speed. // - - pp.readToken_dot = function () { var next = this.input.charCodeAt(this.pos + 1); - if (next >= 48 && next <= 57) { return this.readNumber(true); } - var next2 = this.input.charCodeAt(this.pos + 2); - if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' this.pos += 3; @@ -33634,80 +29919,63 @@ exports.version = version; return this.finishToken(types$1.dot); } }; - pp.readToken_slash = function () { // '/' var next = this.input.charCodeAt(this.pos + 1); - if (this.exprAllowed) { ++this.pos; return this.readRegexp(); } - if (next === 61) { return this.finishOp(types$1.assign, 2); } - return this.finishOp(types$1.slash, 1); }; - pp.readToken_mult_modulo_exp = function (code) { // '%*' var next = this.input.charCodeAt(this.pos + 1); var size = 1; - var tokentype = code === 42 ? types$1.star : types$1.modulo; // exponentiation operator ** and **= + var tokentype = code === 42 ? types$1.star : types$1.modulo; + // exponentiation operator ** and **= if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { ++size; tokentype = types$1.starstar; next = this.input.charCodeAt(this.pos + 2); } - if (next === 61) { return this.finishOp(types$1.assign, size + 1); } - return this.finishOp(tokentype, size); }; - pp.readToken_pipe_amp = function (code) { // '|&' var next = this.input.charCodeAt(this.pos + 1); - if (next === code) { if (this.options.ecmaVersion >= 12) { var next2 = this.input.charCodeAt(this.pos + 2); - if (next2 === 61) { return this.finishOp(types$1.assign, 3); } } - return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2); } - if (next === 61) { return this.finishOp(types$1.assign, 2); } - return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1); }; - pp.readToken_caret = function () { // '^' var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) { return this.finishOp(types$1.assign, 2); } - return this.finishOp(types$1.bitwiseXOR, 1); }; - pp.readToken_plus_min = function (code) { // '+-' var next = this.input.charCodeAt(this.pos + 1); - if (next === code) { if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { // A `-->` line comment @@ -33715,113 +29983,84 @@ exports.version = version; this.skipSpace(); return this.nextToken(); } - return this.finishOp(types$1.incDec, 2); } - if (next === 61) { return this.finishOp(types$1.assign, 2); } - return this.finishOp(types$1.plusMin, 1); }; - pp.readToken_lt_gt = function (code) { // '<>' var next = this.input.charCodeAt(this.pos + 1); var size = 1; - if (next === code) { size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1); } - return this.finishOp(types$1.bitShift, size); } - if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45) { // ` {"no-alert": "2 no-console: 2"} // Should ignore that case as well. - if (ConfigOps.isEverySeverityValid(items)) { return { success: true, @@ -55411,17 +49257,17 @@ module.exports = class ConfigCommentParser { }; } } catch { - debug("Levn parsing failed; falling back to manual parsing."); // ignore to parse the string by a fallback. + 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) { @@ -55434,61 +49280,55 @@ module.exports = class ConfigCommentParser { severity: 2, message: `Failed to parse JSON from '${normalizedString}': ${ex.message}`, line: location.start.line, - column: location.start.column + 1 + column: location.start.column + 1, + nodeType: null } }; } - 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 = {}; string.split(",").forEach(name => { const trimmedName = name.trim(); - if (trimmedName) { items[trimmedName] = true; } }); return items; } - }; /***/ }), -/* 597 */ +/* 618 */ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { // Generated by LiveScript 1.6.0 (function () { var parseString, cast, parseType, VERSION, parsedTypeParse, parse; - parseString = __webpack_require__(598); - cast = __webpack_require__(605); - parseType = (__webpack_require__(606).parseType); + parseString = __webpack_require__(619); + cast = __webpack_require__(626); + parseType = (__webpack_require__(627).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, @@ -55497,14 +49337,13 @@ module.exports = class ConfigCommentParser { }).call(this); /***/ }), -/* 598 */ +/* 619 */ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { // Generated by LiveScript 1.6.0 (function () { var reject, special, tokenRegex; - reject = (__webpack_require__(599).reject); - + reject = (__webpack_require__(620).reject); function consumeOp(tokens, op) { if (tokens[0] === op) { return tokens.shift(); @@ -55512,173 +49351,137 @@ module.exports = class ConfigCommentParser { 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); /***/ }), -/* 599 */ +/* 620 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Generated by LiveScript 1.6.0 var Func, - List, - Obj, - Str, - Num, - id, - isType, - replicate, - prelude, - toString$ = {}.toString; -Func = __webpack_require__(600); -List = __webpack_require__(601); -Obj = __webpack_require__(602); -Str = __webpack_require__(603); -Num = __webpack_require__(604); - + List, + Obj, + Str, + Num, + id, + isType, + replicate, + prelude, + toString$ = {}.toString; +Func = __webpack_require__(621); +List = __webpack_require__(622); +Obj = __webpack_require__(623); +Str = __webpack_require__(624); +Num = __webpack_require__(625); 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$ = []; - + results$ = []; for (i$ = 0; i$ < n; ++i$) { results$.push(x); } - return results$; }); Str.empty = List.empty; @@ -55826,44 +49629,39 @@ 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; - }; - + _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(); } /***/ }), -/* 600 */ +/* 621 */ /***/ ((module) => { // Generated by LiveScript 1.6.0 var apply, - curry, - flip, - fix, - over, - memoize, - toString$ = {}.toString; + 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 () { @@ -55875,42 +49673,33 @@ fix = function (f) { }; }); }; - 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$ = []; - + 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, @@ -55919,282 +49708,240 @@ module.exports = { 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; - }; - + _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(); } /***/ }), -/* 601 */ +/* 622 */ /***/ ((module) => { // 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; + 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$ = []; - + 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$ = []; - + 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$ = []; - + 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$ = []; - + 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$ = []; + 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) { @@ -56202,12 +49949,10 @@ fold1 = foldl1 = curry$(function (f, xs) { }); 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) { @@ -56217,230 +49962,174 @@ 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$ = []; - + 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$ = []; - + 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) { @@ -56452,7 +50141,6 @@ sort = function (xs) { } }); }; - sortWith = curry$(function (f, xs) { return xs.concat().sort(f); }); @@ -56467,99 +50155,75 @@ sortBy = curry$(function (f, xs) { } }); }); - 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) { @@ -56567,15 +50231,13 @@ scan = scanl = curry$(function (f, memo, xs) { last = memo; return [memo].concat(function () { var i$, - ref$, - len$, - results$ = []; - + ref$, + len$, + results$ = []; for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) { x = ref$[i$]; results$.push(last = f(last, x)); } - return results$; }()); }); @@ -56583,7 +50245,6 @@ scan1 = scanl1 = curry$(function (f, xs) { if (!xs.length) { return; } - return scan(f, xs[0], xs.slice(1)); }); scanr = curry$(function (f, memo, xs) { @@ -56594,7 +50255,6 @@ scanr1 = curry$(function (f, xs) { if (!xs.length) { return; } - xs = xs.concat().reverse(); return scan(f, xs[0], xs.slice(1)).reverse(); }); @@ -56621,33 +50281,25 @@ splitAt = curry$(function (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) { @@ -56660,128 +50312,102 @@ 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$, + 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$, + 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$ = []; - + 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]; @@ -56791,11 +50417,9 @@ at = curry$(function (n, xs) { }); 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; } @@ -56803,29 +50427,24 @@ elemIndex = curry$(function (el, xs) { }); elemIndices = curry$(function (el, xs) { var i$, - len$, - i, - x, - results$ = []; - + 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; } @@ -56833,20 +50452,17 @@ findIndex = curry$(function (f, xs) { }); findIndices = curry$(function (f, xs) { var i$, - len$, - i, - x, - results$ = []; - + 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 = { @@ -56921,232 +50537,182 @@ module.exports = { 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; - }; - + _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; - + 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; } /***/ }), -/* 602 */ +/* 623 */ /***/ ((module) => { // 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$ = []; - + x, + results$ = []; for (i$ in object) { x = object[i$]; results$.push(x); } - return results$; }; - keys = function (object) { var x, - results$ = []; - + results$ = []; for (x in object) { results$.push(x); } - return results$; }; - pairsToObj = function (object) { var i$, - len$, - x, - resultObj$ = {}; - + 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$ = []; - + 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$ = {}; - + 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$ = {}; - + x, + resultObj$ = {}; for (k in object) { x = object[k]; resultObj$[k] = f(x); } - return resultObj$; }); - compact = function (object) { var k, - x, - resultObj$ = {}; - + 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$ = {}; - + 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$ = {}; - + 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; } @@ -57168,22 +50734,20 @@ module.exports = { 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; - }; - + _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(); } /***/ }), -/* 603 */ +/* 624 */ /***/ ((module) => { // Generated by LiveScript 1.6.0 @@ -57194,64 +50758,49 @@ split = curry$(function (sep, str) { 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()); @@ -57263,7 +50812,6 @@ dasherize = function (str) { } }); }; - module.exports = { split: split, join: join, @@ -57279,22 +50827,20 @@ module.exports = { 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; - }; - + _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(); } /***/ }), -/* 604 */ +/* 625 */ /***/ ((module) => { // Generated by LiveScript 1.6.0 @@ -57305,13 +50851,10 @@ max = curry$(function (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; @@ -57321,7 +50864,6 @@ signum = function (x) { return 0; } }; - quot = curry$(function (x, y) { return ~~(x / y); }); @@ -57335,11 +50877,9 @@ 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; @@ -57357,38 +50897,30 @@ 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) { @@ -57428,30 +50960,28 @@ module.exports = { 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; - }; - + _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(); } /***/ }), -/* 605 */ +/* 626 */ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { // Generated by LiveScript 1.6.0 (function () { var parsedTypeCheck, - types, - toString$ = {}.toString; - parsedTypeCheck = (__webpack_require__(606).parsedTypeCheck); + types, + toString$ = {}.toString; + parsedTypeCheck = (__webpack_require__(627).parsedTypeCheck); types = { '*': function (value, options) { switch (toString$.call(value).slice(8, -1)) { @@ -57459,12 +50989,10 @@ function curry$(f, bound) { return typeCast(value, { type: 'Array' }, options); - case 'Object': return typeCast(value, { type: 'Object' }, options); - default: return { type: 'Just', @@ -57565,7 +51093,6 @@ function curry$(f, bound) { }, Date: function (value, options) { var that; - if (that = /^\#([\s\S]*)\#$/.exec(value)) { return { type: 'Just', @@ -57584,7 +51111,6 @@ function curry$(f, bound) { }, RegExp: function (value, options) { var that; - if (that = /^\/([\s\S]*)\/([gimy]*)$/.exec(value)) { return { type: 'Just', @@ -57615,46 +51141,35 @@ function curry$(f, bound) { }, 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', @@ -57673,58 +51188,46 @@ function curry$(f, bound) { } } }; - 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$ = []; - + 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', @@ -57736,23 +51239,19 @@ function curry$(f, bound) { }; } } - 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$ = {}; - + resultObj$ = {}; for (key in ref$ = node) { value = ref$[key]; resultObj$[typesCast(key, [{ @@ -57761,83 +51260,67 @@ function curry$(f, bound) { 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); /***/ }), -/* 606 */ +/* 627 */ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { // Generated by LiveScript 1.6.0 (function () { var VERSION, parseType, parsedTypeCheck, typeCheck; VERSION = '0.4.0'; - parseType = __webpack_require__(607); - parsedTypeCheck = __webpack_require__(608); - + parseType = __webpack_require__(628); + parsedTypeCheck = __webpack_require__(629); typeCheck = function (type, input, options) { return parsedTypeCheck(parseType(type), input, options); }; - module.exports = { VERSION: VERSION, typeCheck: typeCheck, @@ -57847,66 +51330,52 @@ function curry$(f, bound) { }).call(this); /***/ }), -/* 607 */ +/* 628 */ /***/ (function(module) { // 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 { @@ -57914,53 +51383,43 @@ function curry$(f, bound) { 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', @@ -57968,7 +51427,6 @@ function curry$(f, bound) { subset: subset }; } - function consumeField(tokens) { var key, types; key = consumeIdent(tokens); @@ -57976,29 +51434,23 @@ function curry$(f, bound) { 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 { @@ -58008,32 +51460,24 @@ function curry$(f, bound) { } } 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 = [{ @@ -58046,41 +51490,30 @@ function curry$(f, bound) { 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$) { @@ -58088,31 +51521,28 @@ function curry$(f, bound) { throw new Error(e.message + " - Remaining tokens: " + JSON.stringify(tokens) + " - Initial input: '" + input + "'"); } }; - function in$(x, xs) { var i = -1, - l = xs.length >>> 0; - + l = xs.length >>> 0; while (++i < l) if (x === xs[i]) return true; - return false; } }).call(this); /***/ }), -/* 608 */ +/* 629 */ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { // Generated by LiveScript 1.6.0 (function () { var ref$, - any, - all, - isItNaN, - types, - defaultType, - toString$ = {}.toString; - ref$ = __webpack_require__(599), any = ref$.any, all = ref$.all, isItNaN = ref$.isItNaN; + any, + all, + isItNaN, + types, + defaultType, + toString$ = {}.toString; + ref$ = __webpack_require__(620), any = ref$.any, all = ref$.all, isItNaN = ref$.isItNaN; types = { Number: { typeOf: 'Number', @@ -58147,85 +51577,64 @@ function curry$(f, bound) { 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 { @@ -58237,36 +51646,30 @@ function curry$(f, bound) { 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); /***/ }), -/* 609 */ +/* 630 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -58274,11 +51677,15 @@ function curry$(f, bound) { * @fileoverview The event generator for AST nodes. * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const esquery = __webpack_require__(631); -const esquery = __webpack_require__(610); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Typedefs //------------------------------------------------------------------------------ @@ -58293,6 +51700,7 @@ const esquery = __webpack_require__(610); //------------------------------------ * @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 //------------------------------------------------------------------------------ @@ -58302,102 +51710,84 @@ const esquery = __webpack_require__(610); //------------------------------------ * @param {...any[]} arrays One or more arrays to union * @returns {any[]} The union of the input arrays */ - - function union() { for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) { arrays[_key] = arguments[_key]; } - return [...new Set(arrays.flat())]; } + /** * Computes the intersection of one or more arrays * @param {...any[]} arrays One or more arrays to intersect * @returns {any[]} The intersection of the input arrays */ - - function intersection() { for (var _len2 = arguments.length, arrays = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { arrays[_key2] = arguments[_key2]; } - if (arrays.length === 0) { return []; } - let result = [...new Set(arrays[0])]; - for (const array of arrays.slice(1)) { result = result.filter(x => array.includes(x)); } - return result; } + /** * 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 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. + 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 intersection(...typesForComponents); } - case "child": case "descendant": case "sibling": case "adjacent": return getPossibleTypes(parsedSelector.right); - case "class": if (parsedSelector.name === "function") { return ["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"]; } - return null; - 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": @@ -58405,29 +51795,25 @@ function countClassAttributes(parsedSelector) { 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": @@ -58435,19 +51821,17 @@ function countIdentifiers(parsedSelector) { 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 @@ -58458,19 +51842,16 @@ function countIdentifiers(parsedSelector) { * 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, "")); @@ -58478,23 +51859,20 @@ function tryParseSelector(rawSelector) { 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; } } - const selectorCache = new Map(); + /** * 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 */ - function parseSelector(rawSelector) { if (selectorCache.has(rawSelector)) { return selectorCache.get(rawSelector); } - const parsedSelector = tryParseSelector(rawSelector); const result = { rawSelector, @@ -58506,7 +51884,9 @@ function parseSelector(rawSelector) { }; selectorCache.set(rawSelector, result); return result; -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ @@ -58522,8 +51902,6 @@ function parseSelector(rawSelector) { * } * ``` */ - - class NodeEventGenerator { /** * @param {SafeEmitter} emitter @@ -58543,19 +51921,16 @@ class NodeEventGenerator { 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); }); @@ -58564,38 +51939,35 @@ class NodeEventGenerator { 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.esqueryOptions)) { 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++]); @@ -58604,38 +51976,33 @@ class NodeEventGenerator { } } } + /** * 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; /***/ }), -/* 610 */ +/* 631 */ /***/ (function(module) { !function (e, t) { @@ -58650,45 +52017,48 @@ module.exports = NodeEventGenerator; return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; })(t); } - function t(e, t) { return function (e) { if (Array.isArray(e)) return e; }(e) || function (e, t) { - if ("undefined" == typeof Symbol || !(Symbol.iterator in Object(e))) return; - var r = [], - n = !0, - o = !1, - a = void 0; - - try { - for (var i, s = e[Symbol.iterator](); !(n = (i = s.next()).done) && (r.push(i.value), !t || r.length !== t); n = !0); - } catch (e) { - o = !0, a = e; - } finally { + var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"]; + if (null != r) { + var n, + o, + a, + i, + s = [], + u = !0, + l = !1; try { - n || null == s.return || s.return(); + if (a = (r = r.call(e)).next, 0 === t) { + if (Object(r) !== r) return; + u = !1; + } else for (; !(u = (n = a.call(r)).done) && (s.push(n.value), s.length !== t); u = !0); + } catch (e) { + l = !0, o = e; } finally { - if (o) throw a; + try { + if (!u && null != r.return && (i = r.return(), Object(i) !== i)) return; + } finally { + if (l) throw o; + } } + return s; } - - return r; }(e, t) || n(e, t) || function () { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }(); } - function r(e) { return function (e) { if (Array.isArray(e)) return o(e); }(e) || function (e) { - if ("undefined" != typeof Symbol && Symbol.iterator in Object(e)) return Array.from(e); + if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e); }(e) || n(e) || function () { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }(); } - function n(e, t) { if (e) { if ("string" == typeof e) return o(e, t); @@ -58696,1611 +52066,1359 @@ module.exports = NodeEventGenerator; return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? o(e, t) : void 0; } } - function o(e, t) { (null == t || t > e.length) && (t = e.length); - for (var r = 0, n = new Array(t); r < t; r++) n[r] = e[r]; - return n; } - - function a(e, t) { - var r; - - if ("undefined" == typeof Symbol || null == e[Symbol.iterator]) { - if (Array.isArray(e) || (r = n(e)) || t && e && "number" == typeof e.length) { - r && (e = r); - - var o = 0, - a = function () {}; - - return { - s: a, - n: function () { - return o >= e.length ? { - done: !0 - } : { - done: !1, - value: e[o++] - }; - }, - e: function (e) { - throw e; - }, - f: a - }; - } - - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - var i, - s = !0, - l = !1; - return { - s: function () { - r = e[Symbol.iterator](); - }, - n: function () { - var e = r.next(); - return s = e.done, e; - }, - e: function (e) { - l = !0, i = e; - }, - f: function () { - try { - s || null == r.return || r.return(); - } finally { - if (l) throw i; - } - } - }; - } - "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self; - - function i(e, t) { + function a(e, t) { return e(t = { exports: {} }, t.exports), t.exports; } - - var s = i(function (e, t) { - !function e(t) { - var r, n, o, a, i, s; - - function l(e) { - var t, + var i = a(function (e, t) { + !function e(t) { + var r, n, o, a, i, s; + function u(e) { + var t, r, n = {}; - - for (t in e) e.hasOwnProperty(t) && (r = e[t], n[t] = "object" == typeof r && null !== r ? l(r) : r); - - return n; - } - - function u(e, t) { - this.parent = e, this.key = t; - } - - function c(e, t, r, n) { - this.node = e, this.path = t, this.wrap = r, this.ref = n; - } - - function f() {} - - function p(e) { - return null != e && "object" == typeof e && "string" == typeof e.type; - } - - function h(e, t) { - return (e === r.ObjectExpression || e === r.ObjectPattern) && "properties" === t; - } - - function y(e, t) { - for (var r = e.length - 1; r >= 0; --r) if (e[r].node === t) return !0; - - return !1; - } - - function d(e, t) { - return new f().traverse(e, t); - } - - function m(e, t) { - var r; - return r = function (e, t) { - var r, n, o, a; - - for (n = e.length, o = 0; n;) t(e[a = o + (r = n >>> 1)]) ? n = r : (o = a + 1, n -= r + 1); - - return o; - }(t, function (t) { - return t.range[0] > e.range[0]; - }), e.extendedRange = [e.range[0], e.range[1]], r !== t.length && (e.extendedRange[1] = t[r].range[0]), (r -= 1) >= 0 && (e.extendedRange[0] = t[r].range[1]), e; - } - - return r = { - AssignmentExpression: "AssignmentExpression", - AssignmentPattern: "AssignmentPattern", - ArrayExpression: "ArrayExpression", - ArrayPattern: "ArrayPattern", - ArrowFunctionExpression: "ArrowFunctionExpression", - AwaitExpression: "AwaitExpression", - BlockStatement: "BlockStatement", - BinaryExpression: "BinaryExpression", - BreakStatement: "BreakStatement", - CallExpression: "CallExpression", - CatchClause: "CatchClause", - ChainExpression: "ChainExpression", - ClassBody: "ClassBody", - ClassDeclaration: "ClassDeclaration", - ClassExpression: "ClassExpression", - ComprehensionBlock: "ComprehensionBlock", - ComprehensionExpression: "ComprehensionExpression", - ConditionalExpression: "ConditionalExpression", - ContinueStatement: "ContinueStatement", - DebuggerStatement: "DebuggerStatement", - DirectiveStatement: "DirectiveStatement", - DoWhileStatement: "DoWhileStatement", - EmptyStatement: "EmptyStatement", - ExportAllDeclaration: "ExportAllDeclaration", - ExportDefaultDeclaration: "ExportDefaultDeclaration", - ExportNamedDeclaration: "ExportNamedDeclaration", - ExportSpecifier: "ExportSpecifier", - ExpressionStatement: "ExpressionStatement", - ForStatement: "ForStatement", - ForInStatement: "ForInStatement", - ForOfStatement: "ForOfStatement", - FunctionDeclaration: "FunctionDeclaration", - FunctionExpression: "FunctionExpression", - GeneratorExpression: "GeneratorExpression", - Identifier: "Identifier", - IfStatement: "IfStatement", - ImportExpression: "ImportExpression", - ImportDeclaration: "ImportDeclaration", - ImportDefaultSpecifier: "ImportDefaultSpecifier", - ImportNamespaceSpecifier: "ImportNamespaceSpecifier", - ImportSpecifier: "ImportSpecifier", - Literal: "Literal", - LabeledStatement: "LabeledStatement", - LogicalExpression: "LogicalExpression", - MemberExpression: "MemberExpression", - MetaProperty: "MetaProperty", - MethodDefinition: "MethodDefinition", - ModuleSpecifier: "ModuleSpecifier", - NewExpression: "NewExpression", - ObjectExpression: "ObjectExpression", - ObjectPattern: "ObjectPattern", - Program: "Program", - Property: "Property", - RestElement: "RestElement", - ReturnStatement: "ReturnStatement", - SequenceExpression: "SequenceExpression", - SpreadElement: "SpreadElement", - Super: "Super", - SwitchStatement: "SwitchStatement", - SwitchCase: "SwitchCase", - TaggedTemplateExpression: "TaggedTemplateExpression", - TemplateElement: "TemplateElement", - TemplateLiteral: "TemplateLiteral", - ThisExpression: "ThisExpression", - ThrowStatement: "ThrowStatement", - TryStatement: "TryStatement", - UnaryExpression: "UnaryExpression", - UpdateExpression: "UpdateExpression", - VariableDeclaration: "VariableDeclaration", - VariableDeclarator: "VariableDeclarator", - WhileStatement: "WhileStatement", - WithStatement: "WithStatement", - YieldExpression: "YieldExpression" - }, o = { - AssignmentExpression: ["left", "right"], - AssignmentPattern: ["left", "right"], - ArrayExpression: ["elements"], - ArrayPattern: ["elements"], - ArrowFunctionExpression: ["params", "body"], - AwaitExpression: ["argument"], - BlockStatement: ["body"], - BinaryExpression: ["left", "right"], - BreakStatement: ["label"], - CallExpression: ["callee", "arguments"], - CatchClause: ["param", "body"], - ChainExpression: ["expression"], - ClassBody: ["body"], - ClassDeclaration: ["id", "superClass", "body"], - ClassExpression: ["id", "superClass", "body"], - ComprehensionBlock: ["left", "right"], - ComprehensionExpression: ["blocks", "filter", "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"], - GeneratorExpression: ["blocks", "filter", "body"], - Identifier: [], - IfStatement: ["test", "consequent", "alternate"], - ImportExpression: ["source"], - ImportDeclaration: ["specifiers", "source"], - ImportDefaultSpecifier: ["local"], - ImportNamespaceSpecifier: ["local"], - ImportSpecifier: ["imported", "local"], - Literal: [], - LabeledStatement: ["label", "body"], - LogicalExpression: ["left", "right"], - MemberExpression: ["object", "property"], - MetaProperty: ["meta", "property"], - MethodDefinition: ["key", "value"], - ModuleSpecifier: [], - NewExpression: ["callee", "arguments"], - ObjectExpression: ["properties"], - ObjectPattern: ["properties"], - Program: ["body"], - Property: ["key", "value"], - RestElement: ["argument"], - ReturnStatement: ["argument"], - SequenceExpression: ["expressions"], - SpreadElement: ["argument"], - Super: [], - SwitchStatement: ["discriminant", "cases"], - SwitchCase: ["test", "consequent"], - TaggedTemplateExpression: ["tag", "quasi"], - TemplateElement: [], - TemplateLiteral: ["quasis", "expressions"], - ThisExpression: [], - ThrowStatement: ["argument"], - TryStatement: ["block", "handler", "finalizer"], - UnaryExpression: ["argument"], - UpdateExpression: ["argument"], - VariableDeclaration: ["declarations"], - VariableDeclarator: ["id", "init"], - WhileStatement: ["test", "body"], - WithStatement: ["object", "body"], - YieldExpression: ["argument"] - }, n = { - Break: a = {}, - Skip: i = {}, - Remove: s = {} - }, u.prototype.replace = function (e) { - this.parent[this.key] = e; - }, u.prototype.remove = function () { - return Array.isArray(this.parent) ? (this.parent.splice(this.key, 1), !0) : (this.replace(null), !1); - }, f.prototype.path = function () { - var e, t, r, n, o; - - function a(e, t) { - if (Array.isArray(t)) for (r = 0, n = t.length; r < n; ++r) e.push(t[r]);else e.push(t); + for (t in e) e.hasOwnProperty(t) && (r = e[t], n[t] = "object" == typeof r && null !== r ? u(r) : r); + return n; } - - if (!this.__current.path) return null; - - for (o = [], e = 2, t = this.__leavelist.length; e < t; ++e) a(o, this.__leavelist[e].path); - - return a(o, this.__current.path), o; - }, f.prototype.type = function () { - return this.current().type || this.__current.wrap; - }, f.prototype.parents = function () { - var e, t, r; - - for (r = [], e = 1, t = this.__leavelist.length; e < t; ++e) r.push(this.__leavelist[e].node); - - return r; - }, f.prototype.current = function () { - return this.__current.node; - }, f.prototype.__execute = function (e, t) { - var r, n; - return n = void 0, r = this.__current, this.__current = t, this.__state = null, e && (n = e.call(this, t.node, this.__leavelist[this.__leavelist.length - 1].node)), this.__current = r, n; - }, f.prototype.notify = function (e) { - this.__state = e; - }, f.prototype.skip = function () { - this.notify(i); - }, f.prototype.break = function () { - this.notify(a); - }, f.prototype.remove = function () { - this.notify(s); - }, f.prototype.__initialize = function (e, t) { - this.visitor = t, this.root = e, this.__worklist = [], this.__leavelist = [], this.__current = null, this.__state = null, this.__fallback = null, "iteration" === t.fallback ? this.__fallback = Object.keys : "function" == typeof t.fallback && (this.__fallback = t.fallback), this.__keys = o, t.keys && (this.__keys = Object.assign(Object.create(this.__keys), t.keys)); - }, f.prototype.traverse = function (e, t) { - var r, n, o, s, l, u, f, d, m, x, v, g; - - for (this.__initialize(e, t), g = {}, r = this.__worklist, n = this.__leavelist, r.push(new c(e, null, null, null)), n.push(new c(null, null, null, null)); r.length;) if ((o = r.pop()) !== g) { - if (o.node) { - if (u = this.__execute(t.enter, o), this.__state === a || u === a) return; - if (r.push(g), n.push(o), this.__state === i || u === i) continue; - - if (l = (s = o.node).type || o.wrap, !(x = this.__keys[l])) { - if (!this.__fallback) throw new Error("Unknown node type " + l + "."); - x = this.__fallback(s); - } - - for (d = x.length; (d -= 1) >= 0;) if (v = s[f = x[d]]) if (Array.isArray(v)) { - for (m = v.length; (m -= 1) >= 0;) if (v[m] && !y(n, v[m])) { - if (h(l, x[d])) o = new c(v[m], [f, m], "Property", null);else { - if (!p(v[m])) continue; - o = new c(v[m], [f, m], null, null); - } - r.push(o); - } - } else if (p(v)) { - if (y(n, v)) continue; - r.push(new c(v, f, null, null)); - } - } - } else if (o = n.pop(), u = this.__execute(t.leave, o), this.__state === a || u === a) return; - }, f.prototype.replace = function (e, t) { - var r, n, o, l, f, y, d, m, x, v, g, b, A; - - function E(e) { - var t, n, o, a; - if (e.ref.remove()) for (n = e.ref.key, a = e.ref.parent, t = r.length; t--;) if ((o = r[t]).ref && o.ref.parent === a) { - if (o.ref.key < n) break; - --o.ref.key; - } + function l(e, t) { + this.parent = e, this.key = t; } - - for (this.__initialize(e, t), g = {}, r = this.__worklist, n = this.__leavelist, y = new c(e, null, null, new u(b = { - root: e - }, "root")), r.push(y), n.push(y); r.length;) if ((y = r.pop()) !== g) { - if (void 0 !== (f = this.__execute(t.enter, y)) && f !== a && f !== i && f !== s && (y.ref.replace(f), y.node = f), this.__state !== s && f !== s || (E(y), y.node = null), this.__state === a || f === a) return b.root; - - if ((o = y.node) && (r.push(g), n.push(y), this.__state !== i && f !== i)) { - if (l = o.type || y.wrap, !(x = this.__keys[l])) { - if (!this.__fallback) throw new Error("Unknown node type " + l + "."); - x = this.__fallback(o); - } - - for (d = x.length; (d -= 1) >= 0;) if (v = o[A = x[d]]) if (Array.isArray(v)) { - for (m = v.length; (m -= 1) >= 0;) if (v[m]) { - if (h(l, x[d])) y = new c(v[m], [A, m], "Property", new u(v, m));else { - if (!p(v[m])) continue; - y = new c(v[m], [A, m], null, new u(v, m)); - } - r.push(y); - } - } else p(v) && r.push(new c(v, A, null, new u(o, A))); + function c(e, t, r, n) { + this.node = e, this.path = t, this.wrap = r, this.ref = n; + } + function f() {} + function p(e) { + return null != e && "object" == typeof e && "string" == typeof e.type; + } + function h(e, t) { + return (e === r.ObjectExpression || e === r.ObjectPattern) && "properties" === t; + } + function y(e, t) { + for (var r = e.length - 1; r >= 0; --r) if (e[r].node === t) return !0; + return !1; + } + function d(e, t) { + return new f().traverse(e, t); + } + function m(e, t) { + var r; + return r = function (e, t) { + var r, n, o, a; + for (n = e.length, o = 0; n;) t(e[a = o + (r = n >>> 1)]) ? n = r : (o = a + 1, n -= r + 1); + return o; + }(t, function (t) { + return t.range[0] > e.range[0]; + }), e.extendedRange = [e.range[0], e.range[1]], r !== t.length && (e.extendedRange[1] = t[r].range[0]), (r -= 1) >= 0 && (e.extendedRange[0] = t[r].range[1]), e; + } + return r = { + AssignmentExpression: "AssignmentExpression", + AssignmentPattern: "AssignmentPattern", + ArrayExpression: "ArrayExpression", + ArrayPattern: "ArrayPattern", + ArrowFunctionExpression: "ArrowFunctionExpression", + AwaitExpression: "AwaitExpression", + BlockStatement: "BlockStatement", + BinaryExpression: "BinaryExpression", + BreakStatement: "BreakStatement", + CallExpression: "CallExpression", + CatchClause: "CatchClause", + ChainExpression: "ChainExpression", + ClassBody: "ClassBody", + ClassDeclaration: "ClassDeclaration", + ClassExpression: "ClassExpression", + ComprehensionBlock: "ComprehensionBlock", + ComprehensionExpression: "ComprehensionExpression", + ConditionalExpression: "ConditionalExpression", + ContinueStatement: "ContinueStatement", + DebuggerStatement: "DebuggerStatement", + DirectiveStatement: "DirectiveStatement", + DoWhileStatement: "DoWhileStatement", + EmptyStatement: "EmptyStatement", + ExportAllDeclaration: "ExportAllDeclaration", + ExportDefaultDeclaration: "ExportDefaultDeclaration", + ExportNamedDeclaration: "ExportNamedDeclaration", + ExportSpecifier: "ExportSpecifier", + ExpressionStatement: "ExpressionStatement", + ForStatement: "ForStatement", + ForInStatement: "ForInStatement", + ForOfStatement: "ForOfStatement", + FunctionDeclaration: "FunctionDeclaration", + FunctionExpression: "FunctionExpression", + GeneratorExpression: "GeneratorExpression", + Identifier: "Identifier", + IfStatement: "IfStatement", + ImportExpression: "ImportExpression", + ImportDeclaration: "ImportDeclaration", + ImportDefaultSpecifier: "ImportDefaultSpecifier", + ImportNamespaceSpecifier: "ImportNamespaceSpecifier", + ImportSpecifier: "ImportSpecifier", + Literal: "Literal", + LabeledStatement: "LabeledStatement", + LogicalExpression: "LogicalExpression", + MemberExpression: "MemberExpression", + MetaProperty: "MetaProperty", + MethodDefinition: "MethodDefinition", + ModuleSpecifier: "ModuleSpecifier", + NewExpression: "NewExpression", + ObjectExpression: "ObjectExpression", + ObjectPattern: "ObjectPattern", + PrivateIdentifier: "PrivateIdentifier", + Program: "Program", + Property: "Property", + PropertyDefinition: "PropertyDefinition", + RestElement: "RestElement", + ReturnStatement: "ReturnStatement", + SequenceExpression: "SequenceExpression", + SpreadElement: "SpreadElement", + Super: "Super", + SwitchStatement: "SwitchStatement", + SwitchCase: "SwitchCase", + TaggedTemplateExpression: "TaggedTemplateExpression", + TemplateElement: "TemplateElement", + TemplateLiteral: "TemplateLiteral", + ThisExpression: "ThisExpression", + ThrowStatement: "ThrowStatement", + TryStatement: "TryStatement", + UnaryExpression: "UnaryExpression", + UpdateExpression: "UpdateExpression", + VariableDeclaration: "VariableDeclaration", + VariableDeclarator: "VariableDeclarator", + WhileStatement: "WhileStatement", + WithStatement: "WithStatement", + YieldExpression: "YieldExpression" + }, o = { + AssignmentExpression: ["left", "right"], + AssignmentPattern: ["left", "right"], + ArrayExpression: ["elements"], + ArrayPattern: ["elements"], + ArrowFunctionExpression: ["params", "body"], + AwaitExpression: ["argument"], + BlockStatement: ["body"], + BinaryExpression: ["left", "right"], + BreakStatement: ["label"], + CallExpression: ["callee", "arguments"], + CatchClause: ["param", "body"], + ChainExpression: ["expression"], + ClassBody: ["body"], + ClassDeclaration: ["id", "superClass", "body"], + ClassExpression: ["id", "superClass", "body"], + ComprehensionBlock: ["left", "right"], + ComprehensionExpression: ["blocks", "filter", "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"], + GeneratorExpression: ["blocks", "filter", "body"], + Identifier: [], + IfStatement: ["test", "consequent", "alternate"], + ImportExpression: ["source"], + ImportDeclaration: ["specifiers", "source"], + ImportDefaultSpecifier: ["local"], + ImportNamespaceSpecifier: ["local"], + ImportSpecifier: ["imported", "local"], + Literal: [], + LabeledStatement: ["label", "body"], + LogicalExpression: ["left", "right"], + MemberExpression: ["object", "property"], + MetaProperty: ["meta", "property"], + MethodDefinition: ["key", "value"], + ModuleSpecifier: [], + NewExpression: ["callee", "arguments"], + ObjectExpression: ["properties"], + ObjectPattern: ["properties"], + PrivateIdentifier: [], + Program: ["body"], + Property: ["key", "value"], + PropertyDefinition: ["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"] + }, n = { + Break: a = {}, + Skip: i = {}, + Remove: s = {} + }, l.prototype.replace = function (e) { + this.parent[this.key] = e; + }, l.prototype.remove = function () { + return Array.isArray(this.parent) ? (this.parent.splice(this.key, 1), !0) : (this.replace(null), !1); + }, f.prototype.path = function () { + var e, t, r, n, o; + function a(e, t) { + if (Array.isArray(t)) for (r = 0, n = t.length; r < n; ++r) e.push(t[r]);else e.push(t); } - } else if (y = n.pop(), void 0 !== (f = this.__execute(t.leave, y)) && f !== a && f !== i && f !== s && y.ref.replace(f), this.__state !== s && f !== s || E(y), this.__state === a || f === a) return b.root; - - return b.root; - }, t.Syntax = r, t.traverse = d, t.replace = function (e, t) { - return new f().replace(e, t); - }, t.attachComments = function (e, t, r) { - var o, + if (!this.__current.path) return null; + for (o = [], e = 2, t = this.__leavelist.length; e < t; ++e) a(o, this.__leavelist[e].path); + return a(o, this.__current.path), o; + }, f.prototype.type = function () { + return this.current().type || this.__current.wrap; + }, f.prototype.parents = function () { + var e, t, r; + for (r = [], e = 1, t = this.__leavelist.length; e < t; ++e) r.push(this.__leavelist[e].node); + return r; + }, f.prototype.current = function () { + return this.__current.node; + }, f.prototype.__execute = function (e, t) { + var r, n; + return n = void 0, r = this.__current, this.__current = t, this.__state = null, e && (n = e.call(this, t.node, this.__leavelist[this.__leavelist.length - 1].node)), this.__current = r, n; + }, f.prototype.notify = function (e) { + this.__state = e; + }, f.prototype.skip = function () { + this.notify(i); + }, f.prototype.break = function () { + this.notify(a); + }, f.prototype.remove = function () { + this.notify(s); + }, f.prototype.__initialize = function (e, t) { + this.visitor = t, this.root = e, this.__worklist = [], this.__leavelist = [], this.__current = null, this.__state = null, this.__fallback = null, "iteration" === t.fallback ? this.__fallback = Object.keys : "function" == typeof t.fallback && (this.__fallback = t.fallback), this.__keys = o, t.keys && (this.__keys = Object.assign(Object.create(this.__keys), t.keys)); + }, f.prototype.traverse = function (e, t) { + var r, n, o, s, u, l, f, d, m, x, v, g; + for (this.__initialize(e, t), g = {}, r = this.__worklist, n = this.__leavelist, r.push(new c(e, null, null, null)), n.push(new c(null, null, null, null)); r.length;) if ((o = r.pop()) !== g) { + if (o.node) { + if (l = this.__execute(t.enter, o), this.__state === a || l === a) return; + if (r.push(g), n.push(o), this.__state === i || l === i) continue; + if (u = (s = o.node).type || o.wrap, !(x = this.__keys[u])) { + if (!this.__fallback) throw new Error("Unknown node type " + u + "."); + x = this.__fallback(s); + } + for (d = x.length; (d -= 1) >= 0;) if (v = s[f = x[d]]) if (Array.isArray(v)) { + for (m = v.length; (m -= 1) >= 0;) if (v[m] && !y(n, v[m])) { + if (h(u, x[d])) o = new c(v[m], [f, m], "Property", null);else { + if (!p(v[m])) continue; + o = new c(v[m], [f, m], null, null); + } + r.push(o); + } + } else if (p(v)) { + if (y(n, v)) continue; + r.push(new c(v, f, null, null)); + } + } + } else if (o = n.pop(), l = this.__execute(t.leave, o), this.__state === a || l === a) return; + }, f.prototype.replace = function (e, t) { + var r, n, o, u, f, y, d, m, x, v, g, A, E; + function b(e) { + var t, n, o, a; + if (e.ref.remove()) for (n = e.ref.key, a = e.ref.parent, t = r.length; t--;) if ((o = r[t]).ref && o.ref.parent === a) { + if (o.ref.key < n) break; + --o.ref.key; + } + } + for (this.__initialize(e, t), g = {}, r = this.__worklist, n = this.__leavelist, y = new c(e, null, null, new l(A = { + root: e + }, "root")), r.push(y), n.push(y); r.length;) if ((y = r.pop()) !== g) { + if (void 0 !== (f = this.__execute(t.enter, y)) && f !== a && f !== i && f !== s && (y.ref.replace(f), y.node = f), this.__state !== s && f !== s || (b(y), y.node = null), this.__state === a || f === a) return A.root; + if ((o = y.node) && (r.push(g), n.push(y), this.__state !== i && f !== i)) { + if (u = o.type || y.wrap, !(x = this.__keys[u])) { + if (!this.__fallback) throw new Error("Unknown node type " + u + "."); + x = this.__fallback(o); + } + for (d = x.length; (d -= 1) >= 0;) if (v = o[E = x[d]]) if (Array.isArray(v)) { + for (m = v.length; (m -= 1) >= 0;) if (v[m]) { + if (h(u, x[d])) y = new c(v[m], [E, m], "Property", new l(v, m));else { + if (!p(v[m])) continue; + y = new c(v[m], [E, m], null, new l(v, m)); + } + r.push(y); + } + } else p(v) && r.push(new c(v, E, null, new l(o, E))); + } + } else if (y = n.pop(), void 0 !== (f = this.__execute(t.leave, y)) && f !== a && f !== i && f !== s && y.ref.replace(f), this.__state !== s && f !== s || b(y), this.__state === a || f === a) return A.root; + return A.root; + }, t.Syntax = r, t.traverse = d, t.replace = function (e, t) { + return new f().replace(e, t); + }, t.attachComments = function (e, t, r) { + var o, a, i, s, - u = []; - if (!e.range) throw new Error("attachComments needs range information"); - - if (!r.length) { - if (t.length) { - for (i = 0, a = t.length; i < a; i += 1) (o = l(t[i])).extendedRange = [0, e.range[0]], u.push(o); - - e.leadingComments = u; + l = []; + if (!e.range) throw new Error("attachComments needs range information"); + if (!r.length) { + if (t.length) { + for (i = 0, a = t.length; i < a; i += 1) (o = u(t[i])).extendedRange = [0, e.range[0]], l.push(o); + e.leadingComments = l; + } + return e; } - - return e; + for (i = 0, a = t.length; i < a; i += 1) l.push(m(u(t[i]), r)); + return s = 0, d(e, { + enter: function (e) { + for (var t; s < l.length && !((t = l[s]).extendedRange[1] > e.range[0]);) t.extendedRange[1] === e.range[0] ? (e.leadingComments || (e.leadingComments = []), e.leadingComments.push(t), l.splice(s, 1)) : s += 1; + return s === l.length ? n.Break : l[s].extendedRange[0] > e.range[1] ? n.Skip : void 0; + } + }), s = 0, d(e, { + leave: function (e) { + for (var t; s < l.length && (t = l[s], !(e.range[1] < t.extendedRange[0]));) e.range[1] === t.extendedRange[0] ? (e.trailingComments || (e.trailingComments = []), e.trailingComments.push(t), l.splice(s, 1)) : s += 1; + return s === l.length ? n.Break : l[s].extendedRange[0] > e.range[1] ? n.Skip : void 0; + } + }), e; + }, t.VisitorKeys = o, t.VisitorOption = n, t.Controller = f, t.cloneEnvironment = function () { + return e({}); + }, t; + }(t); + }), + s = a(function (e) { + e.exports && (e.exports = function () { + function e(t, r, n, o) { + this.message = t, this.expected = r, this.found = n, this.location = o, this.name = "SyntaxError", "function" == typeof Error.captureStackTrace && Error.captureStackTrace(this, e); } - - for (i = 0, a = t.length; i < a; i += 1) u.push(m(l(t[i]), r)); - - return s = 0, d(e, { - enter: function (e) { - for (var t; s < u.length && !((t = u[s]).extendedRange[1] > e.range[0]);) t.extendedRange[1] === e.range[0] ? (e.leadingComments || (e.leadingComments = []), e.leadingComments.push(t), u.splice(s, 1)) : s += 1; - - return s === u.length ? n.Break : u[s].extendedRange[0] > e.range[1] ? n.Skip : void 0; + return function (e, t) { + function r() { + this.constructor = e; } - }), s = 0, d(e, { - leave: function (e) { - for (var t; s < u.length && (t = u[s], !(e.range[1] < t.extendedRange[0]));) e.range[1] === t.extendedRange[0] ? (e.trailingComments || (e.trailingComments = []), e.trailingComments.push(t), u.splice(s, 1)) : s += 1; - - return s === u.length ? n.Break : u[s].extendedRange[0] > e.range[1] ? n.Skip : void 0; - } - }), e; - }, t.VisitorKeys = o, t.VisitorOption = n, t.Controller = f, t.cloneEnvironment = function () { - return e({}); - }, t; - }(t); - }), - l = i(function (e) { - e.exports && (e.exports = function () { - function e(t, r, n, o) { - this.message = t, this.expected = r, this.found = n, this.location = o, this.name = "SyntaxError", "function" == typeof Error.captureStackTrace && Error.captureStackTrace(this, e); - } - - return function (e, t) { - function r() { - this.constructor = e; - } - - r.prototype = t.prototype, e.prototype = new r(); - }(e, Error), e.buildMessage = function (e, t) { - var r = { - literal: function (e) { - return '"' + o(e.text) + '"'; - }, - class: function (e) { - var t, + r.prototype = t.prototype, e.prototype = new r(); + }(e, Error), e.buildMessage = function (e, t) { + var r = { + literal: function (e) { + return '"' + o(e.text) + '"'; + }, + class: function (e) { + var t, r = ""; - - for (t = 0; t < e.parts.length; t++) r += e.parts[t] instanceof Array ? a(e.parts[t][0]) + "-" + a(e.parts[t][1]) : a(e.parts[t]); - - return "[" + (e.inverted ? "^" : "") + r + "]"; - }, - any: function (e) { - return "any character"; - }, - end: function (e) { - return "end of input"; - }, - other: function (e) { - return e.description; + for (t = 0; t < e.parts.length; t++) r += e.parts[t] instanceof Array ? a(e.parts[t][0]) + "-" + a(e.parts[t][1]) : a(e.parts[t]); + return "[" + (e.inverted ? "^" : "") + r + "]"; + }, + any: function (e) { + return "any character"; + }, + end: function (e) { + return "end of input"; + }, + other: function (e) { + return e.description; + } + }; + function n(e) { + return e.charCodeAt(0).toString(16).toUpperCase(); } - }; - - function n(e) { - return e.charCodeAt(0).toString(16).toUpperCase(); - } - - function o(e) { - return e.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function (e) { - return "\\x0" + n(e); - }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (e) { - return "\\x" + n(e); - }); - } - - function a(e) { - return e.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function (e) { - return "\\x0" + n(e); - }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (e) { - return "\\x" + n(e); - }); - } - - return "Expected " + function (e) { - var t, + function o(e) { + return e.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function (e) { + return "\\x0" + n(e); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (e) { + return "\\x" + n(e); + }); + } + function a(e) { + return e.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function (e) { + return "\\x0" + n(e); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (e) { + return "\\x" + n(e); + }); + } + return "Expected " + function (e) { + var t, n, o, a = new Array(e.length); - - for (t = 0; t < e.length; t++) a[t] = (o = e[t], r[o.type](o)); - - if (a.sort(), a.length > 0) { - for (t = 1, n = 1; t < a.length; t++) a[t - 1] !== a[t] && (a[n] = a[t], n++); - - a.length = n; - } - - switch (a.length) { - case 1: - return a[0]; - - case 2: - return a[0] + " or " + a[1]; - - default: - return a.slice(0, -1).join(", ") + ", or " + a[a.length - 1]; - } - }(e) + " but " + function (e) { - return e ? '"' + o(e) + '"' : "end of input"; - }(t) + " found."; - }, { - SyntaxError: e, - parse: function (t, r) { - r = void 0 !== r ? r : {}; - - var n, + for (t = 0; t < e.length; t++) a[t] = (o = e[t], r[o.type](o)); + if (a.sort(), a.length > 0) { + for (t = 1, n = 1; t < a.length; t++) a[t - 1] !== a[t] && (a[n] = a[t], n++); + a.length = n; + } + switch (a.length) { + case 1: + return a[0]; + case 2: + return a[0] + " or " + a[1]; + default: + return a.slice(0, -1).join(", ") + ", or " + a[a.length - 1]; + } + }(e) + " but " + function (e) { + return e ? '"' + o(e) + '"' : "end of input"; + }(t) + " found."; + }, { + SyntaxError: e, + parse: function (t, r) { + r = void 0 !== r ? r : {}; + var n, o, a, i, s = {}, - l = { - start: be - }, - u = be, - c = de(" ", !1), - f = /^[^ [\],():#!=><~+.]/, - p = me([" ", "[", "]", ",", "(", ")", ":", "#", "!", "=", ">", "<", "~", "+", "."], !0, !1), - h = de(">", !1), - y = de("~", !1), - d = de("+", !1), - m = de(",", !1), - x = de("!", !1), - v = de("*", !1), - g = de("#", !1), - b = de("[", !1), - A = de("]", !1), - E = /^[>", "<", "!"], !1, !1), - _ = de("=", !1), - w = function (e) { - return (e || "") + "="; - }, - C = /^[><]/, - P = me([">", "<"], !1, !1), - k = de(".", !1), - D = function (e, t, r) { - return { - type: "attribute", - name: e, - operator: t, - value: r - }; - }, - j = de('"', !1), - I = /^[^\\"]/, - T = me(["\\", '"'], !0, !1), - F = de("\\", !1), - L = { - type: "any" - }, - O = function (e, t) { - return e + t; - }, - R = function (e) { - return { - type: "literal", - value: (t = e.join(""), t.replace(/\\(.)/g, function (e, t) { - switch (t) { - case "b": - return "\b"; - - case "f": - return "\f"; - - case "n": - return "\n"; - - case "r": - return "\r"; - - case "t": - return "\t"; - - case "v": - return "\v"; - - default: - return t; - } - })) - }; - var t; - }, - B = de("'", !1), - M = /^[^\\']/, - U = me(["\\", "'"], !0, !1), - q = /^[0-9]/, - V = me([["0", "9"]], !1, !1), - N = de("type(", !1), - W = /^[^ )]/, - K = me([" ", ")"], !0, !1), - G = de(")", !1), - z = /^[imsu]/, - H = me(["i", "m", "s", "u"], !1, !1), - Y = de("/", !1), - $ = /^[^\/]/, - J = me(["/"], !0, !1), - Q = de(":not(", !1), - X = de(":matches(", !1), - Z = de(":has(", !1), - ee = de(":first-child", !1), - te = de(":last-child", !1), - re = de(":nth-child(", !1), - ne = de(":nth-last-child(", !1), - oe = de(":", !1), - ae = de("statement", !0), - ie = de("expression", !0), - se = de("declaration", !0), - le = de("function", !0), - ue = de("pattern", !0), - ce = 0, - fe = [{ - line: 1, - column: 1 - }], - pe = 0, - he = [], - ye = {}; - - if ("startRule" in r) { - if (!(r.startRule in l)) throw new Error("Can't start parsing from rule \"" + r.startRule + '".'); - u = l[r.startRule]; - } - - function de(e, t) { - return { - type: "literal", - text: e, - ignoreCase: t - }; - } - - function me(e, t, r) { - return { - type: "class", - parts: e, - inverted: t, - ignoreCase: r - }; - } - - function xe(e) { - var r, - n = fe[e]; - if (n) return n; - - for (r = e - 1; !fe[r];) r--; - - for (n = { - line: (n = fe[r]).line, - column: n.column - }; r < e;) 10 === t.charCodeAt(r) ? (n.line++, n.column = 1) : n.column++, r++; - - return fe[e] = n, n; - } - - function ve(e, t) { - var r = xe(e), - n = xe(t); - return { - start: { - offset: e, - line: r.line, - column: r.column + u = { + start: de }, - end: { - offset: t, - line: n.line, - column: n.column - } - }; - } - - function ge(e) { - ce < pe || (ce > pe && (pe = ce, he = []), he.push(e)); - } - - function be() { - var e, - t, - r, - n, - o = 30 * ce + 0, - a = ye[o]; - return a ? (ce = a.nextPos, a.result) : (e = ce, (t = Ae()) !== s && (r = _e()) !== s && Ae() !== s ? e = t = 1 === (n = r).length ? n[0] : { - type: "matches", - selectors: n - } : (ce = e, e = s), e === s && (e = ce, (t = Ae()) !== s && (t = void 0), e = t), ye[o] = { - nextPos: ce, - result: e - }, e); - } - - function Ae() { - var e, - r, - n = 30 * ce + 1, - o = ye[n]; - if (o) return ce = o.nextPos, o.result; - - for (e = [], 32 === t.charCodeAt(ce) ? (r = " ", ce++) : (r = s, ge(c)); r !== s;) e.push(r), 32 === t.charCodeAt(ce) ? (r = " ", ce++) : (r = s, ge(c)); - - return ye[n] = { - nextPos: ce, - result: e - }, e; - } - - function Ee() { - var e, - r, - n, - o = 30 * ce + 2, - a = ye[o]; - if (a) return ce = a.nextPos, a.result; - if (r = [], f.test(t.charAt(ce)) ? (n = t.charAt(ce), ce++) : (n = s, ge(p)), n !== s) for (; n !== s;) r.push(n), f.test(t.charAt(ce)) ? (n = t.charAt(ce), ce++) : (n = s, ge(p));else r = s; - return r !== s && (r = r.join("")), e = r, ye[o] = { - nextPos: ce, - result: e - }, e; - } - - function Se() { - var e, - r, - n, - o = 30 * ce + 3, - a = ye[o]; - return a ? (ce = a.nextPos, a.result) : (e = ce, (r = Ae()) !== s ? (62 === t.charCodeAt(ce) ? (n = ">", ce++) : (n = s, ge(h)), n !== s && Ae() !== s ? e = r = "child" : (ce = e, e = s)) : (ce = e, e = s), e === s && (e = ce, (r = Ae()) !== s ? (126 === t.charCodeAt(ce) ? (n = "~", ce++) : (n = s, ge(y)), n !== s && Ae() !== s ? e = r = "sibling" : (ce = e, e = s)) : (ce = e, e = s), e === s && (e = ce, (r = Ae()) !== s ? (43 === t.charCodeAt(ce) ? (n = "+", ce++) : (n = s, ge(d)), n !== s && Ae() !== s ? e = r = "adjacent" : (ce = e, e = s)) : (ce = e, e = s), e === s && (e = ce, 32 === t.charCodeAt(ce) ? (r = " ", ce++) : (r = s, ge(c)), r !== s && (n = Ae()) !== s ? e = r = "descendant" : (ce = e, e = s)))), ye[o] = { - nextPos: ce, - result: e - }, e); - } - - function _e() { - var e, - r, - n, - o, - a, - i, - l, - u, - c = 30 * ce + 4, - f = ye[c]; - if (f) return ce = f.nextPos, f.result; - - if (e = ce, (r = we()) !== s) { - for (n = [], o = ce, (a = Ae()) !== s ? (44 === t.charCodeAt(ce) ? (i = ",", ce++) : (i = s, ge(m)), i !== s && (l = Ae()) !== s && (u = we()) !== s ? o = a = [a, i, l, u] : (ce = o, o = s)) : (ce = o, o = s); o !== s;) n.push(o), o = ce, (a = Ae()) !== s ? (44 === t.charCodeAt(ce) ? (i = ",", ce++) : (i = s, ge(m)), i !== s && (l = Ae()) !== s && (u = we()) !== s ? o = a = [a, i, l, u] : (ce = o, o = s)) : (ce = o, o = s); - - n !== s ? e = r = [r].concat(n.map(function (e) { - return e[3]; - })) : (ce = e, e = s); - } else ce = e, e = s; - - return ye[c] = { - nextPos: ce, - result: e - }, e; - } - - function we() { - var e, - t, - r, - n, - o, - a, - i, - l = 30 * ce + 5, - u = ye[l]; - if (u) return ce = u.nextPos, u.result; - - if (e = ce, (t = Ce()) !== s) { - for (r = [], n = ce, (o = Se()) !== s && (a = Ce()) !== s ? n = o = [o, a] : (ce = n, n = s); n !== s;) r.push(n), n = ce, (o = Se()) !== s && (a = Ce()) !== s ? n = o = [o, a] : (ce = n, n = s); - - r !== s ? (i = t, e = t = r.reduce(function (e, t) { + l = de, + c = ce(" ", !1), + f = /^[^ [\],():#!=><~+.]/, + p = fe([" ", "[", "]", ",", "(", ")", ":", "#", "!", "=", ">", "<", "~", "+", "."], !0, !1), + h = ce(">", !1), + y = ce("~", !1), + d = ce("+", !1), + m = ce(",", !1), + x = ce("!", !1), + v = ce("*", !1), + g = ce("#", !1), + A = ce("[", !1), + E = ce("]", !1), + b = /^[>", "<", "!"], !1, !1), + _ = ce("=", !1), + C = function (e) { + return (e || "") + "="; + }, + w = /^[><]/, + P = fe([">", "<"], !1, !1), + k = ce(".", !1), + D = function (e, t, r) { return { - type: t[0], - left: e, - right: t[1] + type: "attribute", + name: e, + operator: t, + value: r }; - }, i)) : (ce = e, e = s); - } else ce = e, e = s; - - return ye[l] = { - nextPos: ce, - result: e - }, e; - } - - function Ce() { - var e, + }, + I = ce('"', !1), + j = /^[^\\"]/, + T = fe(["\\", '"'], !0, !1), + F = ce("\\", !1), + R = { + type: "any" + }, + O = function (e, t) { + return e + t; + }, + L = function (e) { + return { + type: "literal", + value: (t = e.join(""), t.replace(/\\(.)/g, function (e, t) { + switch (t) { + case "b": + return "\b"; + case "f": + return "\f"; + case "n": + return "\n"; + case "r": + return "\r"; + case "t": + return "\t"; + case "v": + return "\v"; + default: + return t; + } + })) + }; + var t; + }, + M = ce("'", !1), + B = /^[^\\']/, + U = fe(["\\", "'"], !0, !1), + K = /^[0-9]/, + W = fe([["0", "9"]], !1, !1), + q = ce("type(", !1), + V = /^[^ )]/, + N = fe([" ", ")"], !0, !1), + G = ce(")", !1), + z = /^[imsu]/, + H = fe(["i", "m", "s", "u"], !1, !1), + Y = ce("/", !1), + $ = /^[^\/]/, + J = fe(["/"], !0, !1), + Q = ce(":not(", !1), + X = ce(":matches(", !1), + Z = ce(":has(", !1), + ee = ce(":first-child", !1), + te = ce(":last-child", !1), + re = ce(":nth-child(", !1), + ne = ce(":nth-last-child(", !1), + oe = ce(":", !1), + ae = 0, + ie = [{ + line: 1, + column: 1 + }], + se = 0, + ue = [], + le = {}; + if ("startRule" in r) { + if (!(r.startRule in u)) throw new Error("Can't start parsing from rule \"" + r.startRule + '".'); + l = u[r.startRule]; + } + function ce(e, t) { + return { + type: "literal", + text: e, + ignoreCase: t + }; + } + function fe(e, t, r) { + return { + type: "class", + parts: e, + inverted: t, + ignoreCase: r + }; + } + function pe(e) { + var r, + n = ie[e]; + if (n) return n; + for (r = e - 1; !ie[r];) r--; + for (n = { + line: (n = ie[r]).line, + column: n.column + }; r < e;) 10 === t.charCodeAt(r) ? (n.line++, n.column = 1) : n.column++, r++; + return ie[e] = n, n; + } + function he(e, t) { + var r = pe(e), + n = pe(t); + return { + start: { + offset: e, + line: r.line, + column: r.column + }, + end: { + offset: t, + line: n.line, + column: n.column + } + }; + } + function ye(e) { + ae < se || (ae > se && (se = ae, ue = []), ue.push(e)); + } + function de() { + var e, + t, r, n, - o, - a, - i, - l, - u = 30 * ce + 6, - c = ye[u]; - if (c) return ce = c.nextPos, c.result; - - if (e = ce, 33 === t.charCodeAt(ce) ? (r = "!", ce++) : (r = s, ge(x)), r === s && (r = null), r !== s) { - if (n = [], (o = Pe()) !== s) for (; o !== s;) n.push(o), o = Pe();else n = s; - n !== s ? (a = r, l = 1 === (i = n).length ? i[0] : { - type: "compound", - selectors: i - }, a && (l.subject = !0), e = r = l) : (ce = e, e = s); - } else ce = e, e = s; - - return ye[u] = { - nextPos: ce, - result: e - }, e; - } - - function Pe() { - var e, - r = 30 * ce + 7, - n = ye[r]; - return n ? (ce = n.nextPos, n.result) : ((e = function () { - var e, - r, - n = 30 * ce + 8, - o = ye[n]; - return o ? (ce = o.nextPos, o.result) : (42 === t.charCodeAt(ce) ? (r = "*", ce++) : (r = s, ge(v)), r !== s && (r = { - type: "wildcard", - value: r - }), e = r, ye[n] = { - nextPos: ce, + o = 30 * ae + 0, + a = le[o]; + return a ? (ae = a.nextPos, a.result) : (e = ae, (t = me()) !== s && (r = ge()) !== s && me() !== s ? e = t = 1 === (n = r).length ? n[0] : { + type: "matches", + selectors: n + } : (ae = e, e = s), e === s && (e = ae, (t = me()) !== s && (t = void 0), e = t), le[o] = { + nextPos: ae, result: e }, e); - }()) === s && (e = function () { + } + function me() { var e, + r, + n = 30 * ae + 1, + o = le[n]; + if (o) return ae = o.nextPos, o.result; + for (e = [], 32 === t.charCodeAt(ae) ? (r = " ", ae++) : (r = s, ye(c)); r !== s;) e.push(r), 32 === t.charCodeAt(ae) ? (r = " ", ae++) : (r = s, ye(c)); + return le[n] = { + nextPos: ae, + result: e + }, e; + } + function xe() { + var e, + r, + n, + o = 30 * ae + 2, + a = le[o]; + if (a) return ae = a.nextPos, a.result; + if (r = [], f.test(t.charAt(ae)) ? (n = t.charAt(ae), ae++) : (n = s, ye(p)), n !== s) for (; n !== s;) r.push(n), f.test(t.charAt(ae)) ? (n = t.charAt(ae), ae++) : (n = s, ye(p));else r = s; + return r !== s && (r = r.join("")), e = r, le[o] = { + nextPos: ae, + result: e + }, e; + } + function ve() { + var e, + r, + n, + o = 30 * ae + 3, + a = le[o]; + return a ? (ae = a.nextPos, a.result) : (e = ae, (r = me()) !== s ? (62 === t.charCodeAt(ae) ? (n = ">", ae++) : (n = s, ye(h)), n !== s && me() !== s ? e = r = "child" : (ae = e, e = s)) : (ae = e, e = s), e === s && (e = ae, (r = me()) !== s ? (126 === t.charCodeAt(ae) ? (n = "~", ae++) : (n = s, ye(y)), n !== s && me() !== s ? e = r = "sibling" : (ae = e, e = s)) : (ae = e, e = s), e === s && (e = ae, (r = me()) !== s ? (43 === t.charCodeAt(ae) ? (n = "+", ae++) : (n = s, ye(d)), n !== s && me() !== s ? e = r = "adjacent" : (ae = e, e = s)) : (ae = e, e = s), e === s && (e = ae, 32 === t.charCodeAt(ae) ? (r = " ", ae++) : (r = s, ye(c)), r !== s && (n = me()) !== s ? e = r = "descendant" : (ae = e, e = s)))), le[o] = { + nextPos: ae, + result: e + }, e); + } + function ge() { + var e, + r, + n, + o, + a, + i, + u, + l, + c = 30 * ae + 4, + f = le[c]; + if (f) return ae = f.nextPos, f.result; + if (e = ae, (r = Ae()) !== s) { + for (n = [], o = ae, (a = me()) !== s ? (44 === t.charCodeAt(ae) ? (i = ",", ae++) : (i = s, ye(m)), i !== s && (u = me()) !== s && (l = Ae()) !== s ? o = a = [a, i, u, l] : (ae = o, o = s)) : (ae = o, o = s); o !== s;) n.push(o), o = ae, (a = me()) !== s ? (44 === t.charCodeAt(ae) ? (i = ",", ae++) : (i = s, ye(m)), i !== s && (u = me()) !== s && (l = Ae()) !== s ? o = a = [a, i, u, l] : (ae = o, o = s)) : (ae = o, o = s); + n !== s ? e = r = [r].concat(n.map(function (e) { + return e[3]; + })) : (ae = e, e = s); + } else ae = e, e = s; + return le[c] = { + nextPos: ae, + result: e + }, e; + } + function Ae() { + var e, + t, + r, + n, + o, + a, + i, + u = 30 * ae + 5, + l = le[u]; + if (l) return ae = l.nextPos, l.result; + if (e = ae, (t = Ee()) !== s) { + for (r = [], n = ae, (o = ve()) !== s && (a = Ee()) !== s ? n = o = [o, a] : (ae = n, n = s); n !== s;) r.push(n), n = ae, (o = ve()) !== s && (a = Ee()) !== s ? n = o = [o, a] : (ae = n, n = s); + r !== s ? (i = t, e = t = r.reduce(function (e, t) { + return { + type: t[0], + left: e, + right: t[1] + }; + }, i)) : (ae = e, e = s); + } else ae = e, e = s; + return le[u] = { + nextPos: ae, + result: e + }, e; + } + function Ee() { + var e, + r, + n, + o, + a, + i, + u, + l = 30 * ae + 6, + c = le[l]; + if (c) return ae = c.nextPos, c.result; + if (e = ae, 33 === t.charCodeAt(ae) ? (r = "!", ae++) : (r = s, ye(x)), r === s && (r = null), r !== s) { + if (n = [], (o = be()) !== s) for (; o !== s;) n.push(o), o = be();else n = s; + n !== s ? (a = r, u = 1 === (i = n).length ? i[0] : { + type: "compound", + selectors: i + }, a && (u.subject = !0), e = r = u) : (ae = e, e = s); + } else ae = e, e = s; + return le[l] = { + nextPos: ae, + result: e + }, e; + } + function be() { + var e, + r = 30 * ae + 7, + n = le[r]; + return n ? (ae = n.nextPos, n.result) : ((e = function () { + var e, + r, + n = 30 * ae + 8, + o = le[n]; + return o ? (ae = o.nextPos, o.result) : (42 === t.charCodeAt(ae) ? (r = "*", ae++) : (r = s, ye(v)), r !== s && (r = { + type: "wildcard", + value: r + }), e = r, le[n] = { + nextPos: ae, + result: e + }, e); + }()) === s && (e = function () { + var e, r, n, - o = 30 * ce + 9, - a = ye[o]; - return a ? (ce = a.nextPos, a.result) : (e = ce, 35 === t.charCodeAt(ce) ? (r = "#", ce++) : (r = s, ge(g)), r === s && (r = null), r !== s && (n = Ee()) !== s ? e = r = { - type: "identifier", - value: n - } : (ce = e, e = s), ye[o] = { - nextPos: ce, - result: e - }, e); - }()) === s && (e = function () { - var e, + o = 30 * ae + 9, + a = le[o]; + return a ? (ae = a.nextPos, a.result) : (e = ae, 35 === t.charCodeAt(ae) ? (r = "#", ae++) : (r = s, ye(g)), r === s && (r = null), r !== s && (n = xe()) !== s ? e = r = { + type: "identifier", + value: n + } : (ae = e, e = s), le[o] = { + nextPos: ae, + result: e + }, e); + }()) === s && (e = function () { + var e, r, n, o, - a = 30 * ce + 10, - i = ye[a]; - return i ? (ce = i.nextPos, i.result) : (e = ce, 91 === t.charCodeAt(ce) ? (r = "[", ce++) : (r = s, ge(b)), r !== s && Ae() !== s && (n = function () { - var e, + a = 30 * ae + 10, + i = le[a]; + return i ? (ae = i.nextPos, i.result) : (e = ae, 91 === t.charCodeAt(ae) ? (r = "[", ae++) : (r = s, ye(A)), r !== s && me() !== s && (n = function () { + var e, r, n, o, - a = 30 * ce + 14, - i = ye[a]; - return i ? (ce = i.nextPos, i.result) : (e = ce, (r = ke()) !== s && Ae() !== s && (n = function () { - var e, + a = 30 * ae + 14, + i = le[a]; + return i ? (ae = i.nextPos, i.result) : (e = ae, (r = Se()) !== s && me() !== s && (n = function () { + var e, r, n, - o = 30 * ce + 12, - a = ye[o]; - return a ? (ce = a.nextPos, a.result) : (e = ce, 33 === t.charCodeAt(ce) ? (r = "!", ce++) : (r = s, ge(x)), r === s && (r = null), r !== s ? (61 === t.charCodeAt(ce) ? (n = "=", ce++) : (n = s, ge(_)), n !== s ? (r = w(r), e = r) : (ce = e, e = s)) : (ce = e, e = s), ye[o] = { - nextPos: ce, - result: e - }, e); - }()) !== s && Ae() !== s ? ((o = function () { - var e, + o = 30 * ae + 12, + a = le[o]; + return a ? (ae = a.nextPos, a.result) : (e = ae, 33 === t.charCodeAt(ae) ? (r = "!", ae++) : (r = s, ye(x)), r === s && (r = null), r !== s ? (61 === t.charCodeAt(ae) ? (n = "=", ae++) : (n = s, ye(_)), n !== s ? (r = C(r), e = r) : (ae = e, e = s)) : (ae = e, e = s), le[o] = { + nextPos: ae, + result: e + }, e); + }()) !== s && me() !== s ? ((o = function () { + var e, r, n, o, a, - i = 30 * ce + 18, - l = ye[i]; - if (l) return ce = l.nextPos, l.result; - if (e = ce, "type(" === t.substr(ce, 5) ? (r = "type(", ce += 5) : (r = s, ge(N)), r !== s) { - if (Ae() !== s) { - if (n = [], W.test(t.charAt(ce)) ? (o = t.charAt(ce), ce++) : (o = s, ge(K)), o !== s) for (; o !== s;) n.push(o), W.test(t.charAt(ce)) ? (o = t.charAt(ce), ce++) : (o = s, ge(K));else n = s; - n !== s && (o = Ae()) !== s ? (41 === t.charCodeAt(ce) ? (a = ")", ce++) : (a = s, ge(G)), a !== s ? (r = { - type: "type", - value: n.join("") - }, e = r) : (ce = e, e = s)) : (ce = e, e = s); - } else ce = e, e = s; - } else ce = e, e = s; - return ye[i] = { - nextPos: ce, - result: e - }, e; - }()) === s && (o = function () { - var e, + i = 30 * ae + 18, + u = le[i]; + if (u) return ae = u.nextPos, u.result; + if (e = ae, "type(" === t.substr(ae, 5) ? (r = "type(", ae += 5) : (r = s, ye(q)), r !== s) { + if (me() !== s) { + if (n = [], V.test(t.charAt(ae)) ? (o = t.charAt(ae), ae++) : (o = s, ye(N)), o !== s) for (; o !== s;) n.push(o), V.test(t.charAt(ae)) ? (o = t.charAt(ae), ae++) : (o = s, ye(N));else n = s; + n !== s && (o = me()) !== s ? (41 === t.charCodeAt(ae) ? (a = ")", ae++) : (a = s, ye(G)), a !== s ? (r = { + type: "type", + value: n.join("") + }, e = r) : (ae = e, e = s)) : (ae = e, e = s); + } else ae = e, e = s; + } else ae = e, e = s; + return le[i] = { + nextPos: ae, + result: e + }, e; + }()) === s && (o = function () { + var e, r, n, o, a, i, - l = 30 * ce + 20, - u = ye[l]; - if (u) return ce = u.nextPos, u.result; - - if (e = ce, 47 === t.charCodeAt(ce) ? (r = "/", ce++) : (r = s, ge(Y)), r !== s) { - if (n = [], $.test(t.charAt(ce)) ? (o = t.charAt(ce), ce++) : (o = s, ge(J)), o !== s) for (; o !== s;) n.push(o), $.test(t.charAt(ce)) ? (o = t.charAt(ce), ce++) : (o = s, ge(J));else n = s; - n !== s ? (47 === t.charCodeAt(ce) ? (o = "/", ce++) : (o = s, ge(Y)), o !== s ? ((a = function () { - var e, + u = 30 * ae + 20, + l = le[u]; + if (l) return ae = l.nextPos, l.result; + if (e = ae, 47 === t.charCodeAt(ae) ? (r = "/", ae++) : (r = s, ye(Y)), r !== s) { + if (n = [], $.test(t.charAt(ae)) ? (o = t.charAt(ae), ae++) : (o = s, ye(J)), o !== s) for (; o !== s;) n.push(o), $.test(t.charAt(ae)) ? (o = t.charAt(ae), ae++) : (o = s, ye(J));else n = s; + n !== s ? (47 === t.charCodeAt(ae) ? (o = "/", ae++) : (o = s, ye(Y)), o !== s ? ((a = function () { + var e, r, - n = 30 * ce + 19, - o = ye[n]; - if (o) return ce = o.nextPos, o.result; - if (e = [], z.test(t.charAt(ce)) ? (r = t.charAt(ce), ce++) : (r = s, ge(H)), r !== s) for (; r !== s;) e.push(r), z.test(t.charAt(ce)) ? (r = t.charAt(ce), ce++) : (r = s, ge(H));else e = s; - return ye[n] = { - nextPos: ce, - result: e - }, e; - }()) === s && (a = null), a !== s ? (i = a, r = { - type: "regexp", - value: new RegExp(n.join(""), i ? i.join("") : "") - }, e = r) : (ce = e, e = s)) : (ce = e, e = s)) : (ce = e, e = s); - } else ce = e, e = s; - - return ye[l] = { - nextPos: ce, - result: e - }, e; - }()), o !== s ? (r = D(r, n, o), e = r) : (ce = e, e = s)) : (ce = e, e = s), e === s && (e = ce, (r = ke()) !== s && Ae() !== s && (n = function () { - var e, + n = 30 * ae + 19, + o = le[n]; + if (o) return ae = o.nextPos, o.result; + if (e = [], z.test(t.charAt(ae)) ? (r = t.charAt(ae), ae++) : (r = s, ye(H)), r !== s) for (; r !== s;) e.push(r), z.test(t.charAt(ae)) ? (r = t.charAt(ae), ae++) : (r = s, ye(H));else e = s; + return le[n] = { + nextPos: ae, + result: e + }, e; + }()) === s && (a = null), a !== s ? (i = a, r = { + type: "regexp", + value: new RegExp(n.join(""), i ? i.join("") : "") + }, e = r) : (ae = e, e = s)) : (ae = e, e = s)) : (ae = e, e = s); + } else ae = e, e = s; + return le[u] = { + nextPos: ae, + result: e + }, e; + }()), o !== s ? (r = D(r, n, o), e = r) : (ae = e, e = s)) : (ae = e, e = s), e === s && (e = ae, (r = Se()) !== s && me() !== s && (n = function () { + var e, r, n, - o = 30 * ce + 11, - a = ye[o]; - return a ? (ce = a.nextPos, a.result) : (e = ce, E.test(t.charAt(ce)) ? (r = t.charAt(ce), ce++) : (r = s, ge(S)), r === s && (r = null), r !== s ? (61 === t.charCodeAt(ce) ? (n = "=", ce++) : (n = s, ge(_)), n !== s ? (r = w(r), e = r) : (ce = e, e = s)) : (ce = e, e = s), e === s && (C.test(t.charAt(ce)) ? (e = t.charAt(ce), ce++) : (e = s, ge(P))), ye[o] = { - nextPos: ce, - result: e - }, e); - }()) !== s && Ae() !== s ? ((o = function () { - var e, + o = 30 * ae + 11, + a = le[o]; + return a ? (ae = a.nextPos, a.result) : (e = ae, b.test(t.charAt(ae)) ? (r = t.charAt(ae), ae++) : (r = s, ye(S)), r === s && (r = null), r !== s ? (61 === t.charCodeAt(ae) ? (n = "=", ae++) : (n = s, ye(_)), n !== s ? (r = C(r), e = r) : (ae = e, e = s)) : (ae = e, e = s), e === s && (w.test(t.charAt(ae)) ? (e = t.charAt(ae), ae++) : (e = s, ye(P))), le[o] = { + nextPos: ae, + result: e + }, e); + }()) !== s && me() !== s ? ((o = function () { + var e, r, n, o, a, i, - l = 30 * ce + 15, - u = ye[l]; - if (u) return ce = u.nextPos, u.result; - - if (e = ce, 34 === t.charCodeAt(ce) ? (r = '"', ce++) : (r = s, ge(j)), r !== s) { - for (n = [], I.test(t.charAt(ce)) ? (o = t.charAt(ce), ce++) : (o = s, ge(T)), o === s && (o = ce, 92 === t.charCodeAt(ce) ? (a = "\\", ce++) : (a = s, ge(F)), a !== s ? (t.length > ce ? (i = t.charAt(ce), ce++) : (i = s, ge(L)), i !== s ? (a = O(a, i), o = a) : (ce = o, o = s)) : (ce = o, o = s)); o !== s;) n.push(o), I.test(t.charAt(ce)) ? (o = t.charAt(ce), ce++) : (o = s, ge(T)), o === s && (o = ce, 92 === t.charCodeAt(ce) ? (a = "\\", ce++) : (a = s, ge(F)), a !== s ? (t.length > ce ? (i = t.charAt(ce), ce++) : (i = s, ge(L)), i !== s ? (a = O(a, i), o = a) : (ce = o, o = s)) : (ce = o, o = s)); - - n !== s ? (34 === t.charCodeAt(ce) ? (o = '"', ce++) : (o = s, ge(j)), o !== s ? (r = R(n), e = r) : (ce = e, e = s)) : (ce = e, e = s); - } else ce = e, e = s; - - if (e === s) if (e = ce, 39 === t.charCodeAt(ce) ? (r = "'", ce++) : (r = s, ge(B)), r !== s) { - for (n = [], M.test(t.charAt(ce)) ? (o = t.charAt(ce), ce++) : (o = s, ge(U)), o === s && (o = ce, 92 === t.charCodeAt(ce) ? (a = "\\", ce++) : (a = s, ge(F)), a !== s ? (t.length > ce ? (i = t.charAt(ce), ce++) : (i = s, ge(L)), i !== s ? (a = O(a, i), o = a) : (ce = o, o = s)) : (ce = o, o = s)); o !== s;) n.push(o), M.test(t.charAt(ce)) ? (o = t.charAt(ce), ce++) : (o = s, ge(U)), o === s && (o = ce, 92 === t.charCodeAt(ce) ? (a = "\\", ce++) : (a = s, ge(F)), a !== s ? (t.length > ce ? (i = t.charAt(ce), ce++) : (i = s, ge(L)), i !== s ? (a = O(a, i), o = a) : (ce = o, o = s)) : (ce = o, o = s)); - - n !== s ? (39 === t.charCodeAt(ce) ? (o = "'", ce++) : (o = s, ge(B)), o !== s ? (r = R(n), e = r) : (ce = e, e = s)) : (ce = e, e = s); - } else ce = e, e = s; - return ye[l] = { - nextPos: ce, - result: e - }, e; - }()) === s && (o = function () { - var e, + u = 30 * ae + 15, + l = le[u]; + if (l) return ae = l.nextPos, l.result; + if (e = ae, 34 === t.charCodeAt(ae) ? (r = '"', ae++) : (r = s, ye(I)), r !== s) { + for (n = [], j.test(t.charAt(ae)) ? (o = t.charAt(ae), ae++) : (o = s, ye(T)), o === s && (o = ae, 92 === t.charCodeAt(ae) ? (a = "\\", ae++) : (a = s, ye(F)), a !== s ? (t.length > ae ? (i = t.charAt(ae), ae++) : (i = s, ye(R)), i !== s ? (a = O(a, i), o = a) : (ae = o, o = s)) : (ae = o, o = s)); o !== s;) n.push(o), j.test(t.charAt(ae)) ? (o = t.charAt(ae), ae++) : (o = s, ye(T)), o === s && (o = ae, 92 === t.charCodeAt(ae) ? (a = "\\", ae++) : (a = s, ye(F)), a !== s ? (t.length > ae ? (i = t.charAt(ae), ae++) : (i = s, ye(R)), i !== s ? (a = O(a, i), o = a) : (ae = o, o = s)) : (ae = o, o = s)); + n !== s ? (34 === t.charCodeAt(ae) ? (o = '"', ae++) : (o = s, ye(I)), o !== s ? (r = L(n), e = r) : (ae = e, e = s)) : (ae = e, e = s); + } else ae = e, e = s; + if (e === s) if (e = ae, 39 === t.charCodeAt(ae) ? (r = "'", ae++) : (r = s, ye(M)), r !== s) { + for (n = [], B.test(t.charAt(ae)) ? (o = t.charAt(ae), ae++) : (o = s, ye(U)), o === s && (o = ae, 92 === t.charCodeAt(ae) ? (a = "\\", ae++) : (a = s, ye(F)), a !== s ? (t.length > ae ? (i = t.charAt(ae), ae++) : (i = s, ye(R)), i !== s ? (a = O(a, i), o = a) : (ae = o, o = s)) : (ae = o, o = s)); o !== s;) n.push(o), B.test(t.charAt(ae)) ? (o = t.charAt(ae), ae++) : (o = s, ye(U)), o === s && (o = ae, 92 === t.charCodeAt(ae) ? (a = "\\", ae++) : (a = s, ye(F)), a !== s ? (t.length > ae ? (i = t.charAt(ae), ae++) : (i = s, ye(R)), i !== s ? (a = O(a, i), o = a) : (ae = o, o = s)) : (ae = o, o = s)); + n !== s ? (39 === t.charCodeAt(ae) ? (o = "'", ae++) : (o = s, ye(M)), o !== s ? (r = L(n), e = r) : (ae = e, e = s)) : (ae = e, e = s); + } else ae = e, e = s; + return le[u] = { + nextPos: ae, + result: e + }, e; + }()) === s && (o = function () { + var e, r, n, o, a, i, - l, - u = 30 * ce + 16, - c = ye[u]; - if (c) return ce = c.nextPos, c.result; - - for (e = ce, r = ce, n = [], q.test(t.charAt(ce)) ? (o = t.charAt(ce), ce++) : (o = s, ge(V)); o !== s;) n.push(o), q.test(t.charAt(ce)) ? (o = t.charAt(ce), ce++) : (o = s, ge(V)); - - if (n !== s ? (46 === t.charCodeAt(ce) ? (o = ".", ce++) : (o = s, ge(k)), o !== s ? r = n = [n, o] : (ce = r, r = s)) : (ce = r, r = s), r === s && (r = null), r !== s) { - if (n = [], q.test(t.charAt(ce)) ? (o = t.charAt(ce), ce++) : (o = s, ge(V)), o !== s) for (; o !== s;) n.push(o), q.test(t.charAt(ce)) ? (o = t.charAt(ce), ce++) : (o = s, ge(V));else n = s; - n !== s ? (i = n, l = (a = r) ? [].concat.apply([], a).join("") : "", r = { - type: "literal", - value: parseFloat(l + i.join("")) - }, e = r) : (ce = e, e = s); - } else ce = e, e = s; - - return ye[u] = { - nextPos: ce, - result: e - }, e; - }()) === s && (o = function () { - var e, + u, + l = 30 * ae + 16, + c = le[l]; + if (c) return ae = c.nextPos, c.result; + for (e = ae, r = ae, n = [], K.test(t.charAt(ae)) ? (o = t.charAt(ae), ae++) : (o = s, ye(W)); o !== s;) n.push(o), K.test(t.charAt(ae)) ? (o = t.charAt(ae), ae++) : (o = s, ye(W)); + if (n !== s ? (46 === t.charCodeAt(ae) ? (o = ".", ae++) : (o = s, ye(k)), o !== s ? r = n = [n, o] : (ae = r, r = s)) : (ae = r, r = s), r === s && (r = null), r !== s) { + if (n = [], K.test(t.charAt(ae)) ? (o = t.charAt(ae), ae++) : (o = s, ye(W)), o !== s) for (; o !== s;) n.push(o), K.test(t.charAt(ae)) ? (o = t.charAt(ae), ae++) : (o = s, ye(W));else n = s; + n !== s ? (i = n, u = (a = r) ? [].concat.apply([], a).join("") : "", r = { + type: "literal", + value: parseFloat(u + i.join("")) + }, e = r) : (ae = e, e = s); + } else ae = e, e = s; + return le[l] = { + nextPos: ae, + result: e + }, e; + }()) === s && (o = function () { + var e, t, - r = 30 * ce + 17, - n = ye[r]; - return n ? (ce = n.nextPos, n.result) : ((t = Ee()) !== s && (t = { - type: "literal", - value: t - }), e = t, ye[r] = { - nextPos: ce, + r = 30 * ae + 17, + n = le[r]; + return n ? (ae = n.nextPos, n.result) : ((t = xe()) !== s && (t = { + type: "literal", + value: t + }), e = t, le[r] = { + nextPos: ae, + result: e + }, e); + }()), o !== s ? (r = D(r, n, o), e = r) : (ae = e, e = s)) : (ae = e, e = s), e === s && (e = ae, (r = Se()) !== s && (r = { + type: "attribute", + name: r + }), e = r)), le[a] = { + nextPos: ae, result: e }, e); - }()), o !== s ? (r = D(r, n, o), e = r) : (ce = e, e = s)) : (ce = e, e = s), e === s && (e = ce, (r = ke()) !== s && (r = { - type: "attribute", - name: r - }), e = r)), ye[a] = { - nextPos: ce, + }()) !== s && me() !== s ? (93 === t.charCodeAt(ae) ? (o = "]", ae++) : (o = s, ye(E)), o !== s ? e = r = n : (ae = e, e = s)) : (ae = e, e = s), le[a] = { + nextPos: ae, result: e }, e); - }()) !== s && Ae() !== s ? (93 === t.charCodeAt(ce) ? (o = "]", ce++) : (o = s, ge(A)), o !== s ? e = r = n : (ce = e, e = s)) : (ce = e, e = s), ye[a] = { - nextPos: ce, - result: e - }, e); - }()) === s && (e = function () { - var e, + }()) === s && (e = function () { + var e, r, n, o, a, i, - l, u, - c = 30 * ce + 21, - f = ye[c]; - if (f) return ce = f.nextPos, f.result; - if (e = ce, 46 === t.charCodeAt(ce) ? (r = ".", ce++) : (r = s, ge(k)), r !== s) { - if ((n = Ee()) !== s) { - for (o = [], a = ce, 46 === t.charCodeAt(ce) ? (i = ".", ce++) : (i = s, ge(k)), i !== s && (l = Ee()) !== s ? a = i = [i, l] : (ce = a, a = s); a !== s;) o.push(a), a = ce, 46 === t.charCodeAt(ce) ? (i = ".", ce++) : (i = s, ge(k)), i !== s && (l = Ee()) !== s ? a = i = [i, l] : (ce = a, a = s); - - o !== s ? (u = n, r = { - type: "field", - name: o.reduce(function (e, t) { - return e + t[0] + t[1]; - }, u) - }, e = r) : (ce = e, e = s); - } else ce = e, e = s; - } else ce = e, e = s; - return ye[c] = { - nextPos: ce, - result: e - }, e; - }()) === s && (e = function () { - var e, + l, + c = 30 * ae + 21, + f = le[c]; + if (f) return ae = f.nextPos, f.result; + if (e = ae, 46 === t.charCodeAt(ae) ? (r = ".", ae++) : (r = s, ye(k)), r !== s) { + if ((n = xe()) !== s) { + for (o = [], a = ae, 46 === t.charCodeAt(ae) ? (i = ".", ae++) : (i = s, ye(k)), i !== s && (u = xe()) !== s ? a = i = [i, u] : (ae = a, a = s); a !== s;) o.push(a), a = ae, 46 === t.charCodeAt(ae) ? (i = ".", ae++) : (i = s, ye(k)), i !== s && (u = xe()) !== s ? a = i = [i, u] : (ae = a, a = s); + o !== s ? (l = n, r = { + type: "field", + name: o.reduce(function (e, t) { + return e + t[0] + t[1]; + }, l) + }, e = r) : (ae = e, e = s); + } else ae = e, e = s; + } else ae = e, e = s; + return le[c] = { + nextPos: ae, + result: e + }, e; + }()) === s && (e = function () { + var e, r, n, o, - a = 30 * ce + 22, - i = ye[a]; - return i ? (ce = i.nextPos, i.result) : (e = ce, ":not(" === t.substr(ce, 5) ? (r = ":not(", ce += 5) : (r = s, ge(Q)), r !== s && Ae() !== s && (n = _e()) !== s && Ae() !== s ? (41 === t.charCodeAt(ce) ? (o = ")", ce++) : (o = s, ge(G)), o !== s ? e = r = { - type: "not", - selectors: n - } : (ce = e, e = s)) : (ce = e, e = s), ye[a] = { - nextPos: ce, - result: e - }, e); - }()) === s && (e = function () { - var e, + a = 30 * ae + 22, + i = le[a]; + return i ? (ae = i.nextPos, i.result) : (e = ae, ":not(" === t.substr(ae, 5) ? (r = ":not(", ae += 5) : (r = s, ye(Q)), r !== s && me() !== s && (n = ge()) !== s && me() !== s ? (41 === t.charCodeAt(ae) ? (o = ")", ae++) : (o = s, ye(G)), o !== s ? e = r = { + type: "not", + selectors: n + } : (ae = e, e = s)) : (ae = e, e = s), le[a] = { + nextPos: ae, + result: e + }, e); + }()) === s && (e = function () { + var e, r, n, o, - a = 30 * ce + 23, - i = ye[a]; - return i ? (ce = i.nextPos, i.result) : (e = ce, ":matches(" === t.substr(ce, 9) ? (r = ":matches(", ce += 9) : (r = s, ge(X)), r !== s && Ae() !== s && (n = _e()) !== s && Ae() !== s ? (41 === t.charCodeAt(ce) ? (o = ")", ce++) : (o = s, ge(G)), o !== s ? e = r = { - type: "matches", - selectors: n - } : (ce = e, e = s)) : (ce = e, e = s), ye[a] = { - nextPos: ce, - result: e - }, e); - }()) === s && (e = function () { - var e, + a = 30 * ae + 23, + i = le[a]; + return i ? (ae = i.nextPos, i.result) : (e = ae, ":matches(" === t.substr(ae, 9) ? (r = ":matches(", ae += 9) : (r = s, ye(X)), r !== s && me() !== s && (n = ge()) !== s && me() !== s ? (41 === t.charCodeAt(ae) ? (o = ")", ae++) : (o = s, ye(G)), o !== s ? e = r = { + type: "matches", + selectors: n + } : (ae = e, e = s)) : (ae = e, e = s), le[a] = { + nextPos: ae, + result: e + }, e); + }()) === s && (e = function () { + var e, r, n, o, - a = 30 * ce + 24, - i = ye[a]; - return i ? (ce = i.nextPos, i.result) : (e = ce, ":has(" === t.substr(ce, 5) ? (r = ":has(", ce += 5) : (r = s, ge(Z)), r !== s && Ae() !== s && (n = _e()) !== s && Ae() !== s ? (41 === t.charCodeAt(ce) ? (o = ")", ce++) : (o = s, ge(G)), o !== s ? e = r = { - type: "has", - selectors: n - } : (ce = e, e = s)) : (ce = e, e = s), ye[a] = { - nextPos: ce, - result: e - }, e); - }()) === s && (e = function () { - var e, + a = 30 * ae + 24, + i = le[a]; + return i ? (ae = i.nextPos, i.result) : (e = ae, ":has(" === t.substr(ae, 5) ? (r = ":has(", ae += 5) : (r = s, ye(Z)), r !== s && me() !== s && (n = ge()) !== s && me() !== s ? (41 === t.charCodeAt(ae) ? (o = ")", ae++) : (o = s, ye(G)), o !== s ? e = r = { + type: "has", + selectors: n + } : (ae = e, e = s)) : (ae = e, e = s), le[a] = { + nextPos: ae, + result: e + }, e); + }()) === s && (e = function () { + var e, r, - n = 30 * ce + 25, - o = ye[n]; - return o ? (ce = o.nextPos, o.result) : (":first-child" === t.substr(ce, 12) ? (r = ":first-child", ce += 12) : (r = s, ge(ee)), r !== s && (r = De(1)), e = r, ye[n] = { - nextPos: ce, - result: e - }, e); - }()) === s && (e = function () { - var e, + n = 30 * ae + 25, + o = le[n]; + return o ? (ae = o.nextPos, o.result) : (":first-child" === t.substr(ae, 12) ? (r = ":first-child", ae += 12) : (r = s, ye(ee)), r !== s && (r = _e(1)), e = r, le[n] = { + nextPos: ae, + result: e + }, e); + }()) === s && (e = function () { + var e, r, - n = 30 * ce + 26, - o = ye[n]; - return o ? (ce = o.nextPos, o.result) : (":last-child" === t.substr(ce, 11) ? (r = ":last-child", ce += 11) : (r = s, ge(te)), r !== s && (r = je(1)), e = r, ye[n] = { - nextPos: ce, - result: e - }, e); - }()) === s && (e = function () { - var e, + n = 30 * ae + 26, + o = le[n]; + return o ? (ae = o.nextPos, o.result) : (":last-child" === t.substr(ae, 11) ? (r = ":last-child", ae += 11) : (r = s, ye(te)), r !== s && (r = Ce(1)), e = r, le[n] = { + nextPos: ae, + result: e + }, e); + }()) === s && (e = function () { + var e, r, n, o, a, - i = 30 * ce + 27, - l = ye[i]; - if (l) return ce = l.nextPos, l.result; - if (e = ce, ":nth-child(" === t.substr(ce, 11) ? (r = ":nth-child(", ce += 11) : (r = s, ge(re)), r !== s) { - if (Ae() !== s) { - if (n = [], q.test(t.charAt(ce)) ? (o = t.charAt(ce), ce++) : (o = s, ge(V)), o !== s) for (; o !== s;) n.push(o), q.test(t.charAt(ce)) ? (o = t.charAt(ce), ce++) : (o = s, ge(V));else n = s; - n !== s && (o = Ae()) !== s ? (41 === t.charCodeAt(ce) ? (a = ")", ce++) : (a = s, ge(G)), a !== s ? (r = De(parseInt(n.join(""), 10)), e = r) : (ce = e, e = s)) : (ce = e, e = s); - } else ce = e, e = s; - } else ce = e, e = s; - return ye[i] = { - nextPos: ce, - result: e - }, e; - }()) === s && (e = function () { - var e, + i = 30 * ae + 27, + u = le[i]; + if (u) return ae = u.nextPos, u.result; + if (e = ae, ":nth-child(" === t.substr(ae, 11) ? (r = ":nth-child(", ae += 11) : (r = s, ye(re)), r !== s) { + if (me() !== s) { + if (n = [], K.test(t.charAt(ae)) ? (o = t.charAt(ae), ae++) : (o = s, ye(W)), o !== s) for (; o !== s;) n.push(o), K.test(t.charAt(ae)) ? (o = t.charAt(ae), ae++) : (o = s, ye(W));else n = s; + n !== s && (o = me()) !== s ? (41 === t.charCodeAt(ae) ? (a = ")", ae++) : (a = s, ye(G)), a !== s ? (r = _e(parseInt(n.join(""), 10)), e = r) : (ae = e, e = s)) : (ae = e, e = s); + } else ae = e, e = s; + } else ae = e, e = s; + return le[i] = { + nextPos: ae, + result: e + }, e; + }()) === s && (e = function () { + var e, r, n, o, a, - i = 30 * ce + 28, - l = ye[i]; - if (l) return ce = l.nextPos, l.result; - if (e = ce, ":nth-last-child(" === t.substr(ce, 16) ? (r = ":nth-last-child(", ce += 16) : (r = s, ge(ne)), r !== s) { - if (Ae() !== s) { - if (n = [], q.test(t.charAt(ce)) ? (o = t.charAt(ce), ce++) : (o = s, ge(V)), o !== s) for (; o !== s;) n.push(o), q.test(t.charAt(ce)) ? (o = t.charAt(ce), ce++) : (o = s, ge(V));else n = s; - n !== s && (o = Ae()) !== s ? (41 === t.charCodeAt(ce) ? (a = ")", ce++) : (a = s, ge(G)), a !== s ? (r = je(parseInt(n.join(""), 10)), e = r) : (ce = e, e = s)) : (ce = e, e = s); - } else ce = e, e = s; - } else ce = e, e = s; - return ye[i] = { - nextPos: ce, - result: e - }, e; - }()) === s && (e = function () { - var e, + i = 30 * ae + 28, + u = le[i]; + if (u) return ae = u.nextPos, u.result; + if (e = ae, ":nth-last-child(" === t.substr(ae, 16) ? (r = ":nth-last-child(", ae += 16) : (r = s, ye(ne)), r !== s) { + if (me() !== s) { + if (n = [], K.test(t.charAt(ae)) ? (o = t.charAt(ae), ae++) : (o = s, ye(W)), o !== s) for (; o !== s;) n.push(o), K.test(t.charAt(ae)) ? (o = t.charAt(ae), ae++) : (o = s, ye(W));else n = s; + n !== s && (o = me()) !== s ? (41 === t.charCodeAt(ae) ? (a = ")", ae++) : (a = s, ye(G)), a !== s ? (r = Ce(parseInt(n.join(""), 10)), e = r) : (ae = e, e = s)) : (ae = e, e = s); + } else ae = e, e = s; + } else ae = e, e = s; + return le[i] = { + nextPos: ae, + result: e + }, e; + }()) === s && (e = function () { + var e, r, n, - o = 30 * ce + 29, - a = ye[o]; - return a ? (ce = a.nextPos, a.result) : (e = ce, 58 === t.charCodeAt(ce) ? (r = ":", ce++) : (r = s, ge(oe)), r !== s ? ("statement" === t.substr(ce, 9).toLowerCase() ? (n = t.substr(ce, 9), ce += 9) : (n = s, ge(ae)), n === s && ("expression" === t.substr(ce, 10).toLowerCase() ? (n = t.substr(ce, 10), ce += 10) : (n = s, ge(ie)), n === s && ("declaration" === t.substr(ce, 11).toLowerCase() ? (n = t.substr(ce, 11), ce += 11) : (n = s, ge(se)), n === s && ("function" === t.substr(ce, 8).toLowerCase() ? (n = t.substr(ce, 8), ce += 8) : (n = s, ge(le)), n === s && ("pattern" === t.substr(ce, 7).toLowerCase() ? (n = t.substr(ce, 7), ce += 7) : (n = s, ge(ue)))))), n !== s ? e = r = { - type: "class", - name: n - } : (ce = e, e = s)) : (ce = e, e = s), ye[o] = { - nextPos: ce, + o = 30 * ae + 29, + a = le[o]; + return a ? (ae = a.nextPos, a.result) : (e = ae, 58 === t.charCodeAt(ae) ? (r = ":", ae++) : (r = s, ye(oe)), r !== s && (n = xe()) !== s ? e = r = { + type: "class", + name: n + } : (ae = e, e = s), le[o] = { + nextPos: ae, + result: e + }, e); + }()), le[r] = { + nextPos: ae, result: e }, e); - }()), ye[r] = { - nextPos: ce, - result: e - }, e); - } - - function ke() { - var e, + } + function Se() { + var e, r, n, o, a, i, - l, u, - c = 30 * ce + 13, - f = ye[c]; - if (f) return ce = f.nextPos, f.result; - - if (e = ce, (r = Ee()) !== s) { - for (n = [], o = ce, 46 === t.charCodeAt(ce) ? (a = ".", ce++) : (a = s, ge(k)), a !== s && (i = Ee()) !== s ? o = a = [a, i] : (ce = o, o = s); o !== s;) n.push(o), o = ce, 46 === t.charCodeAt(ce) ? (a = ".", ce++) : (a = s, ge(k)), a !== s && (i = Ee()) !== s ? o = a = [a, i] : (ce = o, o = s); - - n !== s ? (l = r, u = n, e = r = [].concat.apply([l], u).join("")) : (ce = e, e = s); - } else ce = e, e = s; - - return ye[c] = { - nextPos: ce, - result: e - }, e; - } - - function De(e) { - return { - type: "nth-child", - index: { - type: "literal", - value: e - } - }; - } - - function je(e) { - return { - type: "nth-last-child", - index: { - type: "literal", - value: e - } - }; - } - - if ((n = u()) !== s && ce === t.length) return n; - throw n !== s && ce < t.length && ge({ - type: "end" - }), o = he, a = pe < t.length ? t.charAt(pe) : null, i = pe < t.length ? ve(pe, pe + 1) : ve(pe, pe), new e(e.buildMessage(o, a), o, a, i); - } - }; - }()); - }); - - function u(t, r, n, o) { - if (!r) return !0; - if (!t) return !1; - - switch (n || (n = []), r.type) { - case "wildcard": - return !0; - - case "identifier": - return r.value.toLowerCase() === t.type.toLowerCase(); - - case "field": - var i = r.name.split("."), - l = n[i.length - 1]; - return function e(t, r, n) { - if (0 === n.length) return t === r; - if (null == r) return !1; - var o = r[n[0]], - i = n.slice(1); - - if (Array.isArray(o)) { - var s, - l = a(o); - - try { - for (l.s(); !(s = l.n()).done;) { - if (e(t, s.value, i)) return !0; - } - } catch (e) { - l.e(e); - } finally { - l.f(); + l, + c = 30 * ae + 13, + f = le[c]; + if (f) return ae = f.nextPos, f.result; + if (e = ae, (r = xe()) !== s) { + for (n = [], o = ae, 46 === t.charCodeAt(ae) ? (a = ".", ae++) : (a = s, ye(k)), a !== s && (i = xe()) !== s ? o = a = [a, i] : (ae = o, o = s); o !== s;) n.push(o), o = ae, 46 === t.charCodeAt(ae) ? (a = ".", ae++) : (a = s, ye(k)), a !== s && (i = xe()) !== s ? o = a = [a, i] : (ae = o, o = s); + n !== s ? (u = r, l = n, e = r = [].concat.apply([u], l).join("")) : (ae = e, e = s); + } else ae = e, e = s; + return le[c] = { + nextPos: ae, + result: e + }, e; } - - return !1; - } - - return e(t, o, i); - }(t, l, i); - - case "matches": - var c, - f = a(r.selectors); - - try { - for (f.s(); !(c = f.n()).done;) { - var d = c.value; - if (u(t, d, n, o)) return !0; - } - } catch (e) { - f.e(e); - } finally { - f.f(); - } - - return !1; - - case "compound": - var m, - x = a(r.selectors); - - try { - for (x.s(); !(m = x.n()).done;) { - var v = m.value; - if (!u(t, v, n, o)) return !1; - } - } catch (e) { - x.e(e); - } finally { - x.f(); - } - - return !0; - - case "not": - var g, - b = a(r.selectors); - - try { - for (b.s(); !(g = b.n()).done;) { - var A = g.value; - if (u(t, A, n, o)) return !1; - } - } catch (e) { - b.e(e); - } finally { - b.f(); - } - - return !0; - - case "has": - var E = function () { - var e, - n = [], - i = a(r.selectors); - - try { - var l = function () { - var r = e.value, - a = []; - s.traverse(t, { - enter: function (e, t) { - null != t && a.unshift(t), u(e, r, a, o) && n.push(e); - }, - leave: function () { - a.shift(); - }, - keys: o && o.visitorKeys, - fallback: o && o.fallback || "iteration" - }); - }; - - for (i.s(); !(e = i.n()).done;) l(); - } catch (e) { - i.e(e); - } finally { - i.f(); - } - - return { - v: 0 !== n.length - }; - }(); - - if ("object" === e(E)) return E.v; - - case "child": - return !!u(t, r.right, n, o) && u(n[0], r.left, n.slice(1), o); - - case "descendant": - if (u(t, r.right, n, o)) for (var S = 0, _ = n.length; S < _; ++S) if (u(n[S], r.left, n.slice(S + 1), o)) return !0; - return !1; - - case "attribute": - var w = function (e, t) { - var r, - n = a(t.split(".")); - - try { - for (n.s(); !(r = n.n()).done;) { - var o = r.value; - if (null == e) return e; - e = e[o]; + function _e(e) { + return { + type: "nth-child", + index: { + type: "literal", + value: e + } + }; } - } catch (e) { - n.e(e); - } finally { - n.f(); + function Ce(e) { + return { + type: "nth-last-child", + index: { + type: "literal", + value: e + } + }; + } + if ((n = l()) !== s && ae === t.length) return n; + throw n !== s && ae < t.length && ye({ + type: "end" + }), o = ue, a = se < t.length ? t.charAt(se) : null, i = se < t.length ? he(se, se + 1) : he(se, se), new e(e.buildMessage(o, a), o, a, i); } - - return e; - }(t, r.name); - - switch (r.operator) { - case void 0: - return null != w; - - case "=": - switch (r.value.type) { - case "regexp": - return "string" == typeof w && r.value.value.test(w); - - case "literal": - return "".concat(r.value.value) === "".concat(w); - - case "type": - return r.value.value === e(w); - } - - throw new Error("Unknown selector value type: ".concat(r.value.type)); - - case "!=": - switch (r.value.type) { - case "regexp": - return !r.value.value.test(w); - - case "literal": - return "".concat(r.value.value) !== "".concat(w); - - case "type": - return r.value.value !== e(w); - } - - throw new Error("Unknown selector value type: ".concat(r.value.type)); - - case "<=": - return w <= r.value.value; - - case "<": - return w < r.value.value; - - case ">": - return w > r.value.value; - - case ">=": - return w >= r.value.value; - } - - throw new Error("Unknown operator: ".concat(r.operator)); - - case "sibling": - return u(t, r.right, n, o) && p(t, r.left, n, "LEFT_SIDE", o) || r.left.subject && u(t, r.left, n, o) && p(t, r.right, n, "RIGHT_SIDE", o); - - case "adjacent": - return u(t, r.right, n, o) && h(t, r.left, n, "LEFT_SIDE", o) || r.right.subject && u(t, r.left, n, o) && h(t, r.right, n, "RIGHT_SIDE", o); - - case "nth-child": - return u(t, r.right, n, o) && y(t, n, function () { - return r.index.value - 1; - }, o); - - case "nth-last-child": - return u(t, r.right, n, o) && y(t, n, function (e) { - return e - r.index.value; - }, o); - - case "class": - switch (r.name.toLowerCase()) { - case "statement": - if ("Statement" === t.type.slice(-9)) return !0; - - case "declaration": - return "Declaration" === t.type.slice(-11); - - case "pattern": - if ("Pattern" === t.type.slice(-7)) return !0; - - case "expression": - return "Expression" === t.type.slice(-10) || "Literal" === t.type.slice(-7) || "Identifier" === t.type && (0 === n.length || "MetaProperty" !== n[0].type) || "MetaProperty" === t.type; - - case "function": - return "FunctionDeclaration" === t.type || "FunctionExpression" === t.type || "ArrowFunctionExpression" === t.type; - } - - throw new Error("Unknown class name: ".concat(r.name)); + }; + }()); + }); + function u(e, t) { + for (var r = 0; r < t.length; ++r) { + if (null == e) return e; + e = e[t[r]]; } - - throw new Error("Unknown selector type: ".concat(r.type)); + return e; } - - function c(e, t) { - var r = e.type; - return t && t.visitorKeys && t.visitorKeys[r] ? t.visitorKeys[r] : s.VisitorKeys[r] ? s.VisitorKeys[r] : t && "function" == typeof t.fallback ? t.fallback(e) : Object.keys(e).filter(function (e) { - return "type" !== e; + var l = "function" == typeof WeakMap ? new WeakMap() : null; + function c(e) { + if (null == e) return function () { + return !0; + }; + if (null != l) { + var t = l.get(e); + return null != t || (t = f(e), l.set(e, t)), t; + } + return f(e); + } + function f(t) { + switch (t.type) { + case "wildcard": + return function () { + return !0; + }; + case "identifier": + var r = t.value.toLowerCase(); + return function (e, t, n) { + var o = n && n.nodeTypeKey || "type"; + return r === e[o].toLowerCase(); + }; + case "field": + var n = t.name.split("."); + return function (e, t) { + return function e(t, r, n, o) { + for (var a = r, i = o; i < n.length; ++i) { + if (null == a) return !1; + var s = a[n[i]]; + if (Array.isArray(s)) { + for (var u = 0; u < s.length; ++u) if (e(t, s[u], n, i + 1)) return !0; + return !1; + } + a = s; + } + return t === a; + }(e, t[n.length - 1], n, 0); + }; + case "matches": + var o = t.selectors.map(c); + return function (e, t, r) { + for (var n = 0; n < o.length; ++n) if (o[n](e, t, r)) return !0; + return !1; + }; + case "compound": + var a = t.selectors.map(c); + return function (e, t, r) { + for (var n = 0; n < a.length; ++n) if (!a[n](e, t, r)) return !1; + return !0; + }; + case "not": + var s = t.selectors.map(c); + return function (e, t, r) { + for (var n = 0; n < s.length; ++n) if (s[n](e, t, r)) return !1; + return !0; + }; + case "has": + var l = t.selectors.map(c); + return function (e, t, r) { + var n = !1, + o = []; + return i.traverse(e, { + enter: function (e, t) { + null != t && o.unshift(t); + for (var a = 0; a < l.length; ++a) if (l[a](e, o, r)) return n = !0, void this.break(); + }, + leave: function () { + o.shift(); + }, + keys: r && r.visitorKeys, + fallback: r && r.fallback || "iteration" + }), n; + }; + case "child": + var f = c(t.left), + p = c(t.right); + return function (e, t, r) { + return !!(t.length > 0 && p(e, t, r)) && f(t[0], t.slice(1), r); + }; + case "descendant": + var h = c(t.left), + x = c(t.right); + return function (e, t, r) { + if (x(e, t, r)) for (var n = 0, o = t.length; n < o; ++n) if (h(t[n], t.slice(n + 1), r)) return !0; + return !1; + }; + case "attribute": + var v = t.name.split("."); + switch (t.operator) { + case void 0: + return function (e) { + return null != u(e, v); + }; + case "=": + switch (t.value.type) { + case "regexp": + return function (e) { + var r = u(e, v); + return "string" == typeof r && t.value.value.test(r); + }; + case "literal": + var g = "".concat(t.value.value); + return function (e) { + return g === "".concat(u(e, v)); + }; + case "type": + return function (r) { + return t.value.value === e(u(r, v)); + }; + } + throw new Error("Unknown selector value type: ".concat(t.value.type)); + case "!=": + switch (t.value.type) { + case "regexp": + return function (e) { + return !t.value.value.test(u(e, v)); + }; + case "literal": + var A = "".concat(t.value.value); + return function (e) { + return A !== "".concat(u(e, v)); + }; + case "type": + return function (r) { + return t.value.value !== e(u(r, v)); + }; + } + throw new Error("Unknown selector value type: ".concat(t.value.type)); + case "<=": + return function (e) { + return u(e, v) <= t.value.value; + }; + case "<": + return function (e) { + return u(e, v) < t.value.value; + }; + case ">": + return function (e) { + return u(e, v) > t.value.value; + }; + case ">=": + return function (e) { + return u(e, v) >= t.value.value; + }; + } + throw new Error("Unknown operator: ".concat(t.operator)); + case "sibling": + var E = c(t.left), + b = c(t.right); + return function (e, r, n) { + return b(e, r, n) && y(e, E, r, "LEFT_SIDE", n) || t.left.subject && E(e, r, n) && y(e, b, r, "RIGHT_SIDE", n); + }; + case "adjacent": + var S = c(t.left), + _ = c(t.right); + return function (e, r, n) { + return _(e, r, n) && d(e, S, r, "LEFT_SIDE", n) || t.right.subject && S(e, r, n) && d(e, _, r, "RIGHT_SIDE", n); + }; + case "nth-child": + var C = t.index.value, + w = c(t.right); + return function (e, t, r) { + return w(e, t, r) && m(e, t, C, r); + }; + case "nth-last-child": + var P = -t.index.value, + k = c(t.right); + return function (e, t, r) { + return k(e, t, r) && m(e, t, P, r); + }; + case "class": + return function (e, r, n) { + if (n && n.matchClass) return n.matchClass(t.name, e, r); + if (n && n.nodeTypeKey) return !1; + switch (t.name.toLowerCase()) { + case "statement": + if ("Statement" === e.type.slice(-9)) return !0; + case "declaration": + return "Declaration" === e.type.slice(-11); + case "pattern": + if ("Pattern" === e.type.slice(-7)) return !0; + case "expression": + return "Expression" === e.type.slice(-10) || "Literal" === e.type.slice(-7) || "Identifier" === e.type && (0 === r.length || "MetaProperty" !== r[0].type) || "MetaProperty" === e.type; + case "function": + return "FunctionDeclaration" === e.type || "FunctionExpression" === e.type || "ArrowFunctionExpression" === e.type; + } + throw new Error("Unknown class name: ".concat(t.name)); + }; + } + throw new Error("Unknown selector type: ".concat(t.type)); + } + function p(e, t) { + var r = t && t.nodeTypeKey || "type", + n = e[r]; + return t && t.visitorKeys && t.visitorKeys[n] ? t.visitorKeys[n] : i.VisitorKeys[n] ? i.VisitorKeys[n] : t && "function" == typeof t.fallback ? t.fallback(e) : Object.keys(e).filter(function (e) { + return e !== r; }); } - - function f(t) { - return null !== t && "object" === e(t) && "string" == typeof t.type; + function h(t, r) { + var n = r && r.nodeTypeKey || "type"; + return null !== t && "object" === e(t) && "string" == typeof t[n]; } - - function p(e, r, n, o, i) { - var s = t(n, 1)[0]; - if (!s) return !1; - var l, - p = a(c(s, i)); - - try { - for (p.s(); !(l = p.n()).done;) { - var h = s[l.value]; - - if (Array.isArray(h)) { - var y = h.indexOf(e); - if (y < 0) continue; - var d = void 0, - m = void 0; - "LEFT_SIDE" === o ? (d = 0, m = y) : (d = y + 1, m = h.length); - - for (var x = d; x < m; ++x) if (f(h[x]) && u(h[x], r, n, i)) return !0; - } - } - } catch (e) { - p.e(e); - } finally { - p.f(); - } - - return !1; - } - - function h(e, r, n, o, i) { - var s = t(n, 1)[0]; - if (!s) return !1; - var l, - p = a(c(s, i)); - - try { - for (p.s(); !(l = p.n()).done;) { - var h = s[l.value]; - - if (Array.isArray(h)) { - var y = h.indexOf(e); - if (y < 0) continue; - if ("LEFT_SIDE" === o && y > 0 && f(h[y - 1]) && u(h[y - 1], r, n, i)) return !0; - if ("RIGHT_SIDE" === o && y < h.length - 1 && f(h[y + 1]) && u(h[y + 1], r, n, i)) return !0; - } - } - } catch (e) { - p.e(e); - } finally { - p.f(); - } - - return !1; - } - - function y(e, r, n, o) { - var i = t(r, 1)[0]; + function y(e, r, n, o, a) { + var i = t(n, 1)[0]; if (!i) return !1; - var s, - l = a(c(i, o)); - - try { - for (l.s(); !(s = l.n()).done;) { - var u = i[s.value]; - - if (Array.isArray(u)) { - var f = u.indexOf(e); - if (f >= 0 && f === n(u.length)) return !0; - } + for (var s = p(i, a), u = 0; u < s.length; ++u) { + var l = i[s[u]]; + if (Array.isArray(l)) { + var c = l.indexOf(e); + if (c < 0) continue; + var f = void 0, + y = void 0; + "LEFT_SIDE" === o ? (f = 0, y = c) : (f = c + 1, y = l.length); + for (var d = f; d < y; ++d) if (h(l[d], a) && r(l[d], n, a)) return !0; } - } catch (e) { - l.e(e); - } finally { - l.f(); } - return !1; } - - function d(n, o) { - if (null == n || "object" != e(n)) return []; - null == o && (o = n); - - for (var a = n.subject ? [o] : [], i = 0, s = function (e) { - for (var t = [], r = Object.keys(e), n = 0; n < r.length; n++) t.push([r[n], e[r[n]]]); - - return t; - }(n); i < s.length; i++) { - var l = t(s[i], 2), - u = l[0], - c = l[1]; - a.push.apply(a, r(d(c, "left" === u ? c : o))); + function d(e, r, n, o, a) { + var i = t(n, 1)[0]; + if (!i) return !1; + for (var s = p(i, a), u = 0; u < s.length; ++u) { + var l = i[s[u]]; + if (Array.isArray(l)) { + var c = l.indexOf(e); + if (c < 0) continue; + if ("LEFT_SIDE" === o && c > 0 && h(l[c - 1], a) && r(l[c - 1], n, a)) return !0; + if ("RIGHT_SIDE" === o && c < l.length - 1 && h(l[c + 1], a) && r(l[c + 1], n, a)) return !0; + } } - - return a; + return !1; } - - function m(e, t, r, n) { - if (t) { - var o = [], - a = d(t); - s.traverse(e, { - enter: function (e, i) { - if (null != i && o.unshift(i), u(e, t, o, n)) if (a.length) for (var s = 0, l = a.length; s < l; ++s) { - u(e, a[s], o, n) && r(e, i, o); - - for (var c = 0, f = o.length; c < f; ++c) { - var p = o.slice(c + 1); - u(o[c], a[s], p, n) && r(o[c], i, p); + function m(e, r, n, o) { + if (0 === n) return !1; + var a = t(r, 1)[0]; + if (!a) return !1; + for (var i = p(a, o), s = 0; s < i.length; ++s) { + var u = a[i[s]]; + if (Array.isArray(u)) { + var l = n < 0 ? u.length + n : n - 1; + if (l >= 0 && l < u.length && u[l] === e) return !0; + } + } + return !1; + } + function x(t, n, o, a) { + if (n) { + var s = [], + u = c(n), + l = function t(n, o) { + if (null == n || "object" != e(n)) return []; + null == o && (o = n); + for (var a = n.subject ? [o] : [], i = Object.keys(n), s = 0; s < i.length; ++s) { + var u = i[s], + l = n[u]; + a.push.apply(a, r(t(l, "left" === u ? l : o))); + } + return a; + }(n).map(c); + i.traverse(t, { + enter: function (e, t) { + if (null != t && s.unshift(t), u(e, s, a)) if (l.length) for (var r = 0, n = l.length; r < n; ++r) { + l[r](e, s, a) && o(e, t, s); + for (var i = 0, c = s.length; i < c; ++i) { + var f = s.slice(i + 1); + l[r](s[i], f, a) && o(s[i], t, f); } - } else r(e, i, o); + } else o(e, t, s); }, leave: function () { - o.shift(); + s.shift(); }, - keys: n && n.visitorKeys, - fallback: n && n.fallback || "iteration" + keys: a && a.visitorKeys, + fallback: a && a.fallback || "iteration" }); } } - - function x(e, t, r) { + function v(e, t, r) { var n = []; - return m(e, t, function (e) { + return x(e, t, function (e) { n.push(e); }, r), n; } - - function v(e) { - return l.parse(e); + function g(e) { + return s.parse(e); } - - function g(e, t, r) { - return x(e, v(t), r); + function A(e, t, r) { + return v(e, g(t), r); } - - return g.parse = v, g.match = x, g.traverse = m, g.matches = u, g.query = g, g; + return A.parse = g, A.match = v, A.traverse = x, A.matches = function (e, t, r, n) { + return !t || !!e && (r || (r = []), c(t)(e, r, n)); + }, A.query = A, A; }); /***/ }), -/* 611 */ +/* 632 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -60308,18 +53426,22 @@ module.exports = NodeEventGenerator; * @fileoverview A helper that translates context.report() calls from the rule API into generic problem objects * @author Teddy Katz */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const assert = __webpack_require__(525); +const ruleFixer = __webpack_require__(633); +const interpolate = __webpack_require__(634); -const assert = __webpack_require__(503); - -const ruleFixer = __webpack_require__(612); - -const interpolate = __webpack_require__(613); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Typedefs //------------------------------------------------------------------------------ +/** @typedef {import("../shared/types").LintMessage} LintMessage */ + /** * An error message description * @typedef {Object} MessageDescriptor @@ -60332,22 +53454,6 @@ const interpolate = __webpack_require__(613); //-------------------------------- * @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 The rule ID - * @property {(0|1|2)} severity Severity of the error - * @property {(string|undefined)} message The message - * @property {(string|undefined)} [messageId] The message ID - * @property {number} line The line number - * @property {number} column The column number - * @property {(number|undefined)} [endLine] The ending line number - * @property {(number|undefined)} [endColumn] The ending column number - * @property {(string|null)} nodeType Type of node - * @property {string} source Source text - * @property {({text: string, range: (number[]|null)}|null)} [fix] The fix object - * @property {Array<{text: string, range: (number[]|null)}|null>} [suggestions] Suggestion info - */ //------------------------------------------------------------------------------ // Module Definition //------------------------------------------------------------------------------ @@ -60357,16 +53463,14 @@ const interpolate = __webpack_require__(613); //-------------------------------- * @param {...*} args A list of arguments passed to `context.report` * @returns {MessageDescriptor} A normalized object containing report information */ - - function normalizeMultiArgReportCall() { // If there is one argument, it is considered to be a new-style call already. if (arguments.length === 1) { // Shallow clone the object to avoid surprises if reusing the descriptor return Object.assign({}, arguments.length <= 0 ? undefined : arguments[0]); - } // If the second argument is a string, the arguments are interpreted as [node, message, data, fix]. - + } + // If the second argument is a string, the arguments are interpreted as [node, message, data, fix]. if (typeof (arguments.length <= 1 ? undefined : arguments[1]) === "string") { return { node: arguments.length <= 0 ? undefined : arguments[0], @@ -60374,9 +53478,9 @@ function normalizeMultiArgReportCall() { data: arguments.length <= 2 ? undefined : arguments[2], fix: arguments.length <= 3 ? undefined : arguments[3] }; - } // Otherwise, the arguments are interpreted as [node, loc, message, data, fix]. - + } + // Otherwise, the arguments are interpreted as [node, loc, message, data, fix]. return { node: arguments.length <= 0 ? undefined : arguments[0], loc: arguments.length <= 1 ? undefined : arguments[1], @@ -60385,14 +53489,13 @@ function normalizeMultiArgReportCall() { fix: arguments.length <= 4 ? undefined : arguments[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"); @@ -60400,40 +53503,37 @@ function assertValidNodeInfo(descriptor) { 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; } + /** * Check that a fix has a valid range. * @param {Fix|null} fix The fix to validate. * @returns {void} */ - - function assertValidFix(fix) { if (fix) { assert(fix.range && typeof fix.range[0] === "number" && typeof fix.range[1] === "number", `Fix has invalid range: ${JSON.stringify(fix, null, 2)}`); } } + /** * Compares items in a fixes array by range. * @param {Fix} a The first message. @@ -60441,56 +53541,47 @@ function assertValidFix(fix) { * @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) { for (const fix of fixes) { assertValidFix(fix); } - 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. @@ -60498,23 +53589,22 @@ function mergeFixes(fixes, sourceCode) { * @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} + } + // @type {null | Fix | Fix[] | IterableIterator} + const fix = descriptor.fix(ruleFixer); - const fix = descriptor.fix(ruleFixer); // Merge to one. - + // Merge to one. if (fix && Symbol.iterator in fix) { return mergeFixes(Array.from(fix), sourceCode); } - assertValidFix(fix); return fix; } + /** * Gets an array of suggestion objects from the given descriptor. * @param {MessageDescriptor} descriptor The report descriptor. @@ -60522,20 +53612,20 @@ function normalizeFixes(descriptor, sourceCode) { * @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, + return { + ...suggestInfo, desc: interpolate(computedDesc, suggestInfo.data), fix: normalizeFixes(suggestInfo, sourceCode) }; - }) // Remove suggestions that didn't provide a fix + }) + + // Remove suggestions that didn't provide a fix .filter(_ref => { let { fix @@ -60543,6 +53633,7 @@ function mapSuggestions(descriptor, sourceCode, messages) { return fix; }); } + /** * Creates information about the report from a descriptor * @param {Object} options Information about the problem @@ -60554,10 +53645,8 @@ function mapSuggestions(descriptor, sourceCode, messages) { * @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 + * @returns {LintMessage} Information about the report */ - - function createProblem(options) { const problem = { ruleId: options.ruleId, @@ -60567,38 +53656,33 @@ function createProblem(options) { 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 => { @@ -60606,37 +53690,33 @@ function validateSuggestions(suggest, messages) { 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 + * @returns {function(...args): LintMessage} 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. @@ -60649,29 +53729,23 @@ module.exports = function createReportTranslator(metadata) { 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, @@ -60687,7 +53761,7 @@ module.exports = function createReportTranslator(metadata) { }; /***/ }), -/* 612 */ +/* 633 */ /***/ ((module) => { "use strict"; @@ -60695,10 +53769,14 @@ module.exports = function createReportTranslator(metadata) { * @fileoverview An object that creates fix commands for rules. * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ + // none! + //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -60710,13 +53788,14 @@ module.exports = function createReportTranslator(metadata) { * @returns {Object} The fix command. * @private */ - function insertTextAt(index, text) { return { range: [index, index], text }; -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ @@ -60724,7 +53803,6 @@ function insertTextAt(index, text) { * Creates code fixing commands for rules. */ - const ruleFixer = Object.freeze({ /** * Creates a fix command that inserts text after the given node or token. @@ -60736,7 +53814,6 @@ const ruleFixer = Object.freeze({ 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. @@ -60748,7 +53825,6 @@ const ruleFixer = Object.freeze({ 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. @@ -60759,7 +53835,6 @@ const ruleFixer = Object.freeze({ 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. @@ -60771,7 +53846,6 @@ const ruleFixer = Object.freeze({ 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. @@ -60782,7 +53856,6 @@ const ruleFixer = Object.freeze({ 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. @@ -60797,7 +53870,6 @@ const ruleFixer = Object.freeze({ text }; }, - /** * Creates a fix command that removes the node or token from the source. * The fix is not applied until applyFixes() is called. @@ -60807,7 +53879,6 @@ const ruleFixer = Object.freeze({ 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. @@ -60821,12 +53892,11 @@ const ruleFixer = Object.freeze({ text: "" }; } - }); module.exports = ruleFixer; /***/ }), -/* 613 */ +/* 634 */ /***/ ((module) => { "use strict"; @@ -60834,30 +53904,31 @@ module.exports = ruleFixer; * @fileoverview Interpolate keys from an object into a string with {{ }} markers. * @author Jed Fox */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ - module.exports = (text, data) => { if (!data) { return text; - } // Substitution content for any {{ }} markers. - + } + // 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. - + } + // Preserve old behavior: If parameter name not provided, don't replace it. return fullMatch; }); }; /***/ }), -/* 614 */ +/* 635 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -60866,11 +53937,15 @@ module.exports = (text, data) => { * @author Nicholas C. Zakas * @author aladdin-add */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const builtInRules = __webpack_require__(636); -const builtInRules = __webpack_require__(615); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -60880,74 +53955,63 @@ const builtInRules = __webpack_require__(615); //------------------------------- * ("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 //------------------------------------------------------------------------------ /** * A storage for rules. */ - - 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, __webpack_require__(945)(this._rules[ruleId])); + this.define(ruleId, __webpack_require__(955)(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; /***/ }), -/* 615 */ +/* 636 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -60957,306 +54021,309 @@ module.exports = Rules; * @author Peter (Somogyvari) Metz */ -/* eslint sort-keys: ["error", "asc"] -- More readable for long list */ + +/* eslint sort-keys: ["error", "asc"] -- More readable for long list */ const { LazyLoadingRuleMap -} = __webpack_require__(616); +} = __webpack_require__(637); + /** @type {Map} */ - - module.exports = new LazyLoadingRuleMap(Object.entries({ - "accessor-pairs": () => __webpack_require__(617), - "array-bracket-newline": () => __webpack_require__(623), - "array-bracket-spacing": () => __webpack_require__(624), - "array-callback-return": () => __webpack_require__(625), - "array-element-newline": () => __webpack_require__(626), - "arrow-body-style": () => __webpack_require__(627), - "arrow-parens": () => __webpack_require__(628), - "arrow-spacing": () => __webpack_require__(629), - "block-scoped-var": () => __webpack_require__(630), - "block-spacing": () => __webpack_require__(631), - "brace-style": () => __webpack_require__(632), - "callback-return": () => __webpack_require__(633), - camelcase: () => __webpack_require__(634), - "capitalized-comments": () => __webpack_require__(635), - "class-methods-use-this": () => __webpack_require__(637), - "comma-dangle": () => __webpack_require__(638), - "comma-spacing": () => __webpack_require__(639), - "comma-style": () => __webpack_require__(640), - complexity: () => __webpack_require__(641), - "computed-property-spacing": () => __webpack_require__(643), - "consistent-return": () => __webpack_require__(644), - "consistent-this": () => __webpack_require__(645), - "constructor-super": () => __webpack_require__(646), - curly: () => __webpack_require__(647), - "default-case": () => __webpack_require__(648), - "default-case-last": () => __webpack_require__(649), - "default-param-last": () => __webpack_require__(650), - "dot-location": () => __webpack_require__(651), - "dot-notation": () => __webpack_require__(652), - "eol-last": () => __webpack_require__(654), - eqeqeq: () => __webpack_require__(655), - "for-direction": () => __webpack_require__(656), - "func-call-spacing": () => __webpack_require__(657), - "func-name-matching": () => __webpack_require__(658), - "func-names": () => __webpack_require__(659), - "func-style": () => __webpack_require__(660), - "function-call-argument-newline": () => __webpack_require__(661), - "function-paren-newline": () => __webpack_require__(662), - "generator-star-spacing": () => __webpack_require__(663), - "getter-return": () => __webpack_require__(664), - "global-require": () => __webpack_require__(665), - "grouped-accessor-pairs": () => __webpack_require__(666), - "guard-for-in": () => __webpack_require__(667), - "handle-callback-err": () => __webpack_require__(668), - "id-blacklist": () => __webpack_require__(669), - "id-denylist": () => __webpack_require__(670), - "id-length": () => __webpack_require__(671), - "id-match": () => __webpack_require__(672), - "implicit-arrow-linebreak": () => __webpack_require__(673), - indent: () => __webpack_require__(674), - "indent-legacy": () => __webpack_require__(694), - "init-declarations": () => __webpack_require__(695), - "jsx-quotes": () => __webpack_require__(696), - "key-spacing": () => __webpack_require__(697), - "keyword-spacing": () => __webpack_require__(699), - "line-comment-position": () => __webpack_require__(700), - "linebreak-style": () => __webpack_require__(701), - "lines-around-comment": () => __webpack_require__(702), - "lines-around-directive": () => __webpack_require__(703), - "lines-between-class-members": () => __webpack_require__(704), - "max-classes-per-file": () => __webpack_require__(705), - "max-depth": () => __webpack_require__(706), - "max-len": () => __webpack_require__(707), - "max-lines": () => __webpack_require__(708), - "max-lines-per-function": () => __webpack_require__(709), - "max-nested-callbacks": () => __webpack_require__(710), - "max-params": () => __webpack_require__(711), - "max-statements": () => __webpack_require__(712), - "max-statements-per-line": () => __webpack_require__(713), - "multiline-comment-style": () => __webpack_require__(714), - "multiline-ternary": () => __webpack_require__(715), - "new-cap": () => __webpack_require__(716), - "new-parens": () => __webpack_require__(717), - "newline-after-var": () => __webpack_require__(718), - "newline-before-return": () => __webpack_require__(719), - "newline-per-chained-call": () => __webpack_require__(720), - "no-alert": () => __webpack_require__(721), - "no-array-constructor": () => __webpack_require__(722), - "no-async-promise-executor": () => __webpack_require__(723), - "no-await-in-loop": () => __webpack_require__(724), - "no-bitwise": () => __webpack_require__(725), - "no-buffer-constructor": () => __webpack_require__(726), - "no-caller": () => __webpack_require__(727), - "no-case-declarations": () => __webpack_require__(728), - "no-catch-shadow": () => __webpack_require__(729), - "no-class-assign": () => __webpack_require__(730), - "no-compare-neg-zero": () => __webpack_require__(731), - "no-cond-assign": () => __webpack_require__(732), - "no-confusing-arrow": () => __webpack_require__(733), - "no-console": () => __webpack_require__(734), - "no-const-assign": () => __webpack_require__(735), - "no-constant-binary-expression": () => __webpack_require__(736), - "no-constant-condition": () => __webpack_require__(737), - "no-constructor-return": () => __webpack_require__(738), - "no-continue": () => __webpack_require__(739), - "no-control-regex": () => __webpack_require__(740), - "no-debugger": () => __webpack_require__(742), - "no-delete-var": () => __webpack_require__(743), - "no-div-regex": () => __webpack_require__(744), - "no-dupe-args": () => __webpack_require__(745), - "no-dupe-class-members": () => __webpack_require__(746), - "no-dupe-else-if": () => __webpack_require__(747), - "no-dupe-keys": () => __webpack_require__(748), - "no-duplicate-case": () => __webpack_require__(749), - "no-duplicate-imports": () => __webpack_require__(750), - "no-else-return": () => __webpack_require__(751), - "no-empty": () => __webpack_require__(753), - "no-empty-character-class": () => __webpack_require__(754), - "no-empty-function": () => __webpack_require__(755), - "no-empty-pattern": () => __webpack_require__(756), - "no-eq-null": () => __webpack_require__(757), - "no-eval": () => __webpack_require__(758), - "no-ex-assign": () => __webpack_require__(759), - "no-extend-native": () => __webpack_require__(760), - "no-extra-bind": () => __webpack_require__(761), - "no-extra-boolean-cast": () => __webpack_require__(762), - "no-extra-label": () => __webpack_require__(763), - "no-extra-parens": () => __webpack_require__(764), - "no-extra-semi": () => __webpack_require__(765), - "no-fallthrough": () => __webpack_require__(766), - "no-floating-decimal": () => __webpack_require__(767), - "no-func-assign": () => __webpack_require__(768), - "no-global-assign": () => __webpack_require__(769), - "no-implicit-coercion": () => __webpack_require__(770), - "no-implicit-globals": () => __webpack_require__(771), - "no-implied-eval": () => __webpack_require__(772), - "no-import-assign": () => __webpack_require__(773), - "no-inline-comments": () => __webpack_require__(774), - "no-inner-declarations": () => __webpack_require__(775), - "no-invalid-regexp": () => __webpack_require__(776), - "no-invalid-this": () => __webpack_require__(777), - "no-irregular-whitespace": () => __webpack_require__(778), - "no-iterator": () => __webpack_require__(779), - "no-label-var": () => __webpack_require__(780), - "no-labels": () => __webpack_require__(781), - "no-lone-blocks": () => __webpack_require__(782), - "no-lonely-if": () => __webpack_require__(783), - "no-loop-func": () => __webpack_require__(784), - "no-loss-of-precision": () => __webpack_require__(785), - "no-magic-numbers": () => __webpack_require__(786), - "no-misleading-character-class": () => __webpack_require__(787), - "no-mixed-operators": () => __webpack_require__(793), - "no-mixed-requires": () => __webpack_require__(794), - "no-mixed-spaces-and-tabs": () => __webpack_require__(795), - "no-multi-assign": () => __webpack_require__(796), - "no-multi-spaces": () => __webpack_require__(797), - "no-multi-str": () => __webpack_require__(798), - "no-multiple-empty-lines": () => __webpack_require__(799), - "no-native-reassign": () => __webpack_require__(800), - "no-negated-condition": () => __webpack_require__(801), - "no-negated-in-lhs": () => __webpack_require__(802), - "no-nested-ternary": () => __webpack_require__(803), - "no-new": () => __webpack_require__(804), - "no-new-func": () => __webpack_require__(805), - "no-new-object": () => __webpack_require__(806), - "no-new-require": () => __webpack_require__(807), - "no-new-symbol": () => __webpack_require__(808), - "no-new-wrappers": () => __webpack_require__(809), - "no-nonoctal-decimal-escape": () => __webpack_require__(810), - "no-obj-calls": () => __webpack_require__(811), - "no-octal": () => __webpack_require__(812), - "no-octal-escape": () => __webpack_require__(813), - "no-param-reassign": () => __webpack_require__(814), - "no-path-concat": () => __webpack_require__(815), - "no-plusplus": () => __webpack_require__(816), - "no-process-env": () => __webpack_require__(817), - "no-process-exit": () => __webpack_require__(818), - "no-promise-executor-return": () => __webpack_require__(819), - "no-proto": () => __webpack_require__(820), - "no-prototype-builtins": () => __webpack_require__(821), - "no-redeclare": () => __webpack_require__(822), - "no-regex-spaces": () => __webpack_require__(823), - "no-restricted-exports": () => __webpack_require__(824), - "no-restricted-globals": () => __webpack_require__(825), - "no-restricted-imports": () => __webpack_require__(826), - "no-restricted-modules": () => __webpack_require__(828), - "no-restricted-properties": () => __webpack_require__(829), - "no-restricted-syntax": () => __webpack_require__(830), - "no-return-assign": () => __webpack_require__(831), - "no-return-await": () => __webpack_require__(832), - "no-script-url": () => __webpack_require__(833), - "no-self-assign": () => __webpack_require__(834), - "no-self-compare": () => __webpack_require__(835), - "no-sequences": () => __webpack_require__(836), - "no-setter-return": () => __webpack_require__(837), - "no-shadow": () => __webpack_require__(838), - "no-shadow-restricted-names": () => __webpack_require__(839), - "no-spaced-func": () => __webpack_require__(840), - "no-sparse-arrays": () => __webpack_require__(841), - "no-sync": () => __webpack_require__(842), - "no-tabs": () => __webpack_require__(843), - "no-template-curly-in-string": () => __webpack_require__(844), - "no-ternary": () => __webpack_require__(845), - "no-this-before-super": () => __webpack_require__(846), - "no-throw-literal": () => __webpack_require__(847), - "no-trailing-spaces": () => __webpack_require__(848), - "no-undef": () => __webpack_require__(849), - "no-undef-init": () => __webpack_require__(850), - "no-undefined": () => __webpack_require__(851), - "no-underscore-dangle": () => __webpack_require__(852), - "no-unexpected-multiline": () => __webpack_require__(853), - "no-unmodified-loop-condition": () => __webpack_require__(854), - "no-unneeded-ternary": () => __webpack_require__(855), - "no-unreachable": () => __webpack_require__(856), - "no-unreachable-loop": () => __webpack_require__(857), - "no-unsafe-finally": () => __webpack_require__(858), - "no-unsafe-negation": () => __webpack_require__(859), - "no-unsafe-optional-chaining": () => __webpack_require__(860), - "no-unused-expressions": () => __webpack_require__(861), - "no-unused-labels": () => __webpack_require__(862), - "no-unused-private-class-members": () => __webpack_require__(863), - "no-unused-vars": () => __webpack_require__(864), - "no-use-before-define": () => __webpack_require__(865), - "no-useless-backreference": () => __webpack_require__(866), - "no-useless-call": () => __webpack_require__(867), - "no-useless-catch": () => __webpack_require__(868), - "no-useless-computed-key": () => __webpack_require__(869), - "no-useless-concat": () => __webpack_require__(870), - "no-useless-constructor": () => __webpack_require__(871), - "no-useless-escape": () => __webpack_require__(872), - "no-useless-rename": () => __webpack_require__(873), - "no-useless-return": () => __webpack_require__(874), - "no-var": () => __webpack_require__(875), - "no-void": () => __webpack_require__(876), - "no-warning-comments": () => __webpack_require__(877), - "no-whitespace-before-property": () => __webpack_require__(878), - "no-with": () => __webpack_require__(879), - "nonblock-statement-body-position": () => __webpack_require__(880), - "object-curly-newline": () => __webpack_require__(881), - "object-curly-spacing": () => __webpack_require__(882), - "object-property-newline": () => __webpack_require__(883), - "object-shorthand": () => __webpack_require__(884), - "one-var": () => __webpack_require__(885), - "one-var-declaration-per-line": () => __webpack_require__(886), - "operator-assignment": () => __webpack_require__(887), - "operator-linebreak": () => __webpack_require__(888), - "padded-blocks": () => __webpack_require__(889), - "padding-line-between-statements": () => __webpack_require__(890), - "prefer-arrow-callback": () => __webpack_require__(891), - "prefer-const": () => __webpack_require__(892), - "prefer-destructuring": () => __webpack_require__(893), - "prefer-exponentiation-operator": () => __webpack_require__(894), - "prefer-named-capture-group": () => __webpack_require__(895), - "prefer-numeric-literals": () => __webpack_require__(896), - "prefer-object-has-own": () => __webpack_require__(897), - "prefer-object-spread": () => __webpack_require__(898), - "prefer-promise-reject-errors": () => __webpack_require__(899), - "prefer-reflect": () => __webpack_require__(900), - "prefer-regex-literals": () => __webpack_require__(901), - "prefer-rest-params": () => __webpack_require__(902), - "prefer-spread": () => __webpack_require__(903), - "prefer-template": () => __webpack_require__(904), - "quote-props": () => __webpack_require__(905), - quotes: () => __webpack_require__(906), - radix: () => __webpack_require__(907), - "require-atomic-updates": () => __webpack_require__(908), - "require-await": () => __webpack_require__(909), - "require-jsdoc": () => __webpack_require__(910), - "require-unicode-regexp": () => __webpack_require__(911), - "require-yield": () => __webpack_require__(912), - "rest-spread-spacing": () => __webpack_require__(913), - semi: () => __webpack_require__(914), - "semi-spacing": () => __webpack_require__(915), - "semi-style": () => __webpack_require__(916), - "sort-imports": () => __webpack_require__(917), - "sort-keys": () => __webpack_require__(918), - "sort-vars": () => __webpack_require__(920), - "space-before-blocks": () => __webpack_require__(921), - "space-before-function-paren": () => __webpack_require__(922), - "space-in-parens": () => __webpack_require__(923), - "space-infix-ops": () => __webpack_require__(924), - "space-unary-ops": () => __webpack_require__(925), - "spaced-comment": () => __webpack_require__(926), - strict: () => __webpack_require__(927), - "switch-colon-spacing": () => __webpack_require__(928), - "symbol-description": () => __webpack_require__(929), - "template-curly-spacing": () => __webpack_require__(930), - "template-tag-spacing": () => __webpack_require__(931), - "unicode-bom": () => __webpack_require__(932), - "use-isnan": () => __webpack_require__(933), - "valid-jsdoc": () => __webpack_require__(934), - "valid-typeof": () => __webpack_require__(939), - "vars-on-top": () => __webpack_require__(940), - "wrap-iife": () => __webpack_require__(941), - "wrap-regex": () => __webpack_require__(942), - "yield-star-spacing": () => __webpack_require__(943), - yoda: () => __webpack_require__(944) + "accessor-pairs": () => __webpack_require__(638), + "array-bracket-newline": () => __webpack_require__(644), + "array-bracket-spacing": () => __webpack_require__(645), + "array-callback-return": () => __webpack_require__(646), + "array-element-newline": () => __webpack_require__(647), + "arrow-body-style": () => __webpack_require__(648), + "arrow-parens": () => __webpack_require__(649), + "arrow-spacing": () => __webpack_require__(650), + "block-scoped-var": () => __webpack_require__(651), + "block-spacing": () => __webpack_require__(652), + "brace-style": () => __webpack_require__(653), + "callback-return": () => __webpack_require__(654), + camelcase: () => __webpack_require__(655), + "capitalized-comments": () => __webpack_require__(656), + "class-methods-use-this": () => __webpack_require__(658), + "comma-dangle": () => __webpack_require__(659), + "comma-spacing": () => __webpack_require__(660), + "comma-style": () => __webpack_require__(661), + complexity: () => __webpack_require__(662), + "computed-property-spacing": () => __webpack_require__(669), + "consistent-return": () => __webpack_require__(670), + "consistent-this": () => __webpack_require__(671), + "constructor-super": () => __webpack_require__(672), + curly: () => __webpack_require__(673), + "default-case": () => __webpack_require__(674), + "default-case-last": () => __webpack_require__(675), + "default-param-last": () => __webpack_require__(676), + "dot-location": () => __webpack_require__(677), + "dot-notation": () => __webpack_require__(678), + "eol-last": () => __webpack_require__(680), + eqeqeq: () => __webpack_require__(681), + "for-direction": () => __webpack_require__(682), + "func-call-spacing": () => __webpack_require__(683), + "func-name-matching": () => __webpack_require__(684), + "func-names": () => __webpack_require__(685), + "func-style": () => __webpack_require__(686), + "function-call-argument-newline": () => __webpack_require__(687), + "function-paren-newline": () => __webpack_require__(688), + "generator-star-spacing": () => __webpack_require__(689), + "getter-return": () => __webpack_require__(690), + "global-require": () => __webpack_require__(691), + "grouped-accessor-pairs": () => __webpack_require__(692), + "guard-for-in": () => __webpack_require__(693), + "handle-callback-err": () => __webpack_require__(694), + "id-blacklist": () => __webpack_require__(695), + "id-denylist": () => __webpack_require__(696), + "id-length": () => __webpack_require__(697), + "id-match": () => __webpack_require__(698), + "implicit-arrow-linebreak": () => __webpack_require__(699), + indent: () => __webpack_require__(700), + "indent-legacy": () => __webpack_require__(701), + "init-declarations": () => __webpack_require__(702), + "jsx-quotes": () => __webpack_require__(703), + "key-spacing": () => __webpack_require__(704), + "keyword-spacing": () => __webpack_require__(705), + "line-comment-position": () => __webpack_require__(706), + "linebreak-style": () => __webpack_require__(707), + "lines-around-comment": () => __webpack_require__(708), + "lines-around-directive": () => __webpack_require__(709), + "lines-between-class-members": () => __webpack_require__(710), + "logical-assignment-operators": () => __webpack_require__(711), + "max-classes-per-file": () => __webpack_require__(712), + "max-depth": () => __webpack_require__(713), + "max-len": () => __webpack_require__(714), + "max-lines": () => __webpack_require__(715), + "max-lines-per-function": () => __webpack_require__(716), + "max-nested-callbacks": () => __webpack_require__(717), + "max-params": () => __webpack_require__(718), + "max-statements": () => __webpack_require__(719), + "max-statements-per-line": () => __webpack_require__(720), + "multiline-comment-style": () => __webpack_require__(721), + "multiline-ternary": () => __webpack_require__(722), + "new-cap": () => __webpack_require__(723), + "new-parens": () => __webpack_require__(724), + "newline-after-var": () => __webpack_require__(725), + "newline-before-return": () => __webpack_require__(726), + "newline-per-chained-call": () => __webpack_require__(727), + "no-alert": () => __webpack_require__(728), + "no-array-constructor": () => __webpack_require__(729), + "no-async-promise-executor": () => __webpack_require__(730), + "no-await-in-loop": () => __webpack_require__(731), + "no-bitwise": () => __webpack_require__(732), + "no-buffer-constructor": () => __webpack_require__(733), + "no-caller": () => __webpack_require__(734), + "no-case-declarations": () => __webpack_require__(735), + "no-catch-shadow": () => __webpack_require__(736), + "no-class-assign": () => __webpack_require__(737), + "no-compare-neg-zero": () => __webpack_require__(738), + "no-cond-assign": () => __webpack_require__(739), + "no-confusing-arrow": () => __webpack_require__(740), + "no-console": () => __webpack_require__(741), + "no-const-assign": () => __webpack_require__(742), + "no-constant-binary-expression": () => __webpack_require__(743), + "no-constant-condition": () => __webpack_require__(744), + "no-constructor-return": () => __webpack_require__(745), + "no-continue": () => __webpack_require__(746), + "no-control-regex": () => __webpack_require__(747), + "no-debugger": () => __webpack_require__(749), + "no-delete-var": () => __webpack_require__(750), + "no-div-regex": () => __webpack_require__(751), + "no-dupe-args": () => __webpack_require__(752), + "no-dupe-class-members": () => __webpack_require__(753), + "no-dupe-else-if": () => __webpack_require__(754), + "no-dupe-keys": () => __webpack_require__(755), + "no-duplicate-case": () => __webpack_require__(756), + "no-duplicate-imports": () => __webpack_require__(757), + "no-else-return": () => __webpack_require__(758), + "no-empty": () => __webpack_require__(760), + "no-empty-character-class": () => __webpack_require__(761), + "no-empty-function": () => __webpack_require__(762), + "no-empty-pattern": () => __webpack_require__(763), + "no-empty-static-block": () => __webpack_require__(764), + "no-eq-null": () => __webpack_require__(765), + "no-eval": () => __webpack_require__(766), + "no-ex-assign": () => __webpack_require__(767), + "no-extend-native": () => __webpack_require__(768), + "no-extra-bind": () => __webpack_require__(769), + "no-extra-boolean-cast": () => __webpack_require__(770), + "no-extra-label": () => __webpack_require__(771), + "no-extra-parens": () => __webpack_require__(772), + "no-extra-semi": () => __webpack_require__(773), + "no-fallthrough": () => __webpack_require__(774), + "no-floating-decimal": () => __webpack_require__(775), + "no-func-assign": () => __webpack_require__(776), + "no-global-assign": () => __webpack_require__(777), + "no-implicit-coercion": () => __webpack_require__(778), + "no-implicit-globals": () => __webpack_require__(779), + "no-implied-eval": () => __webpack_require__(780), + "no-import-assign": () => __webpack_require__(781), + "no-inline-comments": () => __webpack_require__(782), + "no-inner-declarations": () => __webpack_require__(783), + "no-invalid-regexp": () => __webpack_require__(784), + "no-invalid-this": () => __webpack_require__(785), + "no-irregular-whitespace": () => __webpack_require__(786), + "no-iterator": () => __webpack_require__(787), + "no-label-var": () => __webpack_require__(788), + "no-labels": () => __webpack_require__(789), + "no-lone-blocks": () => __webpack_require__(790), + "no-lonely-if": () => __webpack_require__(791), + "no-loop-func": () => __webpack_require__(792), + "no-loss-of-precision": () => __webpack_require__(793), + "no-magic-numbers": () => __webpack_require__(794), + "no-misleading-character-class": () => __webpack_require__(795), + "no-mixed-operators": () => __webpack_require__(802), + "no-mixed-requires": () => __webpack_require__(803), + "no-mixed-spaces-and-tabs": () => __webpack_require__(804), + "no-multi-assign": () => __webpack_require__(805), + "no-multi-spaces": () => __webpack_require__(806), + "no-multi-str": () => __webpack_require__(807), + "no-multiple-empty-lines": () => __webpack_require__(808), + "no-native-reassign": () => __webpack_require__(809), + "no-negated-condition": () => __webpack_require__(810), + "no-negated-in-lhs": () => __webpack_require__(811), + "no-nested-ternary": () => __webpack_require__(812), + "no-new": () => __webpack_require__(813), + "no-new-func": () => __webpack_require__(814), + "no-new-native-nonconstructor": () => __webpack_require__(815), + "no-new-object": () => __webpack_require__(816), + "no-new-require": () => __webpack_require__(817), + "no-new-symbol": () => __webpack_require__(818), + "no-new-wrappers": () => __webpack_require__(819), + "no-nonoctal-decimal-escape": () => __webpack_require__(820), + "no-obj-calls": () => __webpack_require__(821), + "no-octal": () => __webpack_require__(822), + "no-octal-escape": () => __webpack_require__(823), + "no-param-reassign": () => __webpack_require__(824), + "no-path-concat": () => __webpack_require__(825), + "no-plusplus": () => __webpack_require__(826), + "no-process-env": () => __webpack_require__(827), + "no-process-exit": () => __webpack_require__(828), + "no-promise-executor-return": () => __webpack_require__(829), + "no-proto": () => __webpack_require__(830), + "no-prototype-builtins": () => __webpack_require__(831), + "no-redeclare": () => __webpack_require__(832), + "no-regex-spaces": () => __webpack_require__(833), + "no-restricted-exports": () => __webpack_require__(834), + "no-restricted-globals": () => __webpack_require__(835), + "no-restricted-imports": () => __webpack_require__(836), + "no-restricted-modules": () => __webpack_require__(838), + "no-restricted-properties": () => __webpack_require__(839), + "no-restricted-syntax": () => __webpack_require__(840), + "no-return-assign": () => __webpack_require__(841), + "no-return-await": () => __webpack_require__(842), + "no-script-url": () => __webpack_require__(843), + "no-self-assign": () => __webpack_require__(844), + "no-self-compare": () => __webpack_require__(845), + "no-sequences": () => __webpack_require__(846), + "no-setter-return": () => __webpack_require__(847), + "no-shadow": () => __webpack_require__(848), + "no-shadow-restricted-names": () => __webpack_require__(849), + "no-spaced-func": () => __webpack_require__(850), + "no-sparse-arrays": () => __webpack_require__(851), + "no-sync": () => __webpack_require__(852), + "no-tabs": () => __webpack_require__(853), + "no-template-curly-in-string": () => __webpack_require__(854), + "no-ternary": () => __webpack_require__(855), + "no-this-before-super": () => __webpack_require__(856), + "no-throw-literal": () => __webpack_require__(857), + "no-trailing-spaces": () => __webpack_require__(858), + "no-undef": () => __webpack_require__(859), + "no-undef-init": () => __webpack_require__(860), + "no-undefined": () => __webpack_require__(861), + "no-underscore-dangle": () => __webpack_require__(862), + "no-unexpected-multiline": () => __webpack_require__(863), + "no-unmodified-loop-condition": () => __webpack_require__(864), + "no-unneeded-ternary": () => __webpack_require__(865), + "no-unreachable": () => __webpack_require__(866), + "no-unreachable-loop": () => __webpack_require__(867), + "no-unsafe-finally": () => __webpack_require__(868), + "no-unsafe-negation": () => __webpack_require__(869), + "no-unsafe-optional-chaining": () => __webpack_require__(870), + "no-unused-expressions": () => __webpack_require__(871), + "no-unused-labels": () => __webpack_require__(872), + "no-unused-private-class-members": () => __webpack_require__(873), + "no-unused-vars": () => __webpack_require__(874), + "no-use-before-define": () => __webpack_require__(875), + "no-useless-backreference": () => __webpack_require__(876), + "no-useless-call": () => __webpack_require__(877), + "no-useless-catch": () => __webpack_require__(878), + "no-useless-computed-key": () => __webpack_require__(879), + "no-useless-concat": () => __webpack_require__(880), + "no-useless-constructor": () => __webpack_require__(881), + "no-useless-escape": () => __webpack_require__(882), + "no-useless-rename": () => __webpack_require__(883), + "no-useless-return": () => __webpack_require__(884), + "no-var": () => __webpack_require__(885), + "no-void": () => __webpack_require__(886), + "no-warning-comments": () => __webpack_require__(887), + "no-whitespace-before-property": () => __webpack_require__(888), + "no-with": () => __webpack_require__(889), + "nonblock-statement-body-position": () => __webpack_require__(890), + "object-curly-newline": () => __webpack_require__(891), + "object-curly-spacing": () => __webpack_require__(892), + "object-property-newline": () => __webpack_require__(893), + "object-shorthand": () => __webpack_require__(894), + "one-var": () => __webpack_require__(895), + "one-var-declaration-per-line": () => __webpack_require__(896), + "operator-assignment": () => __webpack_require__(897), + "operator-linebreak": () => __webpack_require__(898), + "padded-blocks": () => __webpack_require__(899), + "padding-line-between-statements": () => __webpack_require__(900), + "prefer-arrow-callback": () => __webpack_require__(901), + "prefer-const": () => __webpack_require__(902), + "prefer-destructuring": () => __webpack_require__(903), + "prefer-exponentiation-operator": () => __webpack_require__(904), + "prefer-named-capture-group": () => __webpack_require__(905), + "prefer-numeric-literals": () => __webpack_require__(906), + "prefer-object-has-own": () => __webpack_require__(907), + "prefer-object-spread": () => __webpack_require__(908), + "prefer-promise-reject-errors": () => __webpack_require__(909), + "prefer-reflect": () => __webpack_require__(910), + "prefer-regex-literals": () => __webpack_require__(911), + "prefer-rest-params": () => __webpack_require__(912), + "prefer-spread": () => __webpack_require__(913), + "prefer-template": () => __webpack_require__(914), + "quote-props": () => __webpack_require__(915), + quotes: () => __webpack_require__(916), + radix: () => __webpack_require__(917), + "require-atomic-updates": () => __webpack_require__(918), + "require-await": () => __webpack_require__(919), + "require-jsdoc": () => __webpack_require__(920), + "require-unicode-regexp": () => __webpack_require__(921), + "require-yield": () => __webpack_require__(922), + "rest-spread-spacing": () => __webpack_require__(923), + semi: () => __webpack_require__(924), + "semi-spacing": () => __webpack_require__(925), + "semi-style": () => __webpack_require__(926), + "sort-imports": () => __webpack_require__(927), + "sort-keys": () => __webpack_require__(928), + "sort-vars": () => __webpack_require__(930), + "space-before-blocks": () => __webpack_require__(931), + "space-before-function-paren": () => __webpack_require__(932), + "space-in-parens": () => __webpack_require__(933), + "space-infix-ops": () => __webpack_require__(934), + "space-unary-ops": () => __webpack_require__(935), + "spaced-comment": () => __webpack_require__(936), + strict: () => __webpack_require__(937), + "switch-colon-spacing": () => __webpack_require__(938), + "symbol-description": () => __webpack_require__(939), + "template-curly-spacing": () => __webpack_require__(940), + "template-tag-spacing": () => __webpack_require__(941), + "unicode-bom": () => __webpack_require__(942), + "use-isnan": () => __webpack_require__(943), + "valid-jsdoc": () => __webpack_require__(944), + "valid-typeof": () => __webpack_require__(949), + "vars-on-top": () => __webpack_require__(950), + "wrap-iife": () => __webpack_require__(951), + "wrap-regex": () => __webpack_require__(952), + "yield-star-spacing": () => __webpack_require__(953), + yoda: () => __webpack_require__(954) })); /***/ }), -/* 616 */ +/* 637 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -61266,7 +54333,8 @@ module.exports = new LazyLoadingRuleMap(Object.entries({ */ -const debug = __webpack_require__(566)("eslint:rules"); +const debug = __webpack_require__(589)("eslint:rules"); + /** @typedef {import("./types").Rule} Rule */ /** @@ -61282,8 +54350,6 @@ const debug = __webpack_require__(566)("eslint:rules"); * * @extends {Map Rule>} */ - - class LazyLoadingRuleMap extends Map { /** * Initialize this map. @@ -61299,67 +54365,62 @@ class LazyLoadingRuleMap extends Map { debug("Loading rule %o (remaining=%d)", ruleId, --remaining); cache = load(); } - return cache; }]; - }) : loaders); // `super(...iterable)` uses `this.set()`, so disable it here. + }) : 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. - - +// Forbid mutation. Object.defineProperties(LazyLoadingRuleMap.prototype, { clear: { configurable: true, @@ -61380,7 +54441,7 @@ module.exports = { }; /***/ }), -/* 617 */ +/* 638 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -61388,11 +54449,15 @@ module.exports = { * @fileoverview Rule to enforce getter and setter pairs in objects and classes. * @author Gyandeep Singh */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Typedefs //------------------------------------------------------------------------------ @@ -61408,6 +54473,7 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @property {ASTNode[]} getters List of getter nodes. * @property {ASTNode[]} setters List of setter nodes. */ + //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -61419,55 +54485,47 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @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]; - + 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. @@ -61476,46 +54534,42 @@ function isAccessorKind(node) { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce getter and setter pairs in objects and classes", recommended: false, - url: "https://eslint.org/docs/rules/accessor-pairs" + url: "https://eslint.org/docs/latest/rules/accessor-pairs" }, schema: [{ type: "object", @@ -61544,13 +54598,13 @@ module.exports = { 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(); + const sourceCode = context.sourceCode; + /** * Reports the given node. * @param {ASTNode} node The node to report. @@ -61558,7 +54612,6 @@ module.exports = { * @returns {void} * @private */ - function report(node, messageKind) { if (node.type === "Property") { context.report({ @@ -61585,6 +54638,7 @@ module.exports = { }); } } + /** * Reports each of the nodes in the given list using the same messageId. * @param {ASTNode[]} nodes Nodes to report. @@ -61592,21 +54646,18 @@ module.exports = { * @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); @@ -61616,6 +54667,7 @@ module.exports = { setters: node.kind === "set" ? [node] : [] }; } + /** * Merges the given `AccessorData` object into the given accessors list. * @param {AccessorData[]} accessors The list to merge into. @@ -61623,31 +54675,25 @@ module.exports = { * @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 @@ -61655,31 +54701,28 @@ module.exports = { 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 = new Set(node.properties.filter(p => p.type === "Property" && p.kind === "init" && !p.computed).map(_ref => { let { @@ -61689,61 +54732,51 @@ module.exports = { })); const hasGetter = namesToCheck.has("get"); const hasSetter = namesToCheck.has("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; } - }; /***/ }), -/* 618 */ +/* 639 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -61751,26 +54784,26 @@ module.exports = { * @fileoverview Common utils for AST. * @author Gyandeep Singh */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - -const esutils = __webpack_require__(619); - -const espree = __webpack_require__(508); - -const escapeRegExp = __webpack_require__(595); - +const esutils = __webpack_require__(640); +const espree = __webpack_require__(530); +const escapeRegExp = __webpack_require__(616); const { breakableTypePattern, createGlobalLinebreakMatcher, lineBreakPattern, shebangPattern -} = __webpack_require__(514); //------------------------------------------------------------------------------ +} = __webpack_require__(536); + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - const anyFunctionPattern = /^(?:Function(?:Declaration|Expression)|ArrowFunctionExpression)$/u; const anyLoopPattern = /^(?:DoWhile|For|ForIn|ForOf|While)Statement$/u; const arrayOrTypedArrayPattern = /Array$/u; @@ -61779,13 +54812,16 @@ 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 ESLINT_DIRECTIVE_PATTERN = /^(?:eslint[- ]|(?:globals?|exported) )/u; -const LINEBREAKS = new Set(["\r\n", "\r", "\n", "\u2028", "\u2029"]); // A set of node types that can contain a list of statements +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", "StaticBlock", "SwitchCase"]); -const DECIMAL_INTEGER_PATTERN = /^(?:0|0[0-7]*[89]\d*|[1-9](?:_?\d)*)$/u; // Tests the presence of at least one LegacyOctalEscapeSequence or NonOctalDecimalEscapeSequence in a raw string +const DECIMAL_INTEGER_PATTERN = /^(?:0|0[0-7]*[89]\d*|[1-9](?:_?\d)*)$/u; +// Tests the presence of at least one LegacyOctalEscapeSequence or NonOctalDecimalEscapeSequence in a raw string const OCTAL_OR_NON_OCTAL_DECIMAL_ESCAPE_PATTERN = /^(?:[^\\]|\\.)*\\(?:[1-9]|0[0-9])/su; const LOGICAL_ASSIGNMENT_OPERATORS = new Set(["&&=", "||=", "??="]); + /** * Checks reference if is non initializer and writable. * @param {Reference} reference A reference to check. @@ -61794,54 +54830,50 @@ const LOGICAL_ASSIGNMENT_OPERATORS = new Set(["&&=", "||=", "??="]); * @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} Whether 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: @@ -61852,11 +54884,10 @@ function getUpperFunction(node) { * @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: @@ -61869,34 +54900,29 @@ function isFunction(node) { * @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. @@ -61907,27 +54933,26 @@ function isNullLiteral(node) { */ 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. @@ -61937,8 +54962,6 @@ function isCallee(node) { * @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": @@ -61950,28 +54973,27 @@ function getStaticStringValue(node) { 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. + } + // 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. @@ -62002,24 +55024,20 @@ function getStaticStringValue(node) { * @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 "PropertyDefinition": case "MethodDefinition": prop = node.key; break; - case "MemberExpression": prop = node.property; break; + // no default } @@ -62027,44 +55045,40 @@ function getStaticPropertyName(node) { 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. @@ -62074,50 +55088,42 @@ function isSpecificId(node, name) { * @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. - + } + // 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 @@ -62129,123 +55135,107 @@ function equalLiteralValue(left, right) { * @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) { let disableStaticComputedKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 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": case "PrivateIdentifier": 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"] + 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, + } + + // 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 @@ -62253,182 +55243,165 @@ function hasJSDocThisTag(node, sourceCode) { * @returns {boolean} True if the node is parenthesised. * @private */ - - function isParenthesised(sourceCode, node) { const previousToken = sourceCode.getTokenBefore(node), - nextToken = sourceCode.getTokenAfter(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 a `=` token or not. * @param {Token} token The token to check. * @returns {boolean} `true` if the token is a `=` token. */ - - function isEqToken(token) { return token.value === "=" && token.type === "Punctuator"; } + /** * 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) { // If the node is an arrow function and doesn't have parens, this returns the identifier of the first param. if (node.type === "ArrowFunctionExpression" && node.params.length === 1) { const argToken = sourceCode.getFirstToken(node.params[0]); const maybeParenToken = sourceCode.getTokenBefore(argToken); return isOpeningParenToken(maybeParenToken) ? maybeParenToken : argToken; - } // Otherwise, returns paren. - + } + // Otherwise, returns paren. 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. @@ -62436,24 +55409,20 @@ function getOpeningParenOfParams(node, sourceCode) { * @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. * @@ -62466,11 +55435,10 @@ function equalTokens(left, right, sourceCode) { * @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. * @@ -62482,47 +55450,42 @@ function isLogicalExpression(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); } + /** * Get the colon token of the given SwitchCase node. * @param {ASTNode} node The SwitchCase node to get. * @param {SourceCode} sourceCode The source code object to get tokens. * @returns {Token} The colon token of the node. */ - - function getSwitchCaseColonToken(node, sourceCode) { if (node.test) { return sourceCode.getTokenAfter(node.test, isColonToken); } - return sourceCode.getFirstToken(node, 1); } + /** * Gets ESM module export name represented by the given node. * @param {ASTNode} node `Identifier` or string `Literal` node in a position @@ -62533,24 +55496,21 @@ function getSwitchCaseColonToken(node, sourceCode) { * - `ExportAllDeclaration#exported` * @returns {string} The module export name. */ - - function getModuleExportName(node) { if (node.type === "Identifier") { return node.name; - } // string literal - + } + // string literal return node.value; } + /** * Returns literal's value converted to the Boolean type * @param {ASTNode} node any `Literal` node * @returns {boolean | null} `true` when node is truthy, `false` when node is falsy, * `null` when it cannot be determined. */ - - function getBooleanValue(node) { if (node.value === null) { /* @@ -62558,62 +55518,58 @@ function getBooleanValue(node) { * https://github.com/estree/estree/blob/14df8a024956ea289bd55b9c2226a1d5b8a473ee/es5.md#regexpliteral * https://github.com/estree/estree/blob/14df8a024956ea289bd55b9c2226a1d5b8a473ee/es2020.md#bigintliteral */ + if (node.raw === "null") { return false; - } // regex is always truthy - + } + // regex is always truthy if (typeof node.regex === "object") { return true; } - return null; } - return !!node.value; } + /** * 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 === "||" && getBooleanValue(node) === true || operator === "&&" && getBooleanValue(node) === false; - case "UnaryExpression": return operator === "&&" && node.operator === "void"; - case "LogicalExpression": /* * handles `a && false || b` * `false` is an identity element of `&&` but not `||` */ return operator === node.operator && (isLogicalIdentity(node.left, operator) || isLogicalIdentity(node.right, operator)); - case "AssignmentExpression": return ["||=", "&&="].includes(node.operator) && operator === node.operator.slice(0, -1) && isLogicalIdentity(node.right, operator); + // no default } return false; } + /** * Checks if an identifier is a reference to a global variable. * @param {Scope} scope The scope in which the identifier is referenced. * @param {ASTNode} node An identifier node to check. * @returns {boolean} `true` if the identifier is a reference to a global variable. */ - - function isReferenceToGlobalVariable(scope, node) { const reference = scope.references.find(ref => ref.identifier === node); return Boolean(reference && reference.resolved && reference.resolved.scope.type === "global" && reference.resolved.defs.length === 0); } + /** * Checks if a node has a constant truthiness value. * @param {Scope} scope Scope in which the node appears. @@ -62625,20 +55581,16 @@ function isReferenceToGlobalVariable(scope, node) { * @returns {boolean} true when node's truthiness is constant * @private */ - - function isConstant(scope, 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": return true; - case "ClassExpression": case "ObjectExpression": /** @@ -62656,33 +55608,25 @@ function isConstant(scope, node, inBooleanPosition) { * false, but it's an edge case we've opted not to handle. */ return true; - case "TemplateLiteral": return inBooleanPosition && node.quasis.some(quasi => quasi.value.cooked.length) || node.expressions.every(exp => isConstant(scope, exp, false)); - case "ArrayExpression": { if (!inBooleanPosition) { return node.elements.every(element => isConstant(scope, element, false)); } - return true; } - case "UnaryExpression": if (node.operator === "void" || node.operator === "typeof" && inBooleanPosition) { return true; } - if (node.operator === "!") { return isConstant(scope, node.argument, true); } - return isConstant(scope, node.argument, false); - case "BinaryExpression": return isConstant(scope, node.left, false) && isConstant(scope, node.right, false) && node.operator !== "in"; - case "LogicalExpression": { const isLeftConstant = isConstant(scope, node.left, inBooleanPosition); @@ -62691,54 +55635,46 @@ function isConstant(scope, node, inBooleanPosition) { const isRightShortCircuit = inBooleanPosition && isRightConstant && isLogicalIdentity(node.right, node.operator); return isLeftConstant && isRightConstant || isLeftShortCircuit || isRightShortCircuit; } - case "NewExpression": return inBooleanPosition; - case "AssignmentExpression": if (node.operator === "=") { return isConstant(scope, node.right, inBooleanPosition); } - if (["||=", "&&="].includes(node.operator) && inBooleanPosition) { return isLogicalIdentity(node.right, node.operator.slice(0, -1)); } - return false; - case "SequenceExpression": return isConstant(scope, node.expressions[node.expressions.length - 1], inBooleanPosition); - case "SpreadElement": return isConstant(scope, node.argument, inBooleanPosition); - case "CallExpression": if (node.callee.type === "Identifier" && node.callee.name === "Boolean") { if (node.arguments.length === 0 || isConstant(scope, node.arguments[0], true)) { return isReferenceToGlobalVariable(scope, node.callee); } } - return false; - case "Identifier": return node.name === "undefined" && isReferenceToGlobalVariable(scope, node); + // no default } return false; -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // 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. @@ -62749,7 +55685,6 @@ module.exports = { isTokenOnSameLine(left, right) { return left.loc.end.line === right.loc.start.line; }, - isNullOrUndefined, isCallee, isES5Constructor, @@ -62787,7 +55722,6 @@ module.exports = { isOpeningParenToken, isSemicolonToken, isEqToken, - /** * Checks whether or not a given node is a string literal. * @param {ASTNode} node A node to check. @@ -62796,7 +55730,6 @@ module.exports = { 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: @@ -62813,7 +55746,6 @@ module.exports = { isBreakableStatement(node) { return breakableTypePattern.test(node.type); }, - /** * Gets references which are non initializer and writable. * @param {Reference[]} references An array of references. @@ -62823,7 +55755,6 @@ module.exports = { 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. @@ -62834,7 +55765,6 @@ module.exports = { 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 @@ -62844,7 +55774,6 @@ module.exports = { const comment = node.value.trim(); return node.type === "Line" && comment.startsWith("eslint-") || node.type === "Block" && ESLINT_DIRECTIVE_PATTERN.test(comment); }, - /** * Gets the trailing statement of a given node. * @@ -62856,7 +55785,6 @@ module.exports = { * @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. @@ -62865,20 +55793,15 @@ module.exports = { */ 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. * @@ -62911,7 +55834,6 @@ module.exports = { let { capIsConstructor = true } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - /* * Class field initializers are implicit functions, but ESTree doesn't have the AST node of field initializers. * Therefore, A expression node at `PropertyDefinition#value` is a function. @@ -62919,23 +55841,19 @@ module.exports = { */ if (node.parent.type === "PropertyDefinition" && node.parent.value === node) { return false; - } // Class static blocks are implicit functions. In this case, `this` is always not default binding. - + } + // Class static blocks are implicit functions. In this case, `this` is always not default binding. if (node.type === "StaticBlock") { return false; } - 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. @@ -62958,24 +55876,19 @@ module.exports = { * 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; @@ -62990,7 +55903,6 @@ module.exports = { * class A { static foo() { ... } } * class A { foo = function() { ... } } */ - case "Property": case "PropertyDefinition": case "MethodDefinition": @@ -63003,24 +55915,20 @@ module.exports = { * [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)); @@ -63030,13 +55938,11 @@ module.exports = { * (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; /* @@ -63045,33 +55951,27 @@ module.exports = { * 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. + // Otherwise `this` is default. default: return true; } } + /* c8 ignore next */ - - return true; }, - /** * Get the precedence level based on the node type * @param {ASTNode} node node to evaluate @@ -63082,23 +55982,20 @@ module.exports = { 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 } @@ -63108,19 +56005,15 @@ module.exports = { switch (node.operator) { case "|": return 6; - case "^": return 7; - case "&": return 8; - case "==": case "!=": case "===": case "!==": return 9; - case "<": case "<=": case ">": @@ -63128,23 +56021,20 @@ module.exports = { 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 } @@ -63153,23 +56043,18 @@ module.exports = { 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. @@ -63178,7 +56063,6 @@ module.exports = { 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. @@ -63187,15 +56071,15 @@ module.exports = { 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. + 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. @@ -63203,7 +56087,6 @@ module.exports = { */ 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); @@ -63212,10 +56095,8 @@ module.exports = { } } } - 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. @@ -63249,7 +56130,6 @@ module.exports = { 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. @@ -63259,7 +56139,6 @@ module.exports = { isDecimalIntegerNumericToken(token) { return token.type === "Numeric" && DECIMAL_INTEGER_PATTERN.test(token.value); }, - /** * Gets the name and kind of the given function node. * @@ -63321,31 +56200,25 @@ module.exports = { getFunctionNameWithKind(node) { const parent = node.parent; const tokens = []; - if (parent.type === "MethodDefinition" || parent.type === "PropertyDefinition") { // The proposal uses `static` word consistently before visibility words: https://github.com/tc39/proposal-static-class-features if (parent.static) { tokens.push("static"); } - if (!parent.computed && parent.key.type === "PrivateIdentifier") { tokens.push("private"); } } - if (node.async) { tokens.push("async"); } - if (node.generator) { tokens.push("generator"); } - 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") { @@ -63359,16 +56232,13 @@ module.exports = { if (node.type === "ArrowFunctionExpression") { tokens.push("arrow"); } - tokens.push("function"); } - if (parent.type === "Property" || parent.type === "MethodDefinition" || parent.type === "PropertyDefinition") { if (!parent.computed && parent.key.type === "PrivateIdentifier") { tokens.push(`#${parent.key.name}`); } else { const name = getStaticPropertyName(parent); - if (name !== null) { tokens.push(`'${name}'`); } else if (node.id) { @@ -63378,10 +56248,8 @@ module.exports = { } else if (node.id) { tokens.push(`'${node.id.name}'`); } - return tokens.join(" "); }, - /** * Gets the location of the given function node for reporting. * @@ -63483,7 +56351,6 @@ module.exports = { const parent = node.parent; let start = null; let end = null; - if (parent.type === "Property" || parent.type === "MethodDefinition" || parent.type === "PropertyDefinition") { start = parent.loc.start; end = getOpeningParenOfParams(node, sourceCode).loc.start; @@ -63495,13 +56362,11 @@ module.exports = { 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. * @@ -63551,24 +56416,20 @@ module.exports = { line, column } = _ref; - 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. @@ -63579,15 +56440,12 @@ module.exports = { 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 possibility to be an Error object * @param {ASTNode} node ASTNode to check @@ -63610,25 +56468,21 @@ module.exports = { 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": /* * If the && operator short-circuits, the left side was falsy and therefore not an error, and if it @@ -63639,17 +56493,13 @@ module.exports = { if (node.operator === "&&") { return module.exports.couldBeError(node.right); } - 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. @@ -63658,7 +56508,6 @@ module.exports = { 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. @@ -63673,22 +56522,17 @@ module.exports = { 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 (!leftToken || lastComment.range[0] > leftToken.range[0]) { leftToken = lastComment; } @@ -63696,35 +56540,28 @@ module.exports = { } else { leftToken = leftValue; } + /* * If a hashbang comment was passed as a token object from SourceCode, * its type will be "Shebang" because of the way ESLint itself handles hashbangs. * If a hashbang comment was passed in a string and then tokenized in this function, * its type will be "Hashbang" because of the way Espree tokenizes hashbangs. */ - - if (leftToken.type === "Shebang" || leftToken.type === "Hashbang") { 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 (!rightToken || firstComment.range[0] < rightToken.range[0]) { rightToken = firstComment; } @@ -63732,40 +56569,31 @@ module.exports = { } 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; } - if (rightToken.type === "PrivateIdentifier") { 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. @@ -63774,12 +56602,15 @@ module.exports = { * @returns {SourceLocation} The `loc` object. */ getNameLocationInGlobalDirectiveComment(sourceCode, comment, name) { - const namePattern = new RegExp(`[\\s,]${escapeRegExp(name)}(?:$|[\\s,:])`, "gu"); // To ignore the first text "global". + const namePattern = new RegExp(`[\\s,]${escapeRegExp(name)}(?:$|[\\s,:])`, "gu"); - namePattern.lastIndex = comment.value.indexOf("global") + 6; // Search a given variable name. + // To ignore the first text "global". + namePattern.lastIndex = comment.value.indexOf("global") + 6; - const match = namePattern.exec(comment.value); // Convert the index to loc. + // 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, @@ -63790,7 +56621,6 @@ module.exports = { end }; }, - /** * Determines whether the given raw string contains an octal escape sequence * or a non-octal decimal escape sequence ("\8", "\9"). @@ -63806,7 +56636,6 @@ module.exports = { hasOctalOrNonOctalDecimalEscapeSequence(rawString) { return OCTAL_OR_NON_OCTAL_DECIMAL_ESCAPE_PATTERN.test(rawString); }, - isReferenceToGlobalVariable, isLogicalExpression, isCoalesceExpression, @@ -63826,7 +56655,7 @@ module.exports = { }; /***/ }), -/* 619 */ +/* 640 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* @@ -63852,17 +56681,18 @@ module.exports = { (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + (function () { 'use strict'; - exports.ast = __webpack_require__(620); - exports.code = __webpack_require__(621); - exports.keyword = __webpack_require__(622); + exports.ast = __webpack_require__(641); + exports.code = __webpack_require__(642); + exports.keyword = __webpack_require__(643); })(); /* vim: set sw=4 ts=4 et tw=80 : */ /***/ }), -/* 620 */ +/* 641 */ /***/ ((module) => { /* @@ -63888,6 +56718,7 @@ module.exports = { (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + (function () { 'use strict'; @@ -63895,7 +56726,6 @@ module.exports = { if (node == null) { return false; } - switch (node.type) { case 'ArrayExpression': case 'AssignmentExpression': @@ -63915,15 +56745,12 @@ module.exports = { case 'UpdateExpression': return true; } - return false; } - function isIterationStatement(node) { if (node == null) { return false; } - switch (node.type) { case 'DoWhileStatement': case 'ForInStatement': @@ -63931,15 +56758,12 @@ module.exports = { case 'WhileStatement': return true; } - return false; } - function isStatement(node) { if (node == null) { return false; } - switch (node.type) { case 'BlockStatement': case 'BreakStatement': @@ -63961,23 +56785,18 @@ module.exports = { case 'WithStatement': return true; } - return false; } - function isSourceElement(node) { return isStatement(node) || node != null && node.type === 'FunctionDeclaration'; } - function trailingStatement(node) { switch (node.type) { case 'IfStatement': if (node.alternate != null) { return node.alternate; } - return node.consequent; - case 'LabeledStatement': case 'ForStatement': case 'ForInStatement': @@ -63985,36 +56804,27 @@ module.exports = { case 'WithStatement': return node.body; } - return null; } - function isProblematicIfStatement(node) { var current; - if (node.type !== 'IfStatement') { return false; } - if (node.alternate == null) { return false; } - current = node.consequent; - do { if (current.type === 'IfStatement') { if (current.alternate == null) { return true; } } - current = trailingStatement(current); } while (current); - return false; } - module.exports = { isExpression: isExpression, isStatement: isStatement, @@ -64027,7 +56837,7 @@ module.exports = { /* vim: set sw=4 ts=4 et tw=80 : */ /***/ }), -/* 621 */ +/* 642 */ /***/ ((module) => { /* @@ -64054,11 +56864,13 @@ module.exports = { (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + (function () { 'use strict'; - var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch; // See `tools/generate-identifier-regex.js`. + var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch; + // See `tools/generate-identifier-regex.js`. ES5Regex = { // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierStart: NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/, @@ -64071,77 +56883,77 @@ module.exports = { // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierPart: NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ }; - function isDecimalDigit(ch) { return 0x30 <= ch && ch <= 0x39; // 0..9 } function isHexDigit(ch) { - return 0x30 <= ch && ch <= 0x39 || // 0..9 - 0x61 <= ch && ch <= 0x66 || // a..f + return 0x30 <= ch && ch <= 0x39 || + // 0..9 + 0x61 <= ch && ch <= 0x66 || + // a..f 0x41 <= ch && ch <= 0x46; // A..F } function isOctalDigit(ch) { return ch >= 0x30 && ch <= 0x37; // 0..7 - } // 7.2 White Space + } + // 7.2 White Space NON_ASCII_WHITESPACES = [0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF]; - function isWhiteSpace(ch) { return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0; - } // 7.3 Line Terminators + } + // 7.3 Line Terminators function isLineTerminator(ch) { return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029; - } // 7.6 Identifier Names and Identifiers + } + // 7.6 Identifier Names and Identifiers function fromCodePoint(cp) { if (cp <= 0xFFFF) { return String.fromCharCode(cp); } - var cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800); var cu2 = String.fromCharCode((cp - 0x10000) % 0x400 + 0xDC00); return cu1 + cu2; } - IDENTIFIER_START = new Array(0x80); - for (ch = 0; ch < 0x80; ++ch) { - IDENTIFIER_START[ch] = ch >= 0x61 && ch <= 0x7A || // a..z - ch >= 0x41 && ch <= 0x5A || // A..Z + IDENTIFIER_START[ch] = ch >= 0x61 && ch <= 0x7A || + // a..z + ch >= 0x41 && ch <= 0x5A || + // A..Z ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) } IDENTIFIER_PART = new Array(0x80); - for (ch = 0; ch < 0x80; ++ch) { - IDENTIFIER_PART[ch] = ch >= 0x61 && ch <= 0x7A || // a..z - ch >= 0x41 && ch <= 0x5A || // A..Z - ch >= 0x30 && ch <= 0x39 || // 0..9 + IDENTIFIER_PART[ch] = ch >= 0x61 && ch <= 0x7A || + // a..z + ch >= 0x41 && ch <= 0x5A || + // A..Z + ch >= 0x30 && ch <= 0x39 || + // 0..9 ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) } function isIdentifierStartES5(ch) { return ch < 0x80 ? IDENTIFIER_START[ch] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); } - function isIdentifierPartES5(ch) { return ch < 0x80 ? IDENTIFIER_PART[ch] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); } - function isIdentifierStartES6(ch) { return ch < 0x80 ? IDENTIFIER_START[ch] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); } - function isIdentifierPartES6(ch) { return ch < 0x80 ? IDENTIFIER_PART[ch] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); } - module.exports = { isDecimalDigit: isDecimalDigit, isHexDigit: isHexDigit, @@ -64157,7 +56969,7 @@ module.exports = { /* vim: set sw=4 ts=4 et tw=80 : */ /***/ }), -/* 622 */ +/* 643 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* @@ -64183,11 +56995,11 @@ module.exports = { (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + (function () { 'use strict'; - var code = __webpack_require__(621); - + var code = __webpack_require__(642); function isStrictModeReservedWordES6(id) { switch (id) { case 'implements': @@ -64199,142 +57011,103 @@ module.exports = { case 'static': case 'let': return true; - default: return false; } } - function isKeywordES5(id, strict) { // yield should not be treated as keyword under non-strict mode. if (!strict && id === 'yield') { return false; } - return isKeywordES6(id, strict); } - function isKeywordES6(id, strict) { if (strict && isStrictModeReservedWordES6(id)) { return true; } - switch (id.length) { case 2: return id === 'if' || id === 'in' || id === 'do'; - case 3: return id === 'var' || id === 'for' || id === 'new' || id === 'try'; - case 4: return id === 'this' || id === 'else' || id === 'case' || id === 'void' || id === 'with' || id === 'enum'; - case 5: return id === 'while' || id === 'break' || id === 'catch' || id === 'throw' || id === 'const' || id === 'yield' || id === 'class' || id === 'super'; - case 6: return id === 'return' || id === 'typeof' || id === 'delete' || id === 'switch' || id === 'export' || id === 'import'; - case 7: return id === 'default' || id === 'finally' || id === 'extends'; - case 8: return id === 'function' || id === 'continue' || id === 'debugger'; - case 10: return id === 'instanceof'; - default: return false; } } - function isReservedWordES5(id, strict) { return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict); } - function isReservedWordES6(id, strict) { return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict); } - function isRestrictedWord(id) { return id === 'eval' || id === 'arguments'; } - function isIdentifierNameES5(id) { var i, iz, ch; - if (id.length === 0) { return false; } - ch = id.charCodeAt(0); - if (!code.isIdentifierStartES5(ch)) { return false; } - for (i = 1, iz = id.length; i < iz; ++i) { ch = id.charCodeAt(i); - if (!code.isIdentifierPartES5(ch)) { return false; } } - return true; } - function decodeUtf16(lead, trail) { return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; } - function isIdentifierNameES6(id) { var i, iz, ch, lowCh, check; - if (id.length === 0) { return false; } - check = code.isIdentifierStartES6; - for (i = 0, iz = id.length; i < iz; ++i) { ch = id.charCodeAt(i); - if (0xD800 <= ch && ch <= 0xDBFF) { ++i; - if (i >= iz) { return false; } - lowCh = id.charCodeAt(i); - if (!(0xDC00 <= lowCh && lowCh <= 0xDFFF)) { return false; } - ch = decodeUtf16(ch, lowCh); } - if (!check(ch)) { return false; } - check = code.isIdentifierPartES6; } - return true; } - function isIdentifierES5(id, strict) { return isIdentifierNameES5(id) && !isReservedWordES5(id, strict); } - function isIdentifierES6(id, strict) { return isIdentifierNameES6(id) && !isReservedWordES6(id, strict); } - module.exports = { isKeywordES5: isKeywordES5, isKeywordES6: isKeywordES6, @@ -64350,7 +57123,7 @@ module.exports = { /* vim: set sw=4 ts=4 et tw=80 : */ /***/ }), -/* 623 */ +/* 644 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -64360,20 +57133,21 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce linebreaks after opening and before closing array brackets", recommended: false, - url: "https://eslint.org/docs/rules/array-bracket-newline" + url: "https://eslint.org/docs/latest/rules/array-bracket-newline" }, fixable: "whitespace", schema: [{ @@ -64400,9 +57174,10 @@ module.exports = { missingClosingLinebreak: "A linebreak is required before ']'." } }, - create(context) { - const sourceCode = context.getSourceCode(); //---------------------------------------------------------------------- + const sourceCode = context.sourceCode; + + //---------------------------------------------------------------------- // Helpers //---------------------------------------------------------------------- @@ -64411,12 +57186,10 @@ module.exports = { * @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; @@ -64434,20 +57207,18 @@ module.exports = { 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 { @@ -64455,109 +57226,92 @@ module.exports = { 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]); @@ -64573,6 +57327,7 @@ module.exports = { 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. @@ -64586,7 +57341,6 @@ module.exports = { if (astUtils.isTokenOnSameLine(openBracket, first)) { reportRequiredBeginningLinebreak(node, openBracket); } - if (astUtils.isTokenOnSameLine(last, closeBracket)) { reportRequiredEndingLinebreak(node, closeBracket); } @@ -64594,26 +57348,25 @@ module.exports = { if (!astUtils.isTokenOnSameLine(openBracket, first)) { reportNoBeginningLinebreak(node, openBracket); } - if (!astUtils.isTokenOnSameLine(last, closeBracket)) { reportNoEndingLinebreak(node, closeBracket); } } - } //---------------------------------------------------------------------- + } + + //---------------------------------------------------------------------- // Public //---------------------------------------------------------------------- - return { ArrayPattern: check, ArrayExpression: check }; } - }; /***/ }), -/* 624 */ +/* 645 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -64623,20 +57376,20 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent spacing inside array brackets", recommended: false, - url: "https://eslint.org/docs/rules/array-bracket-spacing" + url: "https://eslint.org/docs/latest/rules/array-bracket-spacing" }, fixable: "whitespace", schema: [{ @@ -64663,10 +57416,10 @@ module.exports = { missingSpaceBefore: "A space is required before '{{tokenValue}}'." } }, - create(context) { const spaced = context.options[0] === "always", - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; + /** * Determines whether an option is set, relative to the spacing option. * If spaced is "always", then check whether option is set to false. @@ -64674,17 +57427,17 @@ module.exports = { * @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 //-------------------------------------------------------------------------- @@ -64694,7 +57447,6 @@ module.exports = { * @param {Token} token The token to use for the report. * @returns {void} */ - function reportNoBeginningSpace(node, token) { const nextToken = sourceCode.getTokenAfter(token); context.report({ @@ -64707,21 +57459,18 @@ module.exports = { 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({ @@ -64734,21 +57483,18 @@ module.exports = { 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, @@ -64757,21 +57503,18 @@ module.exports = { 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, @@ -64780,88 +57523,78 @@ module.exports = { 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]; + 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 }; } - }; /***/ }), -/* 625 */ +/* 646 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -64869,26 +57602,30 @@ module.exports = { * @fileoverview Rule to enforce return statements in callbacks of array's methods * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - const TARGET_NODE_TYPE = /^(?:Arrow)?FunctionExpression$/u; -const TARGET_METHODS = /^(?:every|filter|find(?:Index)?|flatMap|forEach|map|reduce(?:Right)?|some|sort)$/u; +const TARGET_METHODS = /^(?:every|filter|find(?:Last)?(?:Index)?|flatMap|forEach|map|reduce(?:Right)?|some|sort|toSorted)$/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. @@ -64896,26 +57633,23 @@ function isReachable(segment) { * @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. @@ -64924,14 +57658,10 @@ function fullMethodName(arrayMethodName) { * @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., @@ -64951,15 +57681,12 @@ function getArrayMethodName(node) { * return function callback() { ... }; * })()); */ - case "ReturnStatement": { const func = astUtils.getUpperFunction(parent); - if (func === null || !astUtils.isCallee(func)) { return null; } - currentNode = func.parent; break; } @@ -64969,45 +57696,41 @@ function getArrayMethodName(node) { * 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. + // Otherwise this node is not target. default: return null; } } + /* c8 ignore next */ - - return null; -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Enforce `return` statements in callbacks of array methods", recommended: false, - url: "https://eslint.org/docs/rules/array-callback-return" + url: "https://eslint.org/docs/latest/rules/array-callback-return" }, schema: [{ type: "object", @@ -65030,13 +57753,12 @@ module.exports = { expectedNoReturnValue: "{{arrayMethodName}}() expects no useless return value from {{name}}." } }, - create(context) { const options = context.options[0] || { allowImplicit: false, checkForEach: false }; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; let funcInfo = { arrayMethodName: null, upper: null, @@ -65045,6 +57767,7 @@ module.exports = { shouldCheck: false, node: null }; + /** * Checks whether or not the last code path segment is reachable. * Then reports this function if the segment is reachable. @@ -65054,14 +57777,11 @@ module.exports = { * @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"; @@ -65071,7 +57791,6 @@ module.exports = { messageId = funcInfo.hasReturn ? "expectedAtEnd" : "expectedInside"; } } - if (messageId) { const name = astUtils.getFunctionNameWithKind(node); context.report({ @@ -65085,16 +57804,13 @@ module.exports = { }); } } - 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, @@ -65104,21 +57820,17 @@ module.exports = { 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) { @@ -65130,7 +57842,6 @@ module.exports = { messageId = "expectedReturnValue"; } } - if (messageId) { context.report({ node, @@ -65142,17 +57853,15 @@ module.exports = { }); } }, - // Reports a given function if the last path is reachable. "FunctionExpression:exit": checkLastSegment, "ArrowFunctionExpression:exit": checkLastSegment }; } - }; /***/ }), -/* 626 */ +/* 647 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -65162,20 +57871,21 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce line breaks after each array element", recommended: false, - url: "https://eslint.org/docs/rules/array-element-newline" + url: "https://eslint.org/docs/latest/rules/array-element-newline" }, fixable: "whitespace", schema: { @@ -65198,6 +57908,7 @@ module.exports = { }] } }, + type: "array", items: [{ oneOf: [{ $ref: "#/definitions/basicConfig" @@ -65221,9 +57932,10 @@ module.exports = { missingLineBreak: "There should be a linebreak after this element." } }, - create(context) { - const sourceCode = context.getSourceCode(); //---------------------------------------------------------------------- + const sourceCode = context.sourceCode; + + //---------------------------------------------------------------------- // Helpers //---------------------------------------------------------------------- @@ -65232,13 +57944,11 @@ module.exports = { * @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") { @@ -65250,51 +57960,44 @@ module.exports = { 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 @@ -65305,15 +58008,14 @@ module.exports = { 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: @@ -65328,28 +58030,22 @@ module.exports = { * 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 @@ -65360,30 +58056,26 @@ module.exports = { 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 @@ -65396,18 +58088,14 @@ module.exports = { * 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); @@ -65416,15 +58104,12 @@ module.exports = { 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); @@ -65435,21 +58120,21 @@ module.exports = { } } }); - } //---------------------------------------------------------------------- + } + + //---------------------------------------------------------------------- // Public //---------------------------------------------------------------------- - return { ArrayPattern: check, ArrayExpression: check }; } - }; /***/ }), -/* 627 */ +/* 648 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -65457,24 +58142,25 @@ module.exports = { * @fileoverview Rule to require braces in arrow function body. * @author Alberto Rodríguez */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Require braces around arrow function bodies", recommended: false, - url: "https://eslint.org/docs/rules/arrow-body-style" + url: "https://eslint.org/docs/latest/rules/arrow-body-style" }, schema: { anyOf: [{ @@ -65510,82 +58196,69 @@ module.exports = { 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(); + const sourceCode = context.sourceCode; 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 by the given node. * @param {ASTNode} node first node after an opening parenthesis. * @returns {Token} The found closing parenthesis token. */ - - function findClosingParen(node) { let nodeToCheck = node; - while (!astUtils.isParenthesised(sourceCode, nodeToCheck)) { nodeToCheck = nodeToCheck.parent; } - return sourceCode.getTokenAfter(nodeToCheck); } + /** * 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) { @@ -65599,59 +58272,51 @@ module.exports = { } 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 return 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 { @@ -65660,7 +58325,6 @@ module.exports = { node, loc: arrowBody.loc, messageId: "expectedBlock", - fix(fixer) { const fixes = []; const arrowToken = sourceCode.getTokenBefore(arrowBody, astUtils.isArrowToken); @@ -65669,72 +58333,61 @@ module.exports = { }); const lastToken = sourceCode.getLastToken(node); let parenthesisedObjectLiteral = null; - if (astUtils.isOpeningParenToken(firstTokenAfterArrow) && astUtils.isOpeningBraceToken(secondTokenAfterArrow)) { const braceNode = sourceCode.getNodeByRangeIndex(secondTokenAfterArrow.range[0]); - if (braceNode.type === "ObjectExpression") { parenthesisedObjectLiteral = braceNode; } - } // If the value is object literal, remove parentheses which were forced by syntax. - + } + // If the value is object literal, remove parentheses which were forced by syntax. if (parenthesisedObjectLiteral) { 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() - + } + // Closing paren for the object doesn't have to be lastToken, e.g.: () => ({}).foo() fixes.push(fixer.remove(findClosingParen(parenthesisedObjectLiteral))); 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; } - }; } - }; /***/ }), -/* 628 */ +/* 649 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -65742,11 +58395,14 @@ module.exports = { * @fileoverview Rule to require parens in arrow function arguments. * @author Jxck */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -65755,24 +58411,22 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @param {ASTNode} node `ArrowFunctionExpression` node. * @returns {boolean} `true` if the function has block body. */ - - function hasBlockBody(node) { return node.body.type === "BlockStatement"; -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Require parentheses around arrow function arguments", recommended: false, - url: "https://eslint.org/docs/rules/arrow-parens" + url: "https://eslint.org/docs/latest/rules/arrow-parens" }, fixable: "code", schema: [{ @@ -65794,38 +58448,35 @@ module.exports = { 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(); + const sourceCode = context.sourceCode; + /** * 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. @@ -65833,11 +58484,10 @@ module.exports = { * @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. @@ -65847,66 +58497,54 @@ module.exports = { * @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 - + } + // 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]]); } - }); } } - }; } - }; /***/ }), -/* 629 */ +/* 650 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -65914,24 +58552,25 @@ module.exports = { * @fileoverview Rule to define spacing before/after arrow function's arrow. * @author Jxck */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent spacing before and after the arrow in arrow functions", recommended: false, - url: "https://eslint.org/docs/rules/arrow-spacing" + url: "https://eslint.org/docs/latest/rules/arrow-spacing" }, fixable: "whitespace", schema: [{ @@ -65955,19 +58594,18 @@ module.exports = { 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(); + const sourceCode = context.sourceCode; + /** * 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 { @@ -65976,13 +58614,12 @@ module.exports = { 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]; @@ -65991,6 +58628,7 @@ module.exports = { after }; } + /** * Determines whether space(s) before after arrow(`=>`) is satisfy rule. * if before/after value is `true`, there should be space(s). @@ -65998,23 +58636,18 @@ module.exports = { * @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 { @@ -66023,26 +58656,21 @@ module.exports = { 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 { @@ -66051,25 +58679,21 @@ module.exports = { context.report({ node: tokens.after, messageId: "unexpectedAfter", - fix(fixer) { return fixer.removeRange([tokens.arrow.range[1], tokens.after.range[0]]); } - }); } } } - return { ArrowFunctionExpression: spaces }; } - }; /***/ }), -/* 630 */ +/* 651 */ /***/ ((module) => { "use strict"; @@ -66077,53 +58701,52 @@ module.exports = { * @fileoverview Rule to check for "block scoped" variables by binding context * @author Matt DuVall */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce the use of variables within the scope they are defined", recommended: false, - url: "https://eslint.org/docs/rules/block-scoped-var" + url: "https://eslint.org/docs/latest/rules/block-scoped-var" }, schema: [], messages: { outOfScope: "'{{name}}' used outside of binding context." } }, - create(context) { let stack = []; + const sourceCode = context.sourceCode; + /** * 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({ @@ -66134,46 +58757,42 @@ module.exports = { } }); } + /** * 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. - + } + // 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); + } + // Gets declared variables, and checks its references. + const variables = sourceCode.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, @@ -66193,11 +58812,10 @@ module.exports = { VariableDeclaration: checkForVariables }; } - }; /***/ }), -/* 631 */ +/* 652 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -66207,20 +58825,21 @@ module.exports = { */ -const util = __webpack_require__(618); //------------------------------------------------------------------------------ + +const util = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Disallow or enforce spaces inside of blocks after opening block and before closing block", recommended: false, - url: "https://eslint.org/docs/rules/block-spacing" + url: "https://eslint.org/docs/latest/rules/block-spacing" }, fixable: "whitespace", schema: [{ @@ -66231,35 +58850,33 @@ module.exports = { extra: "Unexpected space(s) {{location}} '{{token}}'." } }, - create(context) { const always = context.options[0] !== "never", - messageId = always ? "missing" : "extra", - sourceCode = context.getSourceCode(); + messageId = always ? "missing" : "extra", + sourceCode = context.sourceCode; + /** * Gets the open brace token from a given node. * @param {ASTNode} node A BlockStatement/StaticBlock/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); } - if (node.type === "StaticBlock") { return sourceCode.getFirstToken(node, { skip: 1 }); // skip the `static` token - } // "BlockStatement" - + } + // "BlockStatement" return sourceCode.getFirstToken(node); } + /** * Checks whether or not: * - given tokens are on same line. @@ -66271,18 +58888,15 @@ module.exports = { * 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; } + /** * Checks and reports invalid spacing style inside braces. * @param {ASTNode} node A BlockStatement/StaticBlock/SwitchStatement node to check. * @returns {void} */ - - function checkSpacingInsideBraces(node) { // Gets braces and the first/last token of content. const openBrace = getOpenBrace(node); @@ -66292,28 +58906,27 @@ module.exports = { }); const lastToken = sourceCode.getTokenBefore(closeBrace, { includeComments: true - }); // Skip if the node is invalid or empty. + }); + // 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 - + } + // Skip line comments for option never if (!always && firstToken.type === "Line") { return; - } // Check. - + } + // 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, @@ -66322,28 +58935,22 @@ module.exports = { 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, @@ -66352,30 +58959,25 @@ module.exports = { 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, StaticBlock: checkSpacingInsideBraces, SwitchStatement: checkSpacingInsideBraces }; } - }; /***/ }), -/* 632 */ +/* 653 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -66385,20 +58987,21 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent brace style for blocks", recommended: false, - url: "https://eslint.org/docs/rules/brace-style" + url: "https://eslint.org/docs/latest/rules/brace-style" }, schema: [{ enum: ["1tbs", "stroustrup", "allman"] @@ -66422,11 +59025,12 @@ module.exports = { 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(); //-------------------------------------------------------------------------- + params = context.options[1] || {}, + sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -66436,31 +59040,28 @@ module.exports = { * @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 + 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, @@ -66468,7 +59069,6 @@ module.exports = { fix: removeNewlineBetween(tokenBeforeOpeningCurly, openingCurly) }); } - if (style === "allman" && astUtils.isTokenOnSameLine(tokenBeforeOpeningCurly, openingCurly) && !singleLineException) { context.report({ node: openingCurly, @@ -66476,7 +59076,6 @@ module.exports = { fix: fixer => fixer.insertTextBefore(openingCurly, "\n") }); } - if (astUtils.isTokenOnSameLine(openingCurly, tokenAfterOpeningCurly) && tokenAfterOpeningCurly !== closingCurly && !singleLineException) { context.report({ node: openingCurly, @@ -66484,7 +59083,6 @@ module.exports = { fix: fixer => fixer.insertTextAfter(openingCurly, "\n") }); } - if (tokenBeforeClosingCurly !== openingCurly && !singleLineException && astUtils.isTokenOnSameLine(tokenBeforeClosingCurly, closingCurly)) { context.report({ node: closingCurly, @@ -66493,16 +59091,14 @@ module.exports = { }); } } + /** * 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, @@ -66510,7 +59106,6 @@ module.exports = { fix: removeNewlineBetween(curlyToken, keywordToken) }); } - if (style !== "1tbs" && astUtils.isTokenOnSameLine(curlyToken, keywordToken)) { context.report({ node: curlyToken, @@ -66518,59 +59113,53 @@ module.exports = { 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)); } }, - StaticBlock(node) { validateCurlyPair(sourceCode.getFirstToken(node, { skip: 1 - }), // skip the `static` token + }), + // skip the `static` token 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)); } } - }; } - }; /***/ }), -/* 633 */ +/* 654 */ /***/ ((module) => { "use strict"; @@ -66579,12 +59168,13 @@ module.exports = { * @author Jamund Ferguson * @deprecated in ESLint v7.0.0 */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { deprecated: true, @@ -66593,7 +59183,7 @@ module.exports = { docs: { description: "Require `return` statements after callbacks", recommended: false, - url: "https://eslint.org/docs/rules/callback-return" + url: "https://eslint.org/docs/latest/rules/callback-return" }, schema: [{ type: "array", @@ -66605,10 +59195,11 @@ module.exports = { missingReturn: "Expected return with your callback function." } }, - create(context) { const callbacks = context.options[0] || ["callback", "cb", "next"], - sourceCode = context.getSourceCode(); //-------------------------------------------------------------------------- + sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -66618,126 +59209,120 @@ module.exports = { * @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.includes(node.parent.type)) { return findClosestParentOfType(node.parent, types); } - return node.parent; } + /** * Check to see if a node contains only identifiers * @param {ASTNode} node The node to check * @returns {boolean} Whether or not the node contains only identifiers */ - - 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.includes(sourceCode.getText(node.callee)); } + /** * 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() - + } + // cb() if (parentNode.expression === node) { return true; - } // special case for cb && cb() and similar - + } + // 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 + } + // find the closest block, return or loop + const closestBlock = findClosestParentOfType(node, ["BlockStatement", "ReturnStatement", "ArrowFunctionExpression"]) || {}; - const closestBlock = findClosestParentOfType(node, ["BlockStatement", "ReturnStatement", "ArrowFunctionExpression"]) || {}; // if our parent is a return we know we're ok - + // 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 - + } + // 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 - + } + // 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 + 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 + 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 - + } + // 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 - + } + // 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, @@ -66745,14 +59330,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 634 */ +/* 655 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -66760,24 +59343,26 @@ module.exports = { * @fileoverview Rule to flag non-camelcased identifiers * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce camelcase naming convention", recommended: false, - url: "https://eslint.org/docs/rules/camelcase" + url: "https://eslint.org/docs/latest/rules/camelcase" }, schema: [{ type: "object", @@ -66813,80 +59398,77 @@ module.exports = { notCamelCasePrivate: "#{{name}} is not in camel case." } }, - create(context) { const options = context.options[0] || {}; const properties = options.properties === "never" ? "never" : "always"; const ignoreDestructuring = options.ignoreDestructuring; const ignoreImports = options.ignoreImports; const ignoreGlobals = options.ignoreGlobals; - const allow = options.allow || []; //-------------------------------------------------------------------------- + const allow = options.allow || []; + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- - // contains reported nodes to avoid reporting twice on destructuring with shorthand notation + // contains reported nodes to avoid reporting twice on destructuring with shorthand notation const reported = new Set(); + /** * 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) { - const nameBody = name.replace(/^_+|_+$/gu, ""); // if there's an underscore, it might be A_CONSTANT, which is okay + const nameBody = name.replace(/^_+|_+$/gu, ""); + // if there's an underscore, it might be A_CONSTANT, which is okay return nameBody.includes("_") && nameBody !== nameBody.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 given name is good or not. * @param {string} name The name to check. * @returns {boolean} `true` if the name is good. * @private */ - - function isGoodName(name) { return !isUnderscored(name) || isAllowed(name); } + /** * Checks if a given identifier reference or member expression is an assignment * target. * @param {ASTNode} node The node to check. * @returns {boolean} `true` if the node is an assignment target. */ - - function isAssignmentTarget(node) { const parent = node.parent; - switch (parent.type) { case "AssignmentExpression": case "AssignmentPattern": return parent.left === node; - case "Property": return parent.parent.type === "ObjectPattern" && parent.value === node; - case "ArrayPattern": case "RestElement": return true; - default: return false; } } + /** * Checks if a given binding identifier uses the original name as-is. * - If it's in object destructuring or object expression, the original name is its property name. @@ -66894,39 +59476,33 @@ module.exports = { * @param {ASTNode} node The `Identifier` node to check. * @returns {boolean} `true` if the identifier uses the original name as-is. */ - - function equalsToOriginalName(node) { const localName = node.name; const valueNode = node.parent.type === "AssignmentPattern" ? node.parent : node; const parent = valueNode.parent; - switch (parent.type) { case "Property": return (parent.parent.type === "ObjectPattern" || parent.parent.type === "ObjectExpression") && parent.value === valueNode && !parent.computed && parent.key.type === "Identifier" && parent.key.name === localName; - case "ImportSpecifier": return parent.local === node && astUtils.getModuleExportName(parent.imported) === localName; - default: return false; } } + /** * 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.range[0])) { return; } + reported.add(node.range[0]); - reported.add(node.range[0]); // Report it. - + // Report it. context.report({ node, messageId: node.type === "PrivateIdentifier" ? "notCamelCasePrivate" : "notCamelCase", @@ -66935,13 +59511,12 @@ module.exports = { } }); } + /** * Reports an identifier reference or a binding identifier. * @param {ASTNode} node The `Identifier` node to report. * @returns {void} */ - - function reportReferenceId(node) { /* * For backward compatibility, if it's in callings then ignore it. @@ -66950,41 +59525,35 @@ module.exports = { if (node.parent.type === "CallExpression" || node.parent.type === "NewExpression") { return; } + /* * For backward compatibility, if it's a default value of * destructuring/parameters then ignore it. * Not sure why it is. */ - - if (node.parent.type === "AssignmentPattern" && node.parent.right === node) { return; } + /* * The `ignoreDestructuring` flag skips the identifiers that uses * the property name as-is. */ - - if (ignoreDestructuring && equalsToOriginalName(node)) { return; } - report(node); } - return { // Report camelcase of global variable references ------------------ - Program() { - const scope = context.getScope(); - + Program(node) { + const scope = sourceCode.getScope(node); if (!ignoreGlobals) { // Defined globals in config files or directive comments. for (const variable of scope.variables) { if (variable.identifiers.length > 0 || isGoodName(variable.name)) { continue; } - for (const reference of variable.references) { /* * For backward compatibility, this rule reports read-only @@ -66993,43 +59562,39 @@ module.exports = { reportReferenceId(reference.identifier); } } - } // Undefined globals. - + } + // Undefined globals. for (const reference of scope.through) { const id = reference.identifier; - if (isGoodName(id.name)) { continue; } + /* * For backward compatibility, this rule reports read-only * references as well. */ - - reportReferenceId(id); } }, - // Report camelcase of declared variables -------------------------- [["VariableDeclaration", "FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression", "ClassDeclaration", "ClassExpression", "CatchClause"]](node) { - for (const variable of context.getDeclaredVariables(node)) { + for (const variable of sourceCode.getDeclaredVariables(node)) { if (isGoodName(variable.name)) { continue; } + const id = variable.identifiers[0]; - const id = variable.identifiers[0]; // Report declaration. - + // Report declaration. if (!(ignoreDestructuring && equalsToOriginalName(id))) { report(id); } + /* * For backward compatibility, report references as well. * It looks unnecessary because declarations are reported. */ - - for (const reference of variable.references) { if (reference.init) { continue; // Skip the write references of initializers. @@ -67039,58 +59604,50 @@ module.exports = { } } }, - // Report camelcase in properties ---------------------------------- [["ObjectExpression > Property[computed!=true] > Identifier.key", "MethodDefinition[computed!=true] > Identifier.key", "PropertyDefinition[computed!=true] > Identifier.key", "MethodDefinition > PrivateIdentifier.key", "PropertyDefinition > PrivateIdentifier.key"]](node) { if (properties === "never" || isGoodName(node.name)) { return; } - report(node); }, - "MemberExpression[computed!=true] > Identifier.property"(node) { - if (properties === "never" || !isAssignmentTarget(node.parent) || // ← ignore read-only references. + if (properties === "never" || !isAssignmentTarget(node.parent) || + // ← ignore read-only references. isGoodName(node.name)) { return; } - report(node); }, - // Report camelcase in import -------------------------------------- ImportDeclaration(node) { - for (const variable of context.getDeclaredVariables(node)) { + for (const variable of sourceCode.getDeclaredVariables(node)) { if (isGoodName(variable.name)) { continue; } + const id = variable.identifiers[0]; - const id = variable.identifiers[0]; // Report declaration. - + // Report declaration. if (!(ignoreImports && equalsToOriginalName(id))) { report(id); } + /* * For backward compatibility, report references as well. * It looks unnecessary because declarations are reported. */ - - for (const reference of variable.references) { reportReferenceId(reference.identifier); } } }, - // Report camelcase in re-export ----------------------------------- [["ExportAllDeclaration > Identifier.exported", "ExportSpecifier > Identifier.exported"]](node) { if (isGoodName(node.name)) { return; } - report(node); }, - // Report camelcase in labels -------------------------------------- [["LabeledStatement > Identifier.label", /* @@ -67101,17 +59658,14 @@ module.exports = { if (isGoodName(node.name)) { return; } - report(node); } - }; } - }; /***/ }), -/* 635 */ +/* 656 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -67119,27 +59673,27 @@ module.exports = { * @fileoverview enforce or disallow capitalization of the first letter of a comment * @author Kevin Partington */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const LETTER_PATTERN = __webpack_require__(657); +const astUtils = __webpack_require__(639); -const LETTER_PATTERN = __webpack_require__(636); - -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - const DEFAULT_IGNORE_PATTERN = astUtils.COMMENTS_IGNORE_PATTERN, - WHITESPACE = /\s/gu, - MAYBE_URL = /^\s*[^:/?#\s]+:\/\/[^?#]/u; // TODO: Combine w/ max-len 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: { @@ -67160,6 +59714,7 @@ const DEFAULTS = { ignoreInlineComments: false, ignoreConsecutiveComments: false }; + /** * Get normalized options for either block or line comments from the given * user-provided options. @@ -67173,18 +59728,16 @@ const DEFAULTS = { * @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() { let rawOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return { @@ -67192,6 +59745,7 @@ function getAllNormalizedOptions() { Block: getNormalizedOptions(rawOptions, "block") }; } + /** * Creates a regular expression for each ignorePattern defined in the rule * options. @@ -67200,31 +59754,28 @@ function getAllNormalizedOptions() { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce or disallow capitalization of the first letter of a comment", recommended: false, - url: "https://eslint.org/docs/rules/capitalized-comments" + url: "https://eslint.org/docs/latest/rules/capitalized-comments" }, fixable: "code", schema: [{ @@ -67244,12 +59795,13 @@ module.exports = { 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); //---------------------------------------------------------------------- + normalizedOptions = getAllNormalizedOptions(context.options[1]), + sourceCode = context.sourceCode; + createRegExpForIgnorePatterns(normalizedOptions); + + //---------------------------------------------------------------------- // Helpers //---------------------------------------------------------------------- @@ -67269,103 +59821,91 @@ module.exports = { * @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 - }); + 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"].includes(previousTokenOrComment.type)); } + /** * 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. - + } + // 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. - + } + // 3. Check for inline comments. if (options.ignoreInlineComments && isInlineComment(comment)) { return true; - } // 4. Is this a consecutive comment (and are we tolerating those)? - + } + // 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? - + } + // 5. Does the comment start with a possible URL? if (MAYBE_URL.test(commentWithoutAsterisks)) { return true; - } // 6. Is the initial word character a letter? - + } + // 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. - + } + // 7. Check the case of the initial word character. const isUppercase = firstWordChar !== firstWordChar.toLocaleLowerCase(), - isLowercase = firstWordChar !== firstWordChar.toLocaleUpperCase(); - + 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); - + commentValid = isCommentValid(comment, options); if (!commentValid) { const messageId = capitalize === "always" ? "unexpectedLowercaseComment" : "unexpectedUppercaseComment"; context.report({ @@ -67373,33 +59913,31 @@ module.exports = { // 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 /*) + 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); } - }; } - }; /***/ }), -/* 636 */ +/* 657 */ /***/ ((module) => { "use strict"; @@ -67437,10 +59975,11 @@ module.exports = { */ + 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; /***/ }), -/* 637 */ +/* 658 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -67448,24 +59987,26 @@ module.exports = /[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\ * @fileoverview Rule to enforce that all class methods use 'this'. * @author Patrick Williams */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce that class methods utilize `this`", recommended: false, - url: "https://eslint.org/docs/rules/class-methods-use-this" + url: "https://eslint.org/docs/latest/rules/class-methods-use-this" }, schema: [{ type: "object", @@ -67487,81 +60028,73 @@ module.exports = { missingThis: "Expected 'this' to be used by class {{name}}." } }, - create(context) { const config = Object.assign({}, context.options[0]); const enforceForClassFields = config.enforceForClassFields !== false; const exceptMethods = new Set(config.exceptMethods || []); const stack = []; + /** * Push `this` used flag initialized with `false` onto the stack. * @returns {void} */ - function pushContext() { stack.push(false); } + /** * Pop `this` used flag from the stack. * @returns {boolean | undefined} `this` used flag */ - - function popContext() { return stack.pop(); } + /** * 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() { pushContext(); } + /** * 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) { switch (node.type) { case "MethodDefinition": return !node.static && node.kind !== "constructor"; - case "PropertyDefinition": return !node.static && enforceForClassFields; - default: return false; } } + /** * 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) { if (isInstanceMethod(node)) { if (node.computed) { return true; } - const hashIfNeeded = node.key.type === "PrivateIdentifier" ? "#" : ""; const name = node.key.type === "Literal" ? astUtils.getStaticStringValue(node.key) : node.key.name || ""; return !exceptMethods.has(hashIfNeeded + name); } - return false; } + /** * 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. @@ -67570,15 +60103,12 @@ module.exports = { * @returns {void} * @private */ - - function exitFunction(node) { const methodUsesThis = popContext(); - if (isIncludedInstanceMethod(node.parent) && !methodUsesThis) { context.report({ node, - loc: astUtils.getFunctionHeadLoc(node, context.getSourceCode()), + loc: astUtils.getFunctionHeadLoc(node, context.sourceCode), messageId: "missingThis", data: { name: astUtils.getFunctionNameWithKind(node) @@ -67586,31 +60116,27 @@ module.exports = { }); } } + /** * 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, - /* * Class field value are implicit functions. */ "PropertyDefinition > *.key:exit": pushContext, "PropertyDefinition:exit": popContext, - /* * Class static blocks are implicit functions. They aren't required to use `this`, * but we have to push context so that it captures any use of `this` in the static block @@ -67627,11 +60153,10 @@ module.exports = { }) }; } - }; /***/ }), -/* 638 */ +/* 659 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -67639,15 +60164,18 @@ module.exports = { * @fileoverview Rule to forbid or enforce dangling commas. * @author Ian Christian Myers */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - const DEFAULT_OPTIONS = Object.freeze({ arrays: "never", objects: "never", @@ -67655,24 +60183,23 @@ const DEFAULT_OPTIONS = Object.freeze({ 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 { @@ -67680,10 +60207,9 @@ function normalizeOptions(optionValue, ecmaVersion) { objects: optionValue, imports: optionValue, exports: optionValue, - functions: !ecmaVersion || ecmaVersion < 8 ? "ignore" : optionValue + functions: ecmaVersion < 2017 ? "ignore" : optionValue }; } - if (typeof optionValue === "object" && optionValue !== null) { return { arrays: optionValue.arrays || DEFAULT_OPTIONS.arrays, @@ -67693,22 +60219,21 @@ function normalizeOptions(optionValue, ecmaVersion) { functions: optionValue.functions || DEFAULT_OPTIONS.functions }; } - return DEFAULT_OPTIONS; -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Require or disallow trailing commas", recommended: false, - url: "https://eslint.org/docs/rules/comma-dangle" + url: "https://eslint.org/docs/latest/rules/comma-dangle" }, fixable: "code", schema: { @@ -67753,16 +60278,15 @@ module.exports = { missing: "Missing trailing comma." } }, - create(context) { - const options = normalizeOptions(context.options[0], context.parserOptions.ecmaVersion); - const sourceCode = context.getSourceCode(); + const options = normalizeOptions(context.options[0], context.languageOptions.ecmaVersion); + const sourceCode = context.sourceCode; + /** * 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) { /** * Returns the last element of an array @@ -67772,33 +60296,28 @@ module.exports = { function last(array) { return array[array.length - 1]; } - switch (node.type) { case "ObjectExpression": case "ObjectPattern": return last(node.properties); - case "ArrayExpression": case "ArrayPattern": return last(node.elements); - case "ImportDeclaration": case "ExportNamedDeclaration": return last(node.specifiers); - case "FunctionDeclaration": case "FunctionExpression": case "ArrowFunctionExpression": return last(node.params); - case "CallExpression": case "NewExpression": return 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 @@ -67807,8 +60326,6 @@ module.exports = { * @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": @@ -67816,19 +60333,17 @@ module.exports = { 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 @@ -67836,19 +60351,16 @@ module.exports = { * @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 @@ -67856,25 +60368,20 @@ module.exports = { * 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) { yield fixer.remove(trailingToken); + /* * Extend the range of the fix to include surrounding tokens to ensure * that the element after which the comma is removed stays _last_. @@ -67882,14 +60389,13 @@ module.exports = { * adding or removing elements in the same autofix pass. * https://github.com/eslint/eslint/issues/15660 */ - yield fixer.insertTextBefore(sourceCode.getTokenBefore(trailingToken), ""); yield fixer.insertTextAfter(sourceCode.getTokenAfter(trailingToken), ""); } - }); } } + /** * Reports the last element of a given node if it does not have a trailing * comma. @@ -67901,22 +60407,16 @@ module.exports = { * 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, @@ -67925,9 +60425,9 @@ module.exports = { end: astUtils.getNextLocation(sourceCode, trailingToken.loc.end) }, messageId: "missing", - *fix(fixer) { yield fixer.insertTextAfter(trailingToken, ","); + /* * Extend the range of the fix to include surrounding tokens to ensure * that the element after which the comma is inserted stays _last_. @@ -67935,14 +60435,13 @@ module.exports = { * adding or removing elements in the same autofix pass. * https://github.com/eslint/eslint/issues/15660 */ - yield fixer.insertTextBefore(trailingToken, ""); yield fixer.insertTextAfter(sourceCode.getTokenAfter(trailingToken), ""); } - }); } } + /** * If a given node is multiline, reports the last element of a given node * when it does not have a trailing comma. @@ -67952,8 +60451,6 @@ module.exports = { * ImportDeclaration, and ExportNamedDeclaration. * @returns {void} */ - - function forceTrailingCommaIfMultiline(node) { if (isMultiline(node)) { forceTrailingComma(node); @@ -67961,6 +60458,7 @@ module.exports = { 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. @@ -67970,20 +60468,17 @@ module.exports = { * 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: () => {} + ignore() {} }; return { ObjectExpression: predicate[options.objects], @@ -67999,11 +60494,10 @@ module.exports = { NewExpression: predicate[options.functions] }; } - }; /***/ }), -/* 639 */ +/* 660 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -68013,20 +60507,20 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent spacing before and after commas", recommended: false, - url: "https://eslint.org/docs/rules/comma-spacing" + url: "https://eslint.org/docs/latest/rules/comma-spacing" }, fixable: "whitespace", schema: [{ @@ -68048,19 +60542,21 @@ module.exports = { unexpected: "There should be no space {{loc}} ','." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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 + // 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. @@ -68069,23 +60565,18 @@ module.exports = { * @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]; @@ -68093,56 +60584,50 @@ module.exports = { start = node.range[1]; end = otherNode.range[0]; } - return fixer.replaceTextRange([start, end], newText); }, - messageId: options[loc] ? "missing" : "unexpected", data: { loc } }); } + /** * 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; } - const previousToken = tokensAndComments[i - 1]; const nextToken = tokensAndComments[i + 1]; - - if (previousToken && !astUtils.isCommaToken(previousToken) && // ignore spacing between two commas + if (previousToken && !astUtils.isCommaToken(previousToken) && + // ignore spacing between two commas /* * `commaTokensToIgnore` are ending commas of `null` elements (array holes/elisions). @@ -68158,27 +60643,29 @@ module.exports = { !commaTokensToIgnore.includes(token) && astUtils.isTokenOnSameLine(previousToken, token) && options.before !== sourceCode.isSpaceBetweenTokens(previousToken, token)) { report(token, "before", previousToken); } - - if (nextToken && !astUtils.isCommaToken(nextToken) && // ignore spacing between two commas - !astUtils.isClosingParenToken(nextToken) && // controlled by space-in-parens - !astUtils.isClosingBracketToken(nextToken) && // controlled by array-bracket-spacing - !astUtils.isClosingBraceToken(nextToken) && // controlled by object-curly-spacing - !(!options.after && nextToken.type === "Line") && // special case, allow space before line comment + if (nextToken && !astUtils.isCommaToken(nextToken) && + // ignore spacing between two commas + !astUtils.isClosingParenToken(nextToken) && + // controlled by space-in-parens + !astUtils.isClosingBracketToken(nextToken) && + // controlled by array-bracket-spacing + !astUtils.isClosingBraceToken(nextToken) && + // controlled by object-curly-spacing + !(!options.after && nextToken.type === "Line") && + // special case, allow space before line comment astUtils.isTokenOnSameLine(token, nextToken) && options.after !== sourceCode.isSpaceBetweenTokens(token, nextToken)) { report(token, "after", nextToken); } }); }, - ArrayExpression: addNullElementsToIgnoreList, ArrayPattern: addNullElementsToIgnoreList }; } - }; /***/ }), -/* 640 */ +/* 661 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -68188,20 +60675,21 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent comma style", recommended: false, - url: "https://eslint.org/docs/rules/comma-style" + url: "https://eslint.org/docs/latest/rules/comma-style" }, fixable: "code", schema: [{ @@ -68224,10 +60712,9 @@ module.exports = { expectedCommaLast: "',' should be placed last." } }, - create(context) { const style = context.options[0] || "last", - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; const exceptions = { ArrayPattern: true, ArrowFunctionExpression: true, @@ -68238,14 +60725,14 @@ module.exports = { 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 //-------------------------------------------------------------------------- @@ -68256,23 +60743,19 @@ module.exports = { * @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 @@ -68282,8 +60765,6 @@ module.exports = { * @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]]; @@ -68291,6 +60772,7 @@ module.exports = { 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. @@ -68300,15 +60782,16 @@ module.exports = { * @returns {void} * @private */ - - function validateCommaItemSpacing(previousItemToken, commaToken, currentItemToken, reportItem) { // if single line - if (astUtils.isTokenOnSameLine(commaToken, currentItemToken) && astUtils.isTokenOnSameLine(previousItemToken, commaToken)) {// do nothing. + 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 + const styleType = comment && comment.type === "Block" && astUtils.isTokenOnSameLine(commaToken, comment) ? style : "between"; + // lone comma context.report({ node: reportItem, loc: commaToken.loc, @@ -68331,6 +60814,7 @@ module.exports = { }); } } + /** * Checks the comma placement with regards to a declaration/property/element * @param {ASTNode} node The binary expression node to check @@ -68338,19 +60822,17 @@ module.exports = { * @private * @returns {void} */ - - function validateComma(node, property) { const items = node[property], - arrayLiteral = node.type === "ArrayExpression" || node.type === "ArrayPattern"; - + 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; + 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 @@ -68365,11 +60847,9 @@ module.exports = { * 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]; @@ -68377,102 +60857,89 @@ module.exports = { previousItemToken = currentItemToken; } }); + /* * 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); - + 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; } - }; /***/ }), -/* 641 */ +/* 662 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -68481,28 +60948,29 @@ module.exports = { * Counts the number of if, conditional, for, while, try, switch/case, * @author Patrick Brosset */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - -const astUtils = __webpack_require__(618); - +const astUtils = __webpack_require__(639); const { upperCaseFirst -} = __webpack_require__(642); //------------------------------------------------------------------------------ +} = __webpack_require__(663); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce a maximum cyclomatic complexity allowed in a program", recommended: false, - url: "https://eslint.org/docs/rules/complexity" + url: "https://eslint.org/docs/latest/rules/complexity" }, schema: [{ oneOf: [{ @@ -68527,41 +60995,40 @@ module.exports = { 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 per code path - - const complexities = []; + /** * Increase the complexity of the code path in context * @returns {void} * @private */ - function increaseComplexity() { complexities[complexities.length - 1]++; - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public API //-------------------------------------------------------------------------- - return { onCodePathStart() { // The initial complexity is 1, representing one execution path in the CodePath complexities.push(1); }, - // Each branching in the code adds 1 to the complexity CatchClause: increaseComplexity, ConditionalExpression: increaseComplexity, @@ -68574,30 +61041,26 @@ module.exports = { DoWhileStatement: increaseComplexity, // Avoid `default` "SwitchCase[test]": increaseComplexity, - // Logical assignment operators have short-circuiting behavior AssignmentExpression(node) { if (astUtils.isLogicalAssignmentOperator(node.operator)) { increaseComplexity(); } }, - onCodePathEnd(codePath, node) { const complexity = complexities.pop(); + /* * This rule only evaluates complexity of functions, so "program" is excluded. * Class field initializers and class static blocks are implicit functions. Therefore, * they shouldn't contribute to the enclosing function's complexity, but their * own complexity should be evaluated. */ - if (codePath.origin !== "function" && codePath.origin !== "class-field-initializer" && codePath.origin !== "class-static-block") { return; } - if (complexity > THRESHOLD) { let name; - if (codePath.origin === "class-field-initializer") { name = "class field initializer"; } else if (codePath.origin === "class-static-block") { @@ -68605,7 +61068,6 @@ module.exports = { } else { name = astUtils.getFunctionNameWithKind(node); } - context.report({ node, messageId: "complex", @@ -68617,15 +61079,13 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 642 */ -/***/ ((module) => { +/* 663 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /** @@ -68633,26 +61093,2277 @@ module.exports = { * @author Stephen Wade */ + + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ +const Graphemer = (__webpack_require__(664)["default"]); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// eslint-disable-next-line no-control-regex -- intentionally including control characters +const ASCII_REGEX = /^[\u0000-\u007f]*$/u; + +/** @type {Graphemer | undefined} */ +let splitter; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + /** * Converts the first letter of a string to uppercase. * @param {string} string The string to operate on * @returns {string} The converted string */ - function upperCaseFirst(string) { if (string.length <= 1) { return string.toUpperCase(); } - return string[0].toUpperCase() + string.slice(1); } +/** + * Counts graphemes in a given string. + * @param {string} value A string to count graphemes. + * @returns {number} The number of graphemes in `value`. + */ +function getGraphemeCount(value) { + if (ASCII_REGEX.test(value)) { + return value.length; + } + if (!splitter) { + splitter = new Graphemer(); + } + return splitter.countGraphemes(value); +} module.exports = { - upperCaseFirst + upperCaseFirst, + getGraphemeCount }; /***/ }), -/* 643 */ +/* 664 */ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; + + +var __importDefault = this && this.__importDefault || function (mod) { + return mod && mod.__esModule ? mod : { + "default": mod + }; +}; +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +const Graphemer_1 = __importDefault(__webpack_require__(665)); +exports["default"] = Graphemer_1.default; + +/***/ }), +/* 665 */ +/***/ (function(__unused_webpack_module, exports, __webpack_require__) { + +"use strict"; +var __importDefault=this&&this.__importDefault||function(mod){return mod&&mod.__esModule?mod:{"default":mod};};Object.defineProperty(exports, "__esModule", ({value:true}));const boundaries_1=__webpack_require__(666);const GraphemerHelper_1=__importDefault(__webpack_require__(667));const GraphemerIterator_1=__importDefault(__webpack_require__(668));class Graphemer{/** + * Returns the next grapheme break in the string after the given index + * @param string {string} + * @param index {number} + * @returns {number} + */static nextBreak(string,index){if(index===undefined){index=0;}if(index<0){return 0;}if(index>=string.length-1){return string.length;}const prevCP=GraphemerHelper_1.default.codePointAt(string,index);const prev=Graphemer.getGraphemeBreakProperty(prevCP);const prevEmoji=Graphemer.getEmojiProperty(prevCP);const mid=[];const midEmoji=[];for(let i=index+1;i.. +if(0x0<=code&&code<=0x9){return boundaries_1.CLUSTER_BREAK.CONTROL;}}else{// Cc +if(0xa===code){return boundaries_1.CLUSTER_BREAK.LF;}}}else{if(code<0xd){// Cc [2] .. +if(0xb<=code&&code<=0xc){return boundaries_1.CLUSTER_BREAK.CONTROL;}}else{if(code<0xe){// Cc +if(0xd===code){return boundaries_1.CLUSTER_BREAK.CR;}}else{// Cc [18] .. +if(0xe<=code&&code<=0x1f){return boundaries_1.CLUSTER_BREAK.CONTROL;}}}}}else{if(code<0x300){if(code<0xad){// Cc [33] .. +if(0x7f<=code&&code<=0x9f){return boundaries_1.CLUSTER_BREAK.CONTROL;}}else{// Cf SOFT HYPHEN +if(0xad===code){return boundaries_1.CLUSTER_BREAK.CONTROL;}}}else{if(code<0x483){// Mn [112] COMBINING GRAVE ACCENT..COMBINING LATIN SMALL LETTER X +if(0x300<=code&&code<=0x36f){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x591){// Mn [5] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC POKRYTIE +// Me [2] COMBINING CYRILLIC HUNDRED THOUSANDS SIGN..COMBINING CYRILLIC MILLIONS SIGN +if(0x483<=code&&code<=0x489){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [45] HEBREW ACCENT ETNAHTA..HEBREW POINT METEG +if(0x591<=code&&code<=0x5bd){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}else{if(code<0x610){if(code<0x5c4){if(code<0x5c1){// Mn HEBREW POINT RAFE +if(0x5bf===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT +if(0x5c1<=code&&code<=0x5c2){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x5c7){// Mn [2] HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT +if(0x5c4<=code&&code<=0x5c5){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x600){// Mn HEBREW POINT QAMATS QATAN +if(0x5c7===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Cf [6] ARABIC NUMBER SIGN..ARABIC NUMBER MARK ABOVE +if(0x600<=code&&code<=0x605){return boundaries_1.CLUSTER_BREAK.PREPEND;}}}}}else{if(code<0x670){if(code<0x61c){// Mn [11] ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL KASRA +if(0x610<=code&&code<=0x61a){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x64b){// Cf ARABIC LETTER MARK +if(0x61c===code){return boundaries_1.CLUSTER_BREAK.CONTROL;}}else{// Mn [21] ARABIC FATHATAN..ARABIC WAVY HAMZA BELOW +if(0x64b<=code&&code<=0x65f){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0x6d6){// Mn ARABIC LETTER SUPERSCRIPT ALEF +if(0x670===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x6dd){// Mn [7] ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA..ARABIC SMALL HIGH SEEN +if(0x6d6<=code&&code<=0x6dc){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Cf ARABIC END OF AYAH +if(0x6dd===code){return boundaries_1.CLUSTER_BREAK.PREPEND;}}}}}}}else{if(code<0x81b){if(code<0x730){if(code<0x6ea){if(code<0x6e7){// Mn [6] ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH MADDA +if(0x6df<=code&&code<=0x6e4){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [2] ARABIC SMALL HIGH YEH..ARABIC SMALL HIGH NOON +if(0x6e7<=code&&code<=0x6e8){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x70f){// Mn [4] ARABIC EMPTY CENTRE LOW STOP..ARABIC SMALL LOW MEEM +if(0x6ea<=code&&code<=0x6ed){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Cf SYRIAC ABBREVIATION MARK +if(0x70f===code){return boundaries_1.CLUSTER_BREAK.PREPEND;}// Mn SYRIAC LETTER SUPERSCRIPT ALAPH +if(0x711===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0x7eb){if(code<0x7a6){// Mn [27] SYRIAC PTHAHA ABOVE..SYRIAC BARREKH +if(0x730<=code&&code<=0x74a){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [11] THAANA ABAFILI..THAANA SUKUN +if(0x7a6<=code&&code<=0x7b0){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x7fd){// Mn [9] NKO COMBINING SHORT HIGH TONE..NKO COMBINING DOUBLE DOT ABOVE +if(0x7eb<=code&&code<=0x7f3){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x816){// Mn NKO DANTAYALAN +if(0x7fd===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [4] SAMARITAN MARK IN..SAMARITAN MARK DAGESH +if(0x816<=code&&code<=0x819){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}else{if(code<0x898){if(code<0x829){if(code<0x825){// Mn [9] SAMARITAN MARK EPENTHETIC YUT..SAMARITAN VOWEL SIGN A +if(0x81b<=code&&code<=0x823){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [3] SAMARITAN VOWEL SIGN SHORT A..SAMARITAN VOWEL SIGN U +if(0x825<=code&&code<=0x827){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x859){// Mn [5] SAMARITAN VOWEL SIGN LONG I..SAMARITAN MARK NEQUDAA +if(0x829<=code&&code<=0x82d){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x890){// Mn [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK +if(0x859<=code&&code<=0x85b){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Cf [2] ARABIC POUND MARK ABOVE..ARABIC PIASTRE MARK ABOVE +if(0x890<=code&&code<=0x891){return boundaries_1.CLUSTER_BREAK.PREPEND;}}}}}else{if(code<0x8e3){if(code<0x8ca){// Mn [8] ARABIC SMALL HIGH WORD AL-JUZ..ARABIC HALF MADDA OVER MADDA +if(0x898<=code&&code<=0x89f){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x8e2){// Mn [24] ARABIC SMALL HIGH FARSI YEH..ARABIC SMALL HIGH SIGN SAFHA +if(0x8ca<=code&&code<=0x8e1){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Cf ARABIC DISPUTED END OF AYAH +if(0x8e2===code){return boundaries_1.CLUSTER_BREAK.PREPEND;}}}}else{if(code<0x903){// Mn [32] ARABIC TURNED DAMMA BELOW..DEVANAGARI SIGN ANUSVARA +if(0x8e3<=code&&code<=0x902){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc DEVANAGARI SIGN VISARGA +if(0x903===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}// Mn DEVANAGARI VOWEL SIGN OE +if(0x93a===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}}else{if(code<0xa01){if(code<0x982){if(code<0x94d){if(code<0x93e){// Mc DEVANAGARI VOWEL SIGN OOE +if(0x93b===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}// Mn DEVANAGARI SIGN NUKTA +if(0x93c===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x941){// Mc [3] DEVANAGARI VOWEL SIGN AA..DEVANAGARI VOWEL SIGN II +if(0x93e<=code&&code<=0x940){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x949){// Mn [8] DEVANAGARI VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI +if(0x941<=code&&code<=0x948){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [4] DEVANAGARI VOWEL SIGN CANDRA O..DEVANAGARI VOWEL SIGN AU +if(0x949<=code&&code<=0x94c){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}else{if(code<0x951){if(code<0x94e){// Mn DEVANAGARI SIGN VIRAMA +if(0x94d===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [2] DEVANAGARI VOWEL SIGN PRISHTHAMATRA E..DEVANAGARI VOWEL SIGN AW +if(0x94e<=code&&code<=0x94f){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}else{if(code<0x962){// Mn [7] DEVANAGARI STRESS SIGN UDATTA..DEVANAGARI VOWEL SIGN UUE +if(0x951<=code&&code<=0x957){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x981){// Mn [2] DEVANAGARI VOWEL SIGN VOCALIC L..DEVANAGARI VOWEL SIGN VOCALIC LL +if(0x962<=code&&code<=0x963){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn BENGALI SIGN CANDRABINDU +if(0x981===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}else{if(code<0x9c7){if(code<0x9be){if(code<0x9bc){// Mc [2] BENGALI SIGN ANUSVARA..BENGALI SIGN VISARGA +if(0x982<=code&&code<=0x983){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn BENGALI SIGN NUKTA +if(0x9bc===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x9bf){// Mc BENGALI VOWEL SIGN AA +if(0x9be===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x9c1){// Mc [2] BENGALI VOWEL SIGN I..BENGALI VOWEL SIGN II +if(0x9bf<=code&&code<=0x9c0){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [4] BENGALI VOWEL SIGN U..BENGALI VOWEL SIGN VOCALIC RR +if(0x9c1<=code&&code<=0x9c4){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0x9d7){if(code<0x9cb){// Mc [2] BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI +if(0x9c7<=code&&code<=0x9c8){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x9cd){// Mc [2] BENGALI VOWEL SIGN O..BENGALI VOWEL SIGN AU +if(0x9cb<=code&&code<=0x9cc){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn BENGALI SIGN VIRAMA +if(0x9cd===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0x9e2){// Mc BENGALI AU LENGTH MARK +if(0x9d7===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x9fe){// Mn [2] BENGALI VOWEL SIGN VOCALIC L..BENGALI VOWEL SIGN VOCALIC LL +if(0x9e2<=code&&code<=0x9e3){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn BENGALI SANDHI MARK +if(0x9fe===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}}else{if(code<0xa83){if(code<0xa47){if(code<0xa3c){if(code<0xa03){// Mn [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN BINDI +if(0xa01<=code&&code<=0xa02){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc GURMUKHI SIGN VISARGA +if(0xa03===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}else{if(code<0xa3e){// Mn GURMUKHI SIGN NUKTA +if(0xa3c===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xa41){// Mc [3] GURMUKHI VOWEL SIGN AA..GURMUKHI VOWEL SIGN II +if(0xa3e<=code&&code<=0xa40){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [2] GURMUKHI VOWEL SIGN U..GURMUKHI VOWEL SIGN UU +if(0xa41<=code&&code<=0xa42){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0xa70){if(code<0xa4b){// Mn [2] GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN AI +if(0xa47<=code&&code<=0xa48){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xa51){// Mn [3] GURMUKHI VOWEL SIGN OO..GURMUKHI SIGN VIRAMA +if(0xa4b<=code&&code<=0xa4d){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn GURMUKHI SIGN UDAAT +if(0xa51===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0xa75){// Mn [2] GURMUKHI TIPPI..GURMUKHI ADDAK +if(0xa70<=code&&code<=0xa71){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xa81){// Mn GURMUKHI SIGN YAKASH +if(0xa75===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [2] GUJARATI SIGN CANDRABINDU..GUJARATI SIGN ANUSVARA +if(0xa81<=code&&code<=0xa82){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}else{if(code<0xac9){if(code<0xabe){// Mc GUJARATI SIGN VISARGA +if(0xa83===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}// Mn GUJARATI SIGN NUKTA +if(0xabc===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xac1){// Mc [3] GUJARATI VOWEL SIGN AA..GUJARATI VOWEL SIGN II +if(0xabe<=code&&code<=0xac0){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0xac7){// Mn [5] GUJARATI VOWEL SIGN U..GUJARATI VOWEL SIGN CANDRA E +if(0xac1<=code&&code<=0xac5){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [2] GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN AI +if(0xac7<=code&&code<=0xac8){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0xae2){if(code<0xacb){// Mc GUJARATI VOWEL SIGN CANDRA O +if(0xac9===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0xacd){// Mc [2] GUJARATI VOWEL SIGN O..GUJARATI VOWEL SIGN AU +if(0xacb<=code&&code<=0xacc){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn GUJARATI SIGN VIRAMA +if(0xacd===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0xafa){// Mn [2] GUJARATI VOWEL SIGN VOCALIC L..GUJARATI VOWEL SIGN VOCALIC LL +if(0xae2<=code&&code<=0xae3){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xb01){// Mn [6] GUJARATI SIGN SUKUN..GUJARATI SIGN TWO-CIRCLE NUKTA ABOVE +if(0xafa<=code&&code<=0xaff){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn ORIYA SIGN CANDRABINDU +if(0xb01===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}}}}else{if(code<0xcf3){if(code<0xc04){if(code<0xb82){if(code<0xb47){if(code<0xb3e){if(code<0xb3c){// Mc [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA +if(0xb02<=code&&code<=0xb03){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn ORIYA SIGN NUKTA +if(0xb3c===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0xb40){// Mc ORIYA VOWEL SIGN AA +// Mn ORIYA VOWEL SIGN I +if(0xb3e<=code&&code<=0xb3f){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xb41){// Mc ORIYA VOWEL SIGN II +if(0xb40===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [4] ORIYA VOWEL SIGN U..ORIYA VOWEL SIGN VOCALIC RR +if(0xb41<=code&&code<=0xb44){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0xb4d){if(code<0xb4b){// Mc [2] ORIYA VOWEL SIGN E..ORIYA VOWEL SIGN AI +if(0xb47<=code&&code<=0xb48){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mc [2] ORIYA VOWEL SIGN O..ORIYA VOWEL SIGN AU +if(0xb4b<=code&&code<=0xb4c){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}else{if(code<0xb55){// Mn ORIYA SIGN VIRAMA +if(0xb4d===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xb62){// Mn [2] ORIYA SIGN OVERLINE..ORIYA AI LENGTH MARK +// Mc ORIYA AU LENGTH MARK +if(0xb55<=code&&code<=0xb57){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [2] ORIYA VOWEL SIGN VOCALIC L..ORIYA VOWEL SIGN VOCALIC LL +if(0xb62<=code&&code<=0xb63){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}else{if(code<0xbc6){if(code<0xbbf){// Mn TAMIL SIGN ANUSVARA +if(0xb82===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}// Mc TAMIL VOWEL SIGN AA +if(0xbbe===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xbc0){// Mc TAMIL VOWEL SIGN I +if(0xbbf===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0xbc1){// Mn TAMIL VOWEL SIGN II +if(0xbc0===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [2] TAMIL VOWEL SIGN U..TAMIL VOWEL SIGN UU +if(0xbc1<=code&&code<=0xbc2){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}else{if(code<0xbd7){if(code<0xbca){// Mc [3] TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI +if(0xbc6<=code&&code<=0xbc8){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0xbcd){// Mc [3] TAMIL VOWEL SIGN O..TAMIL VOWEL SIGN AU +if(0xbca<=code&&code<=0xbcc){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn TAMIL SIGN VIRAMA +if(0xbcd===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0xc00){// Mc TAMIL AU LENGTH MARK +if(0xbd7===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xc01){// Mn TELUGU SIGN COMBINING CANDRABINDU ABOVE +if(0xc00===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [3] TELUGU SIGN CANDRABINDU..TELUGU SIGN VISARGA +if(0xc01<=code&&code<=0xc03){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}}}else{if(code<0xcbe){if(code<0xc4a){if(code<0xc3e){// Mn TELUGU SIGN COMBINING ANUSVARA ABOVE +if(0xc04===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}// Mn TELUGU SIGN NUKTA +if(0xc3c===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xc41){// Mn [3] TELUGU VOWEL SIGN AA..TELUGU VOWEL SIGN II +if(0xc3e<=code&&code<=0xc40){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xc46){// Mc [4] TELUGU VOWEL SIGN U..TELUGU VOWEL SIGN VOCALIC RR +if(0xc41<=code&&code<=0xc44){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI +if(0xc46<=code&&code<=0xc48){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0xc81){if(code<0xc55){// Mn [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA +if(0xc4a<=code&&code<=0xc4d){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xc62){// Mn [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK +if(0xc55<=code&&code<=0xc56){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL +if(0xc62<=code&&code<=0xc63){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0xc82){// Mn KANNADA SIGN CANDRABINDU +if(0xc81===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xcbc){// Mc [2] KANNADA SIGN ANUSVARA..KANNADA SIGN VISARGA +if(0xc82<=code&&code<=0xc83){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn KANNADA SIGN NUKTA +if(0xcbc===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}else{if(code<0xcc6){if(code<0xcc0){// Mc KANNADA VOWEL SIGN AA +if(0xcbe===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}// Mn KANNADA VOWEL SIGN I +if(0xcbf===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xcc2){// Mc [2] KANNADA VOWEL SIGN II..KANNADA VOWEL SIGN U +if(0xcc0<=code&&code<=0xcc1){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0xcc3){// Mc KANNADA VOWEL SIGN UU +if(0xcc2===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [2] KANNADA VOWEL SIGN VOCALIC R..KANNADA VOWEL SIGN VOCALIC RR +if(0xcc3<=code&&code<=0xcc4){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}else{if(code<0xccc){if(code<0xcc7){// Mn KANNADA VOWEL SIGN E +if(0xcc6===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xcca){// Mc [2] KANNADA VOWEL SIGN EE..KANNADA VOWEL SIGN AI +if(0xcc7<=code&&code<=0xcc8){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mc [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO +if(0xcca<=code&&code<=0xccb){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}else{if(code<0xcd5){// Mn [2] KANNADA VOWEL SIGN AU..KANNADA SIGN VIRAMA +if(0xccc<=code&&code<=0xccd){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xce2){// Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK +if(0xcd5<=code&&code<=0xcd6){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL +if(0xce2<=code&&code<=0xce3){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}}}else{if(code<0xddf){if(code<0xd4e){if(code<0xd3f){if(code<0xd02){if(code<0xd00){// Mc KANNADA SIGN COMBINING ANUSVARA ABOVE RIGHT +if(0xcf3===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [2] MALAYALAM SIGN COMBINING ANUSVARA ABOVE..MALAYALAM SIGN CANDRABINDU +if(0xd00<=code&&code<=0xd01){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0xd3b){// Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA +if(0xd02<=code&&code<=0xd03){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0xd3e){// Mn [2] MALAYALAM SIGN VERTICAL BAR VIRAMA..MALAYALAM SIGN CIRCULAR VIRAMA +if(0xd3b<=code&&code<=0xd3c){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc MALAYALAM VOWEL SIGN AA +if(0xd3e===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0xd46){if(code<0xd41){// Mc [2] MALAYALAM VOWEL SIGN I..MALAYALAM VOWEL SIGN II +if(0xd3f<=code&&code<=0xd40){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR +if(0xd41<=code&&code<=0xd44){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0xd4a){// Mc [3] MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI +if(0xd46<=code&&code<=0xd48){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0xd4d){// Mc [3] MALAYALAM VOWEL SIGN O..MALAYALAM VOWEL SIGN AU +if(0xd4a<=code&&code<=0xd4c){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn MALAYALAM SIGN VIRAMA +if(0xd4d===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}else{if(code<0xdca){if(code<0xd62){// Lo MALAYALAM LETTER DOT REPH +if(0xd4e===code){return boundaries_1.CLUSTER_BREAK.PREPEND;}// Mc MALAYALAM AU LENGTH MARK +if(0xd57===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xd81){// Mn [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL +if(0xd62<=code&&code<=0xd63){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xd82){// Mn SINHALA SIGN CANDRABINDU +if(0xd81===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [2] SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARGAYA +if(0xd82<=code&&code<=0xd83){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}else{if(code<0xdd2){if(code<0xdcf){// Mn SINHALA SIGN AL-LAKUNA +if(0xdca===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xdd0){// Mc SINHALA VOWEL SIGN AELA-PILLA +if(0xdcf===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [2] SINHALA VOWEL SIGN KETTI AEDA-PILLA..SINHALA VOWEL SIGN DIGA AEDA-PILLA +if(0xdd0<=code&&code<=0xdd1){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}else{if(code<0xdd6){// Mn [3] SINHALA VOWEL SIGN KETTI IS-PILLA..SINHALA VOWEL SIGN KETTI PAA-PILLA +if(0xdd2<=code&&code<=0xdd4){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xdd8){// Mn SINHALA VOWEL SIGN DIGA PAA-PILLA +if(0xdd6===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [7] SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA +if(0xdd8<=code&&code<=0xdde){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}}}else{if(code<0xf35){if(code<0xe47){if(code<0xe31){if(code<0xdf2){// Mc SINHALA VOWEL SIGN GAYANUKITTA +if(0xddf===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [2] SINHALA VOWEL SIGN DIGA GAETTA-PILLA..SINHALA VOWEL SIGN DIGA GAYANUKITTA +if(0xdf2<=code&&code<=0xdf3){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}else{if(code<0xe33){// Mn THAI CHARACTER MAI HAN-AKAT +if(0xe31===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xe34){// Lo THAI CHARACTER SARA AM +if(0xe33===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [7] THAI CHARACTER SARA I..THAI CHARACTER PHINTHU +if(0xe34<=code&&code<=0xe3a){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0xeb4){if(code<0xeb1){// Mn [8] THAI CHARACTER MAITAIKHU..THAI CHARACTER YAMAKKAN +if(0xe47<=code&&code<=0xe4e){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn LAO VOWEL SIGN MAI KAN +if(0xeb1===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}// Lo LAO VOWEL SIGN AM +if(0xeb3===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}else{if(code<0xec8){// Mn [9] LAO VOWEL SIGN I..LAO SEMIVOWEL SIGN LO +if(0xeb4<=code&&code<=0xebc){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xf18){// Mn [7] LAO TONE MAI EK..LAO YAMAKKAN +if(0xec8<=code&&code<=0xece){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [2] TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS +if(0xf18<=code&&code<=0xf19){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}else{if(code<0xf7f){if(code<0xf39){// Mn TIBETAN MARK NGAS BZUNG NYI ZLA +if(0xf35===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}// Mn TIBETAN MARK NGAS BZUNG SGOR RTAGS +if(0xf37===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xf3e){// Mn TIBETAN MARK TSA -PHRU +if(0xf39===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xf71){// Mc [2] TIBETAN SIGN YAR TSHES..TIBETAN SIGN MAR TSHES +if(0xf3e<=code&&code<=0xf3f){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [14] TIBETAN VOWEL SIGN AA..TIBETAN SIGN RJES SU NGA RO +if(0xf71<=code&&code<=0xf7e){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0xf8d){if(code<0xf80){// Mc TIBETAN SIGN RNAM BCAD +if(0xf7f===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0xf86){// Mn [5] TIBETAN VOWEL SIGN REVERSED I..TIBETAN MARK HALANTA +if(0xf80<=code&&code<=0xf84){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [2] TIBETAN SIGN LCI RTAGS..TIBETAN SIGN YANG RTAGS +if(0xf86<=code&&code<=0xf87){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0xf99){// Mn [11] TIBETAN SUBJOINED SIGN LCE TSA CAN..TIBETAN SUBJOINED LETTER JA +if(0xf8d<=code&&code<=0xf97){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xfc6){// Mn [36] TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOINED LETTER FIXED-FORM RA +if(0xf99<=code&&code<=0xfbc){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn TIBETAN SYMBOL PADMA GDAN +if(0xfc6===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}}}}}else{if(code<0x1c24){if(code<0x1930){if(code<0x1732){if(code<0x1082){if(code<0x103d){if(code<0x1032){if(code<0x1031){// Mn [4] MYANMAR VOWEL SIGN I..MYANMAR VOWEL SIGN UU +if(0x102d<=code&&code<=0x1030){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc MYANMAR VOWEL SIGN E +if(0x1031===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}else{if(code<0x1039){// Mn [6] MYANMAR VOWEL SIGN AI..MYANMAR SIGN DOT BELOW +if(0x1032<=code&&code<=0x1037){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x103b){// Mn [2] MYANMAR SIGN VIRAMA..MYANMAR SIGN ASAT +if(0x1039<=code&&code<=0x103a){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [2] MYANMAR CONSONANT SIGN MEDIAL YA..MYANMAR CONSONANT SIGN MEDIAL RA +if(0x103b<=code&&code<=0x103c){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}else{if(code<0x1058){if(code<0x1056){// Mn [2] MYANMAR CONSONANT SIGN MEDIAL WA..MYANMAR CONSONANT SIGN MEDIAL HA +if(0x103d<=code&&code<=0x103e){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [2] MYANMAR VOWEL SIGN VOCALIC R..MYANMAR VOWEL SIGN VOCALIC RR +if(0x1056<=code&&code<=0x1057){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}else{if(code<0x105e){// Mn [2] MYANMAR VOWEL SIGN VOCALIC L..MYANMAR VOWEL SIGN VOCALIC LL +if(0x1058<=code&&code<=0x1059){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x1071){// Mn [3] MYANMAR CONSONANT SIGN MON MEDIAL NA..MYANMAR CONSONANT SIGN MON MEDIAL LA +if(0x105e<=code&&code<=0x1060){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [4] MYANMAR VOWEL SIGN GEBA KAREN I..MYANMAR VOWEL SIGN KAYAH EE +if(0x1071<=code&&code<=0x1074){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}else{if(code<0x1100){if(code<0x1085){// Mn MYANMAR CONSONANT SIGN SHAN MEDIAL WA +if(0x1082===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}// Mc MYANMAR VOWEL SIGN SHAN E +if(0x1084===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x108d){// Mn [2] MYANMAR VOWEL SIGN SHAN E ABOVE..MYANMAR VOWEL SIGN SHAN FINAL Y +if(0x1085<=code&&code<=0x1086){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE +if(0x108d===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}// Mn MYANMAR VOWEL SIGN AITON AI +if(0x109d===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0x135d){if(code<0x1160){// Lo [96] HANGUL CHOSEONG KIYEOK..HANGUL CHOSEONG FILLER +if(0x1100<=code&&code<=0x115f){return boundaries_1.CLUSTER_BREAK.L;}}else{if(code<0x11a8){// Lo [72] HANGUL JUNGSEONG FILLER..HANGUL JUNGSEONG O-YAE +if(0x1160<=code&&code<=0x11a7){return boundaries_1.CLUSTER_BREAK.V;}}else{// Lo [88] HANGUL JONGSEONG KIYEOK..HANGUL JONGSEONG SSANGNIEUN +if(0x11a8<=code&&code<=0x11ff){return boundaries_1.CLUSTER_BREAK.T;}}}}else{if(code<0x1712){// Mn [3] ETHIOPIC COMBINING GEMINATION AND VOWEL LENGTH MARK..ETHIOPIC COMBINING GEMINATION MARK +if(0x135d<=code&&code<=0x135f){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x1715){// Mn [3] TAGALOG VOWEL SIGN I..TAGALOG SIGN VIRAMA +if(0x1712<=code&&code<=0x1714){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc TAGALOG SIGN PAMUDPOD +if(0x1715===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}}}else{if(code<0x17c9){if(code<0x17b6){if(code<0x1752){if(code<0x1734){// Mn [2] HANUNOO VOWEL SIGN I..HANUNOO VOWEL SIGN U +if(0x1732<=code&&code<=0x1733){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc HANUNOO SIGN PAMUDPOD +if(0x1734===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}else{if(code<0x1772){// Mn [2] BUHID VOWEL SIGN I..BUHID VOWEL SIGN U +if(0x1752<=code&&code<=0x1753){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x17b4){// Mn [2] TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U +if(0x1772<=code&&code<=0x1773){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA +if(0x17b4<=code&&code<=0x17b5){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0x17be){if(code<0x17b7){// Mc KHMER VOWEL SIGN AA +if(0x17b6===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [7] KHMER VOWEL SIGN I..KHMER VOWEL SIGN UA +if(0x17b7<=code&&code<=0x17bd){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x17c6){// Mc [8] KHMER VOWEL SIGN OE..KHMER VOWEL SIGN AU +if(0x17be<=code&&code<=0x17c5){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x17c7){// Mn KHMER SIGN NIKAHIT +if(0x17c6===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [2] KHMER SIGN REAHMUK..KHMER SIGN YUUKALEAPINTU +if(0x17c7<=code&&code<=0x17c8){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}}else{if(code<0x1885){if(code<0x180b){if(code<0x17dd){// Mn [11] KHMER SIGN MUUSIKATOAN..KHMER SIGN BATHAMASAT +if(0x17c9<=code&&code<=0x17d3){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn KHMER SIGN ATTHACAN +if(0x17dd===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x180e){// Mn [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE +if(0x180b<=code&&code<=0x180d){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Cf MONGOLIAN VOWEL SEPARATOR +if(0x180e===code){return boundaries_1.CLUSTER_BREAK.CONTROL;}// Mn MONGOLIAN FREE VARIATION SELECTOR FOUR +if(0x180f===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0x1923){if(code<0x18a9){// Mn [2] MONGOLIAN LETTER ALI GALI BALUDA..MONGOLIAN LETTER ALI GALI THREE BALUDA +if(0x1885<=code&&code<=0x1886){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x1920){// Mn MONGOLIAN LETTER ALI GALI DAGALGA +if(0x18a9===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [3] LIMBU VOWEL SIGN A..LIMBU VOWEL SIGN U +if(0x1920<=code&&code<=0x1922){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0x1927){// Mc [4] LIMBU VOWEL SIGN EE..LIMBU VOWEL SIGN AU +if(0x1923<=code&&code<=0x1926){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x1929){// Mn [2] LIMBU VOWEL SIGN E..LIMBU VOWEL SIGN O +if(0x1927<=code&&code<=0x1928){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [3] LIMBU SUBJOINED LETTER YA..LIMBU SUBJOINED LETTER WA +if(0x1929<=code&&code<=0x192b){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}}}}else{if(code<0x1b3b){if(code<0x1a58){if(code<0x1a19){if(code<0x1933){if(code<0x1932){// Mc [2] LIMBU SMALL LETTER KA..LIMBU SMALL LETTER NGA +if(0x1930<=code&&code<=0x1931){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn LIMBU SMALL LETTER ANUSVARA +if(0x1932===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x1939){// Mc [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA +if(0x1933<=code&&code<=0x1938){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x1a17){// Mn [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I +if(0x1939<=code&&code<=0x193b){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U +if(0x1a17<=code&&code<=0x1a18){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0x1a55){if(code<0x1a1b){// Mc [2] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN O +if(0x1a19<=code&&code<=0x1a1a){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn BUGINESE VOWEL SIGN AE +if(0x1a1b===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x1a56){// Mc TAI THAM CONSONANT SIGN MEDIAL RA +if(0x1a55===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn TAI THAM CONSONANT SIGN MEDIAL LA +if(0x1a56===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}// Mc TAI THAM CONSONANT SIGN LA TANG LAI +if(0x1a57===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}else{if(code<0x1a73){if(code<0x1a62){if(code<0x1a60){// Mn [7] TAI THAM SIGN MAI KANG LAI..TAI THAM CONSONANT SIGN SA +if(0x1a58<=code&&code<=0x1a5e){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn TAI THAM SIGN SAKOT +if(0x1a60===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x1a65){// Mn TAI THAM VOWEL SIGN MAI SAT +if(0x1a62===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x1a6d){// Mn [8] TAI THAM VOWEL SIGN I..TAI THAM VOWEL SIGN OA BELOW +if(0x1a65<=code&&code<=0x1a6c){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [6] TAI THAM VOWEL SIGN OY..TAI THAM VOWEL SIGN THAM AI +if(0x1a6d<=code&&code<=0x1a72){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}else{if(code<0x1b00){if(code<0x1a7f){// Mn [10] TAI THAM VOWEL SIGN OA ABOVE..TAI THAM SIGN KHUEN-LUE KARAN +if(0x1a73<=code&&code<=0x1a7c){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x1ab0){// Mn TAI THAM COMBINING CRYPTOGRAMMIC DOT +if(0x1a7f===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [14] COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW +// Me COMBINING PARENTHESES OVERLAY +// Mn [16] COMBINING LATIN SMALL LETTER W BELOW..COMBINING LATIN SMALL LETTER INSULAR T +if(0x1ab0<=code&&code<=0x1ace){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0x1b04){// Mn [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG +if(0x1b00<=code&&code<=0x1b03){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x1b34){// Mc BALINESE SIGN BISAH +if(0x1b04===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn BALINESE SIGN REREKAN +// Mc BALINESE VOWEL SIGN TEDUNG +// Mn [5] BALINESE VOWEL SIGN ULU..BALINESE VOWEL SIGN RA REPA +if(0x1b34<=code&&code<=0x1b3a){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}}else{if(code<0x1ba8){if(code<0x1b6b){if(code<0x1b3d){// Mc BALINESE VOWEL SIGN RA REPA TEDUNG +if(0x1b3b===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}// Mn BALINESE VOWEL SIGN LA LENGA +if(0x1b3c===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x1b42){// Mc [5] BALINESE VOWEL SIGN LA LENGA TEDUNG..BALINESE VOWEL SIGN TALING REPA TEDUNG +if(0x1b3d<=code&&code<=0x1b41){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x1b43){// Mn BALINESE VOWEL SIGN PEPET +if(0x1b42===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [2] BALINESE VOWEL SIGN PEPET TEDUNG..BALINESE ADEG ADEG +if(0x1b43<=code&&code<=0x1b44){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}else{if(code<0x1ba1){if(code<0x1b80){// Mn [9] BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING GONG +if(0x1b6b<=code&&code<=0x1b73){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x1b82){// Mn [2] SUNDANESE SIGN PANYECEK..SUNDANESE SIGN PANGLAYAR +if(0x1b80<=code&&code<=0x1b81){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc SUNDANESE SIGN PANGWISAD +if(0x1b82===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}else{if(code<0x1ba2){// Mc SUNDANESE CONSONANT SIGN PAMINGKAL +if(0x1ba1===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x1ba6){// Mn [4] SUNDANESE CONSONANT SIGN PANYAKRA..SUNDANESE VOWEL SIGN PANYUKU +if(0x1ba2<=code&&code<=0x1ba5){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [2] SUNDANESE VOWEL SIGN PANAELAENG..SUNDANESE VOWEL SIGN PANOLONG +if(0x1ba6<=code&&code<=0x1ba7){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}}else{if(code<0x1be8){if(code<0x1bab){if(code<0x1baa){// Mn [2] SUNDANESE VOWEL SIGN PAMEPET..SUNDANESE VOWEL SIGN PANEULEUNG +if(0x1ba8<=code&&code<=0x1ba9){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc SUNDANESE SIGN PAMAAEH +if(0x1baa===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}else{if(code<0x1be6){// Mn [3] SUNDANESE SIGN VIRAMA..SUNDANESE CONSONANT SIGN PASANGAN WA +if(0x1bab<=code&&code<=0x1bad){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn BATAK SIGN TOMPI +if(0x1be6===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}// Mc BATAK VOWEL SIGN E +if(0x1be7===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}else{if(code<0x1bee){if(code<0x1bea){// Mn [2] BATAK VOWEL SIGN PAKPAK E..BATAK VOWEL SIGN EE +if(0x1be8<=code&&code<=0x1be9){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x1bed){// Mc [3] BATAK VOWEL SIGN I..BATAK VOWEL SIGN O +if(0x1bea<=code&&code<=0x1bec){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn BATAK VOWEL SIGN KARO O +if(0x1bed===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0x1bef){// Mc BATAK VOWEL SIGN U +if(0x1bee===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x1bf2){// Mn [3] BATAK VOWEL SIGN U FOR SIMALUNGUN SA..BATAK CONSONANT SIGN H +if(0x1bef<=code&&code<=0x1bf1){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [2] BATAK PANGOLAT..BATAK PANONGONAN +if(0x1bf2<=code&&code<=0x1bf3){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}}}}}else{if(code<0xa952){if(code<0x2d7f){if(code<0x1cf7){if(code<0x1cd4){if(code<0x1c34){if(code<0x1c2c){// Mc [8] LEPCHA SUBJOINED LETTER YA..LEPCHA VOWEL SIGN UU +if(0x1c24<=code&&code<=0x1c2b){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [8] LEPCHA VOWEL SIGN E..LEPCHA CONSONANT SIGN T +if(0x1c2c<=code&&code<=0x1c33){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x1c36){// Mc [2] LEPCHA CONSONANT SIGN NYIN-DO..LEPCHA CONSONANT SIGN KANG +if(0x1c34<=code&&code<=0x1c35){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x1cd0){// Mn [2] LEPCHA SIGN RAN..LEPCHA SIGN NUKTA +if(0x1c36<=code&&code<=0x1c37){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [3] VEDIC TONE KARSHANA..VEDIC TONE PRENKHA +if(0x1cd0<=code&&code<=0x1cd2){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0x1ce2){if(code<0x1ce1){// Mn [13] VEDIC SIGN YAJURVEDIC MIDLINE SVARITA..VEDIC TONE RIGVEDIC KASHMIRI INDEPENDENT SVARITA +if(0x1cd4<=code&&code<=0x1ce0){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc VEDIC TONE ATHARVAVEDIC INDEPENDENT SVARITA +if(0x1ce1===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}else{if(code<0x1ced){// Mn [7] VEDIC SIGN VISARGA SVARITA..VEDIC SIGN VISARGA ANUDATTA WITH TAIL +if(0x1ce2<=code&&code<=0x1ce8){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn VEDIC SIGN TIRYAK +if(0x1ced===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}// Mn VEDIC TONE CANDRA ABOVE +if(0x1cf4===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0x200d){if(code<0x1dc0){if(code<0x1cf8){// Mc VEDIC SIGN ATIKRAMA +if(0x1cf7===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [2] VEDIC TONE RING ABOVE..VEDIC TONE DOUBLE RING ABOVE +if(0x1cf8<=code&&code<=0x1cf9){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x200b){// Mn [64] COMBINING DOTTED GRAVE ACCENT..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW +if(0x1dc0<=code&&code<=0x1dff){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Cf ZERO WIDTH SPACE +if(0x200b===code){return boundaries_1.CLUSTER_BREAK.CONTROL;}// Cf ZERO WIDTH NON-JOINER +if(0x200c===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0x2060){if(code<0x200e){// Cf ZERO WIDTH JOINER +if(0x200d===code){return boundaries_1.CLUSTER_BREAK.ZWJ;}}else{if(code<0x2028){// Cf [2] LEFT-TO-RIGHT MARK..RIGHT-TO-LEFT MARK +if(0x200e<=code&&code<=0x200f){return boundaries_1.CLUSTER_BREAK.CONTROL;}}else{// Zl LINE SEPARATOR +// Zp PARAGRAPH SEPARATOR +// Cf [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE +if(0x2028<=code&&code<=0x202e){return boundaries_1.CLUSTER_BREAK.CONTROL;}}}}else{if(code<0x20d0){// Cf [5] WORD JOINER..INVISIBLE PLUS +// Cn +// Cf [10] LEFT-TO-RIGHT ISOLATE..NOMINAL DIGIT SHAPES +if(0x2060<=code&&code<=0x206f){return boundaries_1.CLUSTER_BREAK.CONTROL;}}else{if(code<0x2cef){// Mn [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE +// Me [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE BACKSLASH +// Mn COMBINING LEFT RIGHT ARROW ABOVE +// Me [3] COMBINING ENCLOSING SCREEN..COMBINING ENCLOSING UPWARD POINTING TRIANGLE +// Mn [12] COMBINING REVERSE SOLIDUS OVERLAY..COMBINING ASTERISK ABOVE +if(0x20d0<=code&&code<=0x20f0){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [3] COPTIC COMBINING NI ABOVE..COPTIC COMBINING SPIRITUS LENIS +if(0x2cef<=code&&code<=0x2cf1){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}}else{if(code<0xa823){if(code<0xa674){if(code<0x302a){if(code<0x2de0){// Mn TIFINAGH CONSONANT JOINER +if(0x2d7f===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [32] COMBINING CYRILLIC LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS +if(0x2de0<=code&&code<=0x2dff){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x3099){// Mn [4] IDEOGRAPHIC LEVEL TONE MARK..IDEOGRAPHIC ENTERING TONE MARK +// Mc [2] HANGUL SINGLE DOT TONE MARK..HANGUL DOUBLE DOT TONE MARK +if(0x302a<=code&&code<=0x302f){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xa66f){// Mn [2] COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK +if(0x3099<=code&&code<=0x309a){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn COMBINING CYRILLIC VZMET +// Me [3] COMBINING CYRILLIC TEN MILLIONS SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN +if(0xa66f<=code&&code<=0xa672){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0xa802){if(code<0xa69e){// Mn [10] COMBINING CYRILLIC LETTER UKRAINIAN IE..COMBINING CYRILLIC PAYEROK +if(0xa674<=code&&code<=0xa67d){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xa6f0){// Mn [2] COMBINING CYRILLIC LETTER EF..COMBINING CYRILLIC LETTER IOTIFIED E +if(0xa69e<=code&&code<=0xa69f){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS +if(0xa6f0<=code&&code<=0xa6f1){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0xa806){// Mn SYLOTI NAGRI SIGN DVISVARA +if(0xa802===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn SYLOTI NAGRI SIGN HASANTA +if(0xa806===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}// Mn SYLOTI NAGRI SIGN ANUSVARA +if(0xa80b===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0xa8b4){if(code<0xa827){if(code<0xa825){// Mc [2] SYLOTI NAGRI VOWEL SIGN A..SYLOTI NAGRI VOWEL SIGN I +if(0xa823<=code&&code<=0xa824){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [2] SYLOTI NAGRI VOWEL SIGN U..SYLOTI NAGRI VOWEL SIGN E +if(0xa825<=code&&code<=0xa826){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0xa82c){// Mc SYLOTI NAGRI VOWEL SIGN OO +if(0xa827===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0xa880){// Mn SYLOTI NAGRI SIGN ALTERNATE HASANTA +if(0xa82c===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [2] SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VISARGA +if(0xa880<=code&&code<=0xa881){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}else{if(code<0xa8ff){if(code<0xa8c4){// Mc [16] SAURASHTRA CONSONANT SIGN HAARU..SAURASHTRA VOWEL SIGN AU +if(0xa8b4<=code&&code<=0xa8c3){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0xa8e0){// Mn [2] SAURASHTRA SIGN VIRAMA..SAURASHTRA SIGN CANDRABINDU +if(0xa8c4<=code&&code<=0xa8c5){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [18] COMBINING DEVANAGARI DIGIT ZERO..COMBINING DEVANAGARI SIGN AVAGRAHA +if(0xa8e0<=code&&code<=0xa8f1){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0xa926){// Mn DEVANAGARI VOWEL SIGN AY +if(0xa8ff===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xa947){// Mn [8] KAYAH LI VOWEL UE..KAYAH LI TONE CALYA PLOPHU +if(0xa926<=code&&code<=0xa92d){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [11] REJANG VOWEL SIGN I..REJANG CONSONANT SIGN R +if(0xa947<=code&&code<=0xa951){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}}}else{if(code<0xaab2){if(code<0xa9e5){if(code<0xa9b4){if(code<0xa980){if(code<0xa960){// Mc [2] REJANG CONSONANT SIGN H..REJANG VIRAMA +if(0xa952<=code&&code<=0xa953){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Lo [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANGUL CHOSEONG SSANGYEORINHIEUH +if(0xa960<=code&&code<=0xa97c){return boundaries_1.CLUSTER_BREAK.L;}}}else{if(code<0xa983){// Mn [3] JAVANESE SIGN PANYANGGA..JAVANESE SIGN LAYAR +if(0xa980<=code&&code<=0xa982){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc JAVANESE SIGN WIGNYAN +if(0xa983===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}// Mn JAVANESE SIGN CECAK TELU +if(0xa9b3===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0xa9ba){if(code<0xa9b6){// Mc [2] JAVANESE VOWEL SIGN TARUNG..JAVANESE VOWEL SIGN TOLONG +if(0xa9b4<=code&&code<=0xa9b5){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [4] JAVANESE VOWEL SIGN WULU..JAVANESE VOWEL SIGN SUKU MENDUT +if(0xa9b6<=code&&code<=0xa9b9){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0xa9bc){// Mc [2] JAVANESE VOWEL SIGN TALING..JAVANESE VOWEL SIGN DIRGA MURE +if(0xa9ba<=code&&code<=0xa9bb){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0xa9be){// Mn [2] JAVANESE VOWEL SIGN PEPET..JAVANESE CONSONANT SIGN KERET +if(0xa9bc<=code&&code<=0xa9bd){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [3] JAVANESE CONSONANT SIGN PENGKAL..JAVANESE PANGKON +if(0xa9be<=code&&code<=0xa9c0){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}}else{if(code<0xaa35){if(code<0xaa2f){if(code<0xaa29){// Mn MYANMAR SIGN SHAN SAW +if(0xa9e5===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [6] CHAM VOWEL SIGN AA..CHAM VOWEL SIGN OE +if(0xaa29<=code&&code<=0xaa2e){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0xaa31){// Mc [2] CHAM VOWEL SIGN O..CHAM VOWEL SIGN AI +if(0xaa2f<=code&&code<=0xaa30){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0xaa33){// Mn [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIGN UE +if(0xaa31<=code&&code<=0xaa32){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [2] CHAM CONSONANT SIGN YA..CHAM CONSONANT SIGN RA +if(0xaa33<=code&&code<=0xaa34){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}else{if(code<0xaa4d){if(code<0xaa43){// Mn [2] CHAM CONSONANT SIGN LA..CHAM CONSONANT SIGN WA +if(0xaa35<=code&&code<=0xaa36){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn CHAM CONSONANT SIGN FINAL NG +if(0xaa43===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}// Mn CHAM CONSONANT SIGN FINAL M +if(0xaa4c===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0xaa7c){// Mc CHAM CONSONANT SIGN FINAL H +if(0xaa4d===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn MYANMAR SIGN TAI LAING TONE-2 +if(0xaa7c===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}// Mn TAI VIET MAI KANG +if(0xaab0===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}else{if(code<0xabe6){if(code<0xaaec){if(code<0xaabe){if(code<0xaab7){// Mn [3] TAI VIET VOWEL I..TAI VIET VOWEL U +if(0xaab2<=code&&code<=0xaab4){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [2] TAI VIET MAI KHIT..TAI VIET VOWEL IA +if(0xaab7<=code&&code<=0xaab8){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0xaac1){// Mn [2] TAI VIET VOWEL AM..TAI VIET TONE MAI EK +if(0xaabe<=code&&code<=0xaabf){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn TAI VIET TONE MAI THO +if(0xaac1===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}// Mc MEETEI MAYEK VOWEL SIGN II +if(0xaaeb===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}else{if(code<0xaaf6){if(code<0xaaee){// Mn [2] MEETEI MAYEK VOWEL SIGN UU..MEETEI MAYEK VOWEL SIGN AAI +if(0xaaec<=code&&code<=0xaaed){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xaaf5){// Mc [2] MEETEI MAYEK VOWEL SIGN AU..MEETEI MAYEK VOWEL SIGN AAU +if(0xaaee<=code&&code<=0xaaef){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mc MEETEI MAYEK VOWEL SIGN VISARGA +if(0xaaf5===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}else{if(code<0xabe3){// Mn MEETEI MAYEK VIRAMA +if(0xaaf6===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xabe5){// Mc [2] MEETEI MAYEK VOWEL SIGN ONAP..MEETEI MAYEK VOWEL SIGN INAP +if(0xabe3<=code&&code<=0xabe4){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn MEETEI MAYEK VOWEL SIGN ANAP +if(0xabe5===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}else{if(code<0xac00){if(code<0xabe9){if(code<0xabe8){// Mc [2] MEETEI MAYEK VOWEL SIGN YENAP..MEETEI MAYEK VOWEL SIGN SOUNAP +if(0xabe6<=code&&code<=0xabe7){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn MEETEI MAYEK VOWEL SIGN UNAP +if(0xabe8===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0xabec){// Mc [2] MEETEI MAYEK VOWEL SIGN CHEINAP..MEETEI MAYEK VOWEL SIGN NUNG +if(0xabe9<=code&&code<=0xabea){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mc MEETEI MAYEK LUM IYEK +if(0xabec===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}// Mn MEETEI MAYEK APUN IYEK +if(0xabed===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0xac1d){if(code<0xac01){// Lo HANGUL SYLLABLE GA +if(0xac00===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xac1c){// Lo [27] HANGUL SYLLABLE GAG..HANGUL SYLLABLE GAH +if(0xac01<=code&&code<=0xac1b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE GAE +if(0xac1c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xac38){// Lo [27] HANGUL SYLLABLE GAEG..HANGUL SYLLABLE GAEH +if(0xac1d<=code&&code<=0xac37){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xac39){// Lo HANGUL SYLLABLE GYA +if(0xac38===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE GYAG..HANGUL SYLLABLE GYAH +if(0xac39<=code&&code<=0xac53){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}}}}}}else{if(code<0xb5a1){if(code<0xb0ed){if(code<0xaea0){if(code<0xad6d){if(code<0xace0){if(code<0xac8d){if(code<0xac70){if(code<0xac55){// Lo HANGUL SYLLABLE GYAE +if(0xac54===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE GYAEG..HANGUL SYLLABLE GYAEH +if(0xac55<=code&&code<=0xac6f){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xac71){// Lo HANGUL SYLLABLE GEO +if(0xac70===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xac8c){// Lo [27] HANGUL SYLLABLE GEOG..HANGUL SYLLABLE GEOH +if(0xac71<=code&&code<=0xac8b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE GE +if(0xac8c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xaca9){if(code<0xaca8){// Lo [27] HANGUL SYLLABLE GEG..HANGUL SYLLABLE GEH +if(0xac8d<=code&&code<=0xaca7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE GYEO +if(0xaca8===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xacc4){// Lo [27] HANGUL SYLLABLE GYEOG..HANGUL SYLLABLE GYEOH +if(0xaca9<=code&&code<=0xacc3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xacc5){// Lo HANGUL SYLLABLE GYE +if(0xacc4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE GYEG..HANGUL SYLLABLE GYEH +if(0xacc5<=code&&code<=0xacdf){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}else{if(code<0xad19){if(code<0xacfc){if(code<0xace1){// Lo HANGUL SYLLABLE GO +if(0xace0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE GOG..HANGUL SYLLABLE GOH +if(0xace1<=code&&code<=0xacfb){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xacfd){// Lo HANGUL SYLLABLE GWA +if(0xacfc===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xad18){// Lo [27] HANGUL SYLLABLE GWAG..HANGUL SYLLABLE GWAH +if(0xacfd<=code&&code<=0xad17){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE GWAE +if(0xad18===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xad50){if(code<0xad34){// Lo [27] HANGUL SYLLABLE GWAEG..HANGUL SYLLABLE GWAEH +if(0xad19<=code&&code<=0xad33){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xad35){// Lo HANGUL SYLLABLE GOE +if(0xad34===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE GOEG..HANGUL SYLLABLE GOEH +if(0xad35<=code&&code<=0xad4f){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xad51){// Lo HANGUL SYLLABLE GYO +if(0xad50===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xad6c){// Lo [27] HANGUL SYLLABLE GYOG..HANGUL SYLLABLE GYOH +if(0xad51<=code&&code<=0xad6b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE GU +if(0xad6c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}}else{if(code<0xadf9){if(code<0xadc0){if(code<0xad89){if(code<0xad88){// Lo [27] HANGUL SYLLABLE GUG..HANGUL SYLLABLE GUH +if(0xad6d<=code&&code<=0xad87){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE GWEO +if(0xad88===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xada4){// Lo [27] HANGUL SYLLABLE GWEOG..HANGUL SYLLABLE GWEOH +if(0xad89<=code&&code<=0xada3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xada5){// Lo HANGUL SYLLABLE GWE +if(0xada4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE GWEG..HANGUL SYLLABLE GWEH +if(0xada5<=code&&code<=0xadbf){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xaddc){if(code<0xadc1){// Lo HANGUL SYLLABLE GWI +if(0xadc0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE GWIG..HANGUL SYLLABLE GWIH +if(0xadc1<=code&&code<=0xaddb){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xaddd){// Lo HANGUL SYLLABLE GYU +if(0xaddc===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xadf8){// Lo [27] HANGUL SYLLABLE GYUG..HANGUL SYLLABLE GYUH +if(0xaddd<=code&&code<=0xadf7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE GEU +if(0xadf8===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}else{if(code<0xae4c){if(code<0xae15){if(code<0xae14){// Lo [27] HANGUL SYLLABLE GEUG..HANGUL SYLLABLE GEUH +if(0xadf9<=code&&code<=0xae13){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE GYI +if(0xae14===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xae30){// Lo [27] HANGUL SYLLABLE GYIG..HANGUL SYLLABLE GYIH +if(0xae15<=code&&code<=0xae2f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xae31){// Lo HANGUL SYLLABLE GI +if(0xae30===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE GIG..HANGUL SYLLABLE GIH +if(0xae31<=code&&code<=0xae4b){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xae69){if(code<0xae4d){// Lo HANGUL SYLLABLE GGA +if(0xae4c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xae68){// Lo [27] HANGUL SYLLABLE GGAG..HANGUL SYLLABLE GGAH +if(0xae4d<=code&&code<=0xae67){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE GGAE +if(0xae68===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xae84){// Lo [27] HANGUL SYLLABLE GGAEG..HANGUL SYLLABLE GGAEH +if(0xae69<=code&&code<=0xae83){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xae85){// Lo HANGUL SYLLABLE GGYA +if(0xae84===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE GGYAG..HANGUL SYLLABLE GGYAH +if(0xae85<=code&&code<=0xae9f){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}}}else{if(code<0xafb9){if(code<0xaf2c){if(code<0xaed9){if(code<0xaebc){if(code<0xaea1){// Lo HANGUL SYLLABLE GGYAE +if(0xaea0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE GGYAEG..HANGUL SYLLABLE GGYAEH +if(0xaea1<=code&&code<=0xaebb){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xaebd){// Lo HANGUL SYLLABLE GGEO +if(0xaebc===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xaed8){// Lo [27] HANGUL SYLLABLE GGEOG..HANGUL SYLLABLE GGEOH +if(0xaebd<=code&&code<=0xaed7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE GGE +if(0xaed8===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xaef5){if(code<0xaef4){// Lo [27] HANGUL SYLLABLE GGEG..HANGUL SYLLABLE GGEH +if(0xaed9<=code&&code<=0xaef3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE GGYEO +if(0xaef4===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xaf10){// Lo [27] HANGUL SYLLABLE GGYEOG..HANGUL SYLLABLE GGYEOH +if(0xaef5<=code&&code<=0xaf0f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xaf11){// Lo HANGUL SYLLABLE GGYE +if(0xaf10===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE GGYEG..HANGUL SYLLABLE GGYEH +if(0xaf11<=code&&code<=0xaf2b){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}else{if(code<0xaf65){if(code<0xaf48){if(code<0xaf2d){// Lo HANGUL SYLLABLE GGO +if(0xaf2c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE GGOG..HANGUL SYLLABLE GGOH +if(0xaf2d<=code&&code<=0xaf47){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xaf49){// Lo HANGUL SYLLABLE GGWA +if(0xaf48===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xaf64){// Lo [27] HANGUL SYLLABLE GGWAG..HANGUL SYLLABLE GGWAH +if(0xaf49<=code&&code<=0xaf63){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE GGWAE +if(0xaf64===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xaf9c){if(code<0xaf80){// Lo [27] HANGUL SYLLABLE GGWAEG..HANGUL SYLLABLE GGWAEH +if(0xaf65<=code&&code<=0xaf7f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xaf81){// Lo HANGUL SYLLABLE GGOE +if(0xaf80===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE GGOEG..HANGUL SYLLABLE GGOEH +if(0xaf81<=code&&code<=0xaf9b){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xaf9d){// Lo HANGUL SYLLABLE GGYO +if(0xaf9c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xafb8){// Lo [27] HANGUL SYLLABLE GGYOG..HANGUL SYLLABLE GGYOH +if(0xaf9d<=code&&code<=0xafb7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE GGU +if(0xafb8===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}}else{if(code<0xb060){if(code<0xb00c){if(code<0xafd5){if(code<0xafd4){// Lo [27] HANGUL SYLLABLE GGUG..HANGUL SYLLABLE GGUH +if(0xafb9<=code&&code<=0xafd3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE GGWEO +if(0xafd4===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xaff0){// Lo [27] HANGUL SYLLABLE GGWEOG..HANGUL SYLLABLE GGWEOH +if(0xafd5<=code&&code<=0xafef){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xaff1){// Lo HANGUL SYLLABLE GGWE +if(0xaff0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE GGWEG..HANGUL SYLLABLE GGWEH +if(0xaff1<=code&&code<=0xb00b){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xb029){if(code<0xb00d){// Lo HANGUL SYLLABLE GGWI +if(0xb00c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb028){// Lo [27] HANGUL SYLLABLE GGWIG..HANGUL SYLLABLE GGWIH +if(0xb00d<=code&&code<=0xb027){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE GGYU +if(0xb028===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xb044){// Lo [27] HANGUL SYLLABLE GGYUG..HANGUL SYLLABLE GGYUH +if(0xb029<=code&&code<=0xb043){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb045){// Lo HANGUL SYLLABLE GGEU +if(0xb044===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE GGEUG..HANGUL SYLLABLE GGEUH +if(0xb045<=code&&code<=0xb05f){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}else{if(code<0xb099){if(code<0xb07c){if(code<0xb061){// Lo HANGUL SYLLABLE GGYI +if(0xb060===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE GGYIG..HANGUL SYLLABLE GGYIH +if(0xb061<=code&&code<=0xb07b){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xb07d){// Lo HANGUL SYLLABLE GGI +if(0xb07c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb098){// Lo [27] HANGUL SYLLABLE GGIG..HANGUL SYLLABLE GGIH +if(0xb07d<=code&&code<=0xb097){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE NA +if(0xb098===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xb0d0){if(code<0xb0b4){// Lo [27] HANGUL SYLLABLE NAG..HANGUL SYLLABLE NAH +if(0xb099<=code&&code<=0xb0b3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb0b5){// Lo HANGUL SYLLABLE NAE +if(0xb0b4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE NAEG..HANGUL SYLLABLE NAEH +if(0xb0b5<=code&&code<=0xb0cf){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xb0d1){// Lo HANGUL SYLLABLE NYA +if(0xb0d0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb0ec){// Lo [27] HANGUL SYLLABLE NYAG..HANGUL SYLLABLE NYAH +if(0xb0d1<=code&&code<=0xb0eb){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE NYAE +if(0xb0ec===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}}}}else{if(code<0xb354){if(code<0xb220){if(code<0xb179){if(code<0xb140){if(code<0xb109){if(code<0xb108){// Lo [27] HANGUL SYLLABLE NYAEG..HANGUL SYLLABLE NYAEH +if(0xb0ed<=code&&code<=0xb107){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE NEO +if(0xb108===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xb124){// Lo [27] HANGUL SYLLABLE NEOG..HANGUL SYLLABLE NEOH +if(0xb109<=code&&code<=0xb123){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb125){// Lo HANGUL SYLLABLE NE +if(0xb124===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE NEG..HANGUL SYLLABLE NEH +if(0xb125<=code&&code<=0xb13f){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xb15c){if(code<0xb141){// Lo HANGUL SYLLABLE NYEO +if(0xb140===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE NYEOG..HANGUL SYLLABLE NYEOH +if(0xb141<=code&&code<=0xb15b){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xb15d){// Lo HANGUL SYLLABLE NYE +if(0xb15c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb178){// Lo [27] HANGUL SYLLABLE NYEG..HANGUL SYLLABLE NYEH +if(0xb15d<=code&&code<=0xb177){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE NO +if(0xb178===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}else{if(code<0xb1cc){if(code<0xb195){if(code<0xb194){// Lo [27] HANGUL SYLLABLE NOG..HANGUL SYLLABLE NOH +if(0xb179<=code&&code<=0xb193){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE NWA +if(0xb194===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xb1b0){// Lo [27] HANGUL SYLLABLE NWAG..HANGUL SYLLABLE NWAH +if(0xb195<=code&&code<=0xb1af){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb1b1){// Lo HANGUL SYLLABLE NWAE +if(0xb1b0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE NWAEG..HANGUL SYLLABLE NWAEH +if(0xb1b1<=code&&code<=0xb1cb){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xb1e9){if(code<0xb1cd){// Lo HANGUL SYLLABLE NOE +if(0xb1cc===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb1e8){// Lo [27] HANGUL SYLLABLE NOEG..HANGUL SYLLABLE NOEH +if(0xb1cd<=code&&code<=0xb1e7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE NYO +if(0xb1e8===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xb204){// Lo [27] HANGUL SYLLABLE NYOG..HANGUL SYLLABLE NYOH +if(0xb1e9<=code&&code<=0xb203){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb205){// Lo HANGUL SYLLABLE NU +if(0xb204===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE NUG..HANGUL SYLLABLE NUH +if(0xb205<=code&&code<=0xb21f){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}}else{if(code<0xb2ad){if(code<0xb259){if(code<0xb23c){if(code<0xb221){// Lo HANGUL SYLLABLE NWEO +if(0xb220===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE NWEOG..HANGUL SYLLABLE NWEOH +if(0xb221<=code&&code<=0xb23b){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xb23d){// Lo HANGUL SYLLABLE NWE +if(0xb23c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb258){// Lo [27] HANGUL SYLLABLE NWEG..HANGUL SYLLABLE NWEH +if(0xb23d<=code&&code<=0xb257){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE NWI +if(0xb258===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xb290){if(code<0xb274){// Lo [27] HANGUL SYLLABLE NWIG..HANGUL SYLLABLE NWIH +if(0xb259<=code&&code<=0xb273){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb275){// Lo HANGUL SYLLABLE NYU +if(0xb274===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE NYUG..HANGUL SYLLABLE NYUH +if(0xb275<=code&&code<=0xb28f){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xb291){// Lo HANGUL SYLLABLE NEU +if(0xb290===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb2ac){// Lo [27] HANGUL SYLLABLE NEUG..HANGUL SYLLABLE NEUH +if(0xb291<=code&&code<=0xb2ab){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE NYI +if(0xb2ac===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}else{if(code<0xb300){if(code<0xb2c9){if(code<0xb2c8){// Lo [27] HANGUL SYLLABLE NYIG..HANGUL SYLLABLE NYIH +if(0xb2ad<=code&&code<=0xb2c7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE NI +if(0xb2c8===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xb2e4){// Lo [27] HANGUL SYLLABLE NIG..HANGUL SYLLABLE NIH +if(0xb2c9<=code&&code<=0xb2e3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb2e5){// Lo HANGUL SYLLABLE DA +if(0xb2e4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE DAG..HANGUL SYLLABLE DAH +if(0xb2e5<=code&&code<=0xb2ff){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xb31d){if(code<0xb301){// Lo HANGUL SYLLABLE DAE +if(0xb300===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb31c){// Lo [27] HANGUL SYLLABLE DAEG..HANGUL SYLLABLE DAEH +if(0xb301<=code&&code<=0xb31b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE DYA +if(0xb31c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xb338){// Lo [27] HANGUL SYLLABLE DYAG..HANGUL SYLLABLE DYAH +if(0xb31d<=code&&code<=0xb337){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb339){// Lo HANGUL SYLLABLE DYAE +if(0xb338===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE DYAEG..HANGUL SYLLABLE DYAEH +if(0xb339<=code&&code<=0xb353){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}}}else{if(code<0xb46d){if(code<0xb3e0){if(code<0xb38d){if(code<0xb370){if(code<0xb355){// Lo HANGUL SYLLABLE DEO +if(0xb354===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE DEOG..HANGUL SYLLABLE DEOH +if(0xb355<=code&&code<=0xb36f){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xb371){// Lo HANGUL SYLLABLE DE +if(0xb370===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb38c){// Lo [27] HANGUL SYLLABLE DEG..HANGUL SYLLABLE DEH +if(0xb371<=code&&code<=0xb38b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE DYEO +if(0xb38c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xb3a9){if(code<0xb3a8){// Lo [27] HANGUL SYLLABLE DYEOG..HANGUL SYLLABLE DYEOH +if(0xb38d<=code&&code<=0xb3a7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE DYE +if(0xb3a8===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xb3c4){// Lo [27] HANGUL SYLLABLE DYEG..HANGUL SYLLABLE DYEH +if(0xb3a9<=code&&code<=0xb3c3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb3c5){// Lo HANGUL SYLLABLE DO +if(0xb3c4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE DOG..HANGUL SYLLABLE DOH +if(0xb3c5<=code&&code<=0xb3df){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}else{if(code<0xb419){if(code<0xb3fc){if(code<0xb3e1){// Lo HANGUL SYLLABLE DWA +if(0xb3e0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE DWAG..HANGUL SYLLABLE DWAH +if(0xb3e1<=code&&code<=0xb3fb){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xb3fd){// Lo HANGUL SYLLABLE DWAE +if(0xb3fc===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb418){// Lo [27] HANGUL SYLLABLE DWAEG..HANGUL SYLLABLE DWAEH +if(0xb3fd<=code&&code<=0xb417){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE DOE +if(0xb418===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xb450){if(code<0xb434){// Lo [27] HANGUL SYLLABLE DOEG..HANGUL SYLLABLE DOEH +if(0xb419<=code&&code<=0xb433){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb435){// Lo HANGUL SYLLABLE DYO +if(0xb434===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE DYOG..HANGUL SYLLABLE DYOH +if(0xb435<=code&&code<=0xb44f){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xb451){// Lo HANGUL SYLLABLE DU +if(0xb450===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb46c){// Lo [27] HANGUL SYLLABLE DUG..HANGUL SYLLABLE DUH +if(0xb451<=code&&code<=0xb46b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE DWEO +if(0xb46c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}}else{if(code<0xb514){if(code<0xb4c0){if(code<0xb489){if(code<0xb488){// Lo [27] HANGUL SYLLABLE DWEOG..HANGUL SYLLABLE DWEOH +if(0xb46d<=code&&code<=0xb487){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE DWE +if(0xb488===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xb4a4){// Lo [27] HANGUL SYLLABLE DWEG..HANGUL SYLLABLE DWEH +if(0xb489<=code&&code<=0xb4a3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb4a5){// Lo HANGUL SYLLABLE DWI +if(0xb4a4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE DWIG..HANGUL SYLLABLE DWIH +if(0xb4a5<=code&&code<=0xb4bf){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xb4dd){if(code<0xb4c1){// Lo HANGUL SYLLABLE DYU +if(0xb4c0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb4dc){// Lo [27] HANGUL SYLLABLE DYUG..HANGUL SYLLABLE DYUH +if(0xb4c1<=code&&code<=0xb4db){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE DEU +if(0xb4dc===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xb4f8){// Lo [27] HANGUL SYLLABLE DEUG..HANGUL SYLLABLE DEUH +if(0xb4dd<=code&&code<=0xb4f7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb4f9){// Lo HANGUL SYLLABLE DYI +if(0xb4f8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE DYIG..HANGUL SYLLABLE DYIH +if(0xb4f9<=code&&code<=0xb513){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}else{if(code<0xb54d){if(code<0xb530){if(code<0xb515){// Lo HANGUL SYLLABLE DI +if(0xb514===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE DIG..HANGUL SYLLABLE DIH +if(0xb515<=code&&code<=0xb52f){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xb531){// Lo HANGUL SYLLABLE DDA +if(0xb530===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb54c){// Lo [27] HANGUL SYLLABLE DDAG..HANGUL SYLLABLE DDAH +if(0xb531<=code&&code<=0xb54b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE DDAE +if(0xb54c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xb584){if(code<0xb568){// Lo [27] HANGUL SYLLABLE DDAEG..HANGUL SYLLABLE DDAEH +if(0xb54d<=code&&code<=0xb567){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb569){// Lo HANGUL SYLLABLE DDYA +if(0xb568===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE DDYAG..HANGUL SYLLABLE DDYAH +if(0xb569<=code&&code<=0xb583){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xb585){// Lo HANGUL SYLLABLE DDYAE +if(0xb584===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb5a0){// Lo [27] HANGUL SYLLABLE DDYAEG..HANGUL SYLLABLE DDYAEH +if(0xb585<=code&&code<=0xb59f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE DDEO +if(0xb5a0===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}}}}}else{if(code<0xba55){if(code<0xb808){if(code<0xb6d4){if(code<0xb62d){if(code<0xb5f4){if(code<0xb5bd){if(code<0xb5bc){// Lo [27] HANGUL SYLLABLE DDEOG..HANGUL SYLLABLE DDEOH +if(0xb5a1<=code&&code<=0xb5bb){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE DDE +if(0xb5bc===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xb5d8){// Lo [27] HANGUL SYLLABLE DDEG..HANGUL SYLLABLE DDEH +if(0xb5bd<=code&&code<=0xb5d7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb5d9){// Lo HANGUL SYLLABLE DDYEO +if(0xb5d8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE DDYEOG..HANGUL SYLLABLE DDYEOH +if(0xb5d9<=code&&code<=0xb5f3){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xb610){if(code<0xb5f5){// Lo HANGUL SYLLABLE DDYE +if(0xb5f4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE DDYEG..HANGUL SYLLABLE DDYEH +if(0xb5f5<=code&&code<=0xb60f){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xb611){// Lo HANGUL SYLLABLE DDO +if(0xb610===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb62c){// Lo [27] HANGUL SYLLABLE DDOG..HANGUL SYLLABLE DDOH +if(0xb611<=code&&code<=0xb62b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE DDWA +if(0xb62c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}else{if(code<0xb680){if(code<0xb649){if(code<0xb648){// Lo [27] HANGUL SYLLABLE DDWAG..HANGUL SYLLABLE DDWAH +if(0xb62d<=code&&code<=0xb647){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE DDWAE +if(0xb648===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xb664){// Lo [27] HANGUL SYLLABLE DDWAEG..HANGUL SYLLABLE DDWAEH +if(0xb649<=code&&code<=0xb663){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb665){// Lo HANGUL SYLLABLE DDOE +if(0xb664===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE DDOEG..HANGUL SYLLABLE DDOEH +if(0xb665<=code&&code<=0xb67f){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xb69d){if(code<0xb681){// Lo HANGUL SYLLABLE DDYO +if(0xb680===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb69c){// Lo [27] HANGUL SYLLABLE DDYOG..HANGUL SYLLABLE DDYOH +if(0xb681<=code&&code<=0xb69b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE DDU +if(0xb69c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xb6b8){// Lo [27] HANGUL SYLLABLE DDUG..HANGUL SYLLABLE DDUH +if(0xb69d<=code&&code<=0xb6b7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb6b9){// Lo HANGUL SYLLABLE DDWEO +if(0xb6b8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE DDWEOG..HANGUL SYLLABLE DDWEOH +if(0xb6b9<=code&&code<=0xb6d3){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}}else{if(code<0xb761){if(code<0xb70d){if(code<0xb6f0){if(code<0xb6d5){// Lo HANGUL SYLLABLE DDWE +if(0xb6d4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE DDWEG..HANGUL SYLLABLE DDWEH +if(0xb6d5<=code&&code<=0xb6ef){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xb6f1){// Lo HANGUL SYLLABLE DDWI +if(0xb6f0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb70c){// Lo [27] HANGUL SYLLABLE DDWIG..HANGUL SYLLABLE DDWIH +if(0xb6f1<=code&&code<=0xb70b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE DDYU +if(0xb70c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xb744){if(code<0xb728){// Lo [27] HANGUL SYLLABLE DDYUG..HANGUL SYLLABLE DDYUH +if(0xb70d<=code&&code<=0xb727){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb729){// Lo HANGUL SYLLABLE DDEU +if(0xb728===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE DDEUG..HANGUL SYLLABLE DDEUH +if(0xb729<=code&&code<=0xb743){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xb745){// Lo HANGUL SYLLABLE DDYI +if(0xb744===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb760){// Lo [27] HANGUL SYLLABLE DDYIG..HANGUL SYLLABLE DDYIH +if(0xb745<=code&&code<=0xb75f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE DDI +if(0xb760===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}else{if(code<0xb7b4){if(code<0xb77d){if(code<0xb77c){// Lo [27] HANGUL SYLLABLE DDIG..HANGUL SYLLABLE DDIH +if(0xb761<=code&&code<=0xb77b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE RA +if(0xb77c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xb798){// Lo [27] HANGUL SYLLABLE RAG..HANGUL SYLLABLE RAH +if(0xb77d<=code&&code<=0xb797){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb799){// Lo HANGUL SYLLABLE RAE +if(0xb798===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE RAEG..HANGUL SYLLABLE RAEH +if(0xb799<=code&&code<=0xb7b3){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xb7d1){if(code<0xb7b5){// Lo HANGUL SYLLABLE RYA +if(0xb7b4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb7d0){// Lo [27] HANGUL SYLLABLE RYAG..HANGUL SYLLABLE RYAH +if(0xb7b5<=code&&code<=0xb7cf){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE RYAE +if(0xb7d0===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xb7ec){// Lo [27] HANGUL SYLLABLE RYAEG..HANGUL SYLLABLE RYAEH +if(0xb7d1<=code&&code<=0xb7eb){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb7ed){// Lo HANGUL SYLLABLE REO +if(0xb7ec===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE REOG..HANGUL SYLLABLE REOH +if(0xb7ed<=code&&code<=0xb807){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}}}else{if(code<0xb921){if(code<0xb894){if(code<0xb841){if(code<0xb824){if(code<0xb809){// Lo HANGUL SYLLABLE RE +if(0xb808===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE REG..HANGUL SYLLABLE REH +if(0xb809<=code&&code<=0xb823){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xb825){// Lo HANGUL SYLLABLE RYEO +if(0xb824===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb840){// Lo [27] HANGUL SYLLABLE RYEOG..HANGUL SYLLABLE RYEOH +if(0xb825<=code&&code<=0xb83f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE RYE +if(0xb840===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xb85d){if(code<0xb85c){// Lo [27] HANGUL SYLLABLE RYEG..HANGUL SYLLABLE RYEH +if(0xb841<=code&&code<=0xb85b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE RO +if(0xb85c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xb878){// Lo [27] HANGUL SYLLABLE ROG..HANGUL SYLLABLE ROH +if(0xb85d<=code&&code<=0xb877){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb879){// Lo HANGUL SYLLABLE RWA +if(0xb878===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE RWAG..HANGUL SYLLABLE RWAH +if(0xb879<=code&&code<=0xb893){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}else{if(code<0xb8cd){if(code<0xb8b0){if(code<0xb895){// Lo HANGUL SYLLABLE RWAE +if(0xb894===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE RWAEG..HANGUL SYLLABLE RWAEH +if(0xb895<=code&&code<=0xb8af){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xb8b1){// Lo HANGUL SYLLABLE ROE +if(0xb8b0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb8cc){// Lo [27] HANGUL SYLLABLE ROEG..HANGUL SYLLABLE ROEH +if(0xb8b1<=code&&code<=0xb8cb){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE RYO +if(0xb8cc===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xb904){if(code<0xb8e8){// Lo [27] HANGUL SYLLABLE RYOG..HANGUL SYLLABLE RYOH +if(0xb8cd<=code&&code<=0xb8e7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb8e9){// Lo HANGUL SYLLABLE RU +if(0xb8e8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE RUG..HANGUL SYLLABLE RUH +if(0xb8e9<=code&&code<=0xb903){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xb905){// Lo HANGUL SYLLABLE RWEO +if(0xb904===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb920){// Lo [27] HANGUL SYLLABLE RWEOG..HANGUL SYLLABLE RWEOH +if(0xb905<=code&&code<=0xb91f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE RWE +if(0xb920===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}}else{if(code<0xb9c8){if(code<0xb974){if(code<0xb93d){if(code<0xb93c){// Lo [27] HANGUL SYLLABLE RWEG..HANGUL SYLLABLE RWEH +if(0xb921<=code&&code<=0xb93b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE RWI +if(0xb93c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xb958){// Lo [27] HANGUL SYLLABLE RWIG..HANGUL SYLLABLE RWIH +if(0xb93d<=code&&code<=0xb957){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb959){// Lo HANGUL SYLLABLE RYU +if(0xb958===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE RYUG..HANGUL SYLLABLE RYUH +if(0xb959<=code&&code<=0xb973){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xb991){if(code<0xb975){// Lo HANGUL SYLLABLE REU +if(0xb974===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xb990){// Lo [27] HANGUL SYLLABLE REUG..HANGUL SYLLABLE REUH +if(0xb975<=code&&code<=0xb98f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE RYI +if(0xb990===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xb9ac){// Lo [27] HANGUL SYLLABLE RYIG..HANGUL SYLLABLE RYIH +if(0xb991<=code&&code<=0xb9ab){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xb9ad){// Lo HANGUL SYLLABLE RI +if(0xb9ac===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE RIG..HANGUL SYLLABLE RIH +if(0xb9ad<=code&&code<=0xb9c7){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}else{if(code<0xba01){if(code<0xb9e4){if(code<0xb9c9){// Lo HANGUL SYLLABLE MA +if(0xb9c8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE MAG..HANGUL SYLLABLE MAH +if(0xb9c9<=code&&code<=0xb9e3){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xb9e5){// Lo HANGUL SYLLABLE MAE +if(0xb9e4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xba00){// Lo [27] HANGUL SYLLABLE MAEG..HANGUL SYLLABLE MAEH +if(0xb9e5<=code&&code<=0xb9ff){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE MYA +if(0xba00===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xba38){if(code<0xba1c){// Lo [27] HANGUL SYLLABLE MYAG..HANGUL SYLLABLE MYAH +if(0xba01<=code&&code<=0xba1b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xba1d){// Lo HANGUL SYLLABLE MYAE +if(0xba1c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE MYAEG..HANGUL SYLLABLE MYAEH +if(0xba1d<=code&&code<=0xba37){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xba39){// Lo HANGUL SYLLABLE MEO +if(0xba38===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xba54){// Lo [27] HANGUL SYLLABLE MEOG..HANGUL SYLLABLE MEOH +if(0xba39<=code&&code<=0xba53){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE ME +if(0xba54===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}}}}else{if(code<0xbcbc){if(code<0xbb88){if(code<0xbae1){if(code<0xbaa8){if(code<0xba71){if(code<0xba70){// Lo [27] HANGUL SYLLABLE MEG..HANGUL SYLLABLE MEH +if(0xba55<=code&&code<=0xba6f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE MYEO +if(0xba70===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xba8c){// Lo [27] HANGUL SYLLABLE MYEOG..HANGUL SYLLABLE MYEOH +if(0xba71<=code&&code<=0xba8b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xba8d){// Lo HANGUL SYLLABLE MYE +if(0xba8c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE MYEG..HANGUL SYLLABLE MYEH +if(0xba8d<=code&&code<=0xbaa7){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xbac4){if(code<0xbaa9){// Lo HANGUL SYLLABLE MO +if(0xbaa8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE MOG..HANGUL SYLLABLE MOH +if(0xbaa9<=code&&code<=0xbac3){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xbac5){// Lo HANGUL SYLLABLE MWA +if(0xbac4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xbae0){// Lo [27] HANGUL SYLLABLE MWAG..HANGUL SYLLABLE MWAH +if(0xbac5<=code&&code<=0xbadf){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE MWAE +if(0xbae0===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}else{if(code<0xbb34){if(code<0xbafd){if(code<0xbafc){// Lo [27] HANGUL SYLLABLE MWAEG..HANGUL SYLLABLE MWAEH +if(0xbae1<=code&&code<=0xbafb){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE MOE +if(0xbafc===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xbb18){// Lo [27] HANGUL SYLLABLE MOEG..HANGUL SYLLABLE MOEH +if(0xbafd<=code&&code<=0xbb17){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xbb19){// Lo HANGUL SYLLABLE MYO +if(0xbb18===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE MYOG..HANGUL SYLLABLE MYOH +if(0xbb19<=code&&code<=0xbb33){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xbb51){if(code<0xbb35){// Lo HANGUL SYLLABLE MU +if(0xbb34===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xbb50){// Lo [27] HANGUL SYLLABLE MUG..HANGUL SYLLABLE MUH +if(0xbb35<=code&&code<=0xbb4f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE MWEO +if(0xbb50===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xbb6c){// Lo [27] HANGUL SYLLABLE MWEOG..HANGUL SYLLABLE MWEOH +if(0xbb51<=code&&code<=0xbb6b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xbb6d){// Lo HANGUL SYLLABLE MWE +if(0xbb6c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE MWEG..HANGUL SYLLABLE MWEH +if(0xbb6d<=code&&code<=0xbb87){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}}else{if(code<0xbc15){if(code<0xbbc1){if(code<0xbba4){if(code<0xbb89){// Lo HANGUL SYLLABLE MWI +if(0xbb88===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE MWIG..HANGUL SYLLABLE MWIH +if(0xbb89<=code&&code<=0xbba3){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xbba5){// Lo HANGUL SYLLABLE MYU +if(0xbba4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xbbc0){// Lo [27] HANGUL SYLLABLE MYUG..HANGUL SYLLABLE MYUH +if(0xbba5<=code&&code<=0xbbbf){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE MEU +if(0xbbc0===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xbbf8){if(code<0xbbdc){// Lo [27] HANGUL SYLLABLE MEUG..HANGUL SYLLABLE MEUH +if(0xbbc1<=code&&code<=0xbbdb){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xbbdd){// Lo HANGUL SYLLABLE MYI +if(0xbbdc===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE MYIG..HANGUL SYLLABLE MYIH +if(0xbbdd<=code&&code<=0xbbf7){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xbbf9){// Lo HANGUL SYLLABLE MI +if(0xbbf8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xbc14){// Lo [27] HANGUL SYLLABLE MIG..HANGUL SYLLABLE MIH +if(0xbbf9<=code&&code<=0xbc13){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE BA +if(0xbc14===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}else{if(code<0xbc68){if(code<0xbc31){if(code<0xbc30){// Lo [27] HANGUL SYLLABLE BAG..HANGUL SYLLABLE BAH +if(0xbc15<=code&&code<=0xbc2f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE BAE +if(0xbc30===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xbc4c){// Lo [27] HANGUL SYLLABLE BAEG..HANGUL SYLLABLE BAEH +if(0xbc31<=code&&code<=0xbc4b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xbc4d){// Lo HANGUL SYLLABLE BYA +if(0xbc4c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE BYAG..HANGUL SYLLABLE BYAH +if(0xbc4d<=code&&code<=0xbc67){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xbc85){if(code<0xbc69){// Lo HANGUL SYLLABLE BYAE +if(0xbc68===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xbc84){// Lo [27] HANGUL SYLLABLE BYAEG..HANGUL SYLLABLE BYAEH +if(0xbc69<=code&&code<=0xbc83){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE BEO +if(0xbc84===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xbca0){// Lo [27] HANGUL SYLLABLE BEOG..HANGUL SYLLABLE BEOH +if(0xbc85<=code&&code<=0xbc9f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xbca1){// Lo HANGUL SYLLABLE BE +if(0xbca0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE BEG..HANGUL SYLLABLE BEH +if(0xbca1<=code&&code<=0xbcbb){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}}}else{if(code<0xbdd5){if(code<0xbd48){if(code<0xbcf5){if(code<0xbcd8){if(code<0xbcbd){// Lo HANGUL SYLLABLE BYEO +if(0xbcbc===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE BYEOG..HANGUL SYLLABLE BYEOH +if(0xbcbd<=code&&code<=0xbcd7){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xbcd9){// Lo HANGUL SYLLABLE BYE +if(0xbcd8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xbcf4){// Lo [27] HANGUL SYLLABLE BYEG..HANGUL SYLLABLE BYEH +if(0xbcd9<=code&&code<=0xbcf3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE BO +if(0xbcf4===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xbd11){if(code<0xbd10){// Lo [27] HANGUL SYLLABLE BOG..HANGUL SYLLABLE BOH +if(0xbcf5<=code&&code<=0xbd0f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE BWA +if(0xbd10===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xbd2c){// Lo [27] HANGUL SYLLABLE BWAG..HANGUL SYLLABLE BWAH +if(0xbd11<=code&&code<=0xbd2b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xbd2d){// Lo HANGUL SYLLABLE BWAE +if(0xbd2c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE BWAEG..HANGUL SYLLABLE BWAEH +if(0xbd2d<=code&&code<=0xbd47){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}else{if(code<0xbd81){if(code<0xbd64){if(code<0xbd49){// Lo HANGUL SYLLABLE BOE +if(0xbd48===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE BOEG..HANGUL SYLLABLE BOEH +if(0xbd49<=code&&code<=0xbd63){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xbd65){// Lo HANGUL SYLLABLE BYO +if(0xbd64===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xbd80){// Lo [27] HANGUL SYLLABLE BYOG..HANGUL SYLLABLE BYOH +if(0xbd65<=code&&code<=0xbd7f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE BU +if(0xbd80===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xbdb8){if(code<0xbd9c){// Lo [27] HANGUL SYLLABLE BUG..HANGUL SYLLABLE BUH +if(0xbd81<=code&&code<=0xbd9b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xbd9d){// Lo HANGUL SYLLABLE BWEO +if(0xbd9c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE BWEOG..HANGUL SYLLABLE BWEOH +if(0xbd9d<=code&&code<=0xbdb7){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xbdb9){// Lo HANGUL SYLLABLE BWE +if(0xbdb8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xbdd4){// Lo [27] HANGUL SYLLABLE BWEG..HANGUL SYLLABLE BWEH +if(0xbdb9<=code&&code<=0xbdd3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE BWI +if(0xbdd4===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}}else{if(code<0xbe7c){if(code<0xbe28){if(code<0xbdf1){if(code<0xbdf0){// Lo [27] HANGUL SYLLABLE BWIG..HANGUL SYLLABLE BWIH +if(0xbdd5<=code&&code<=0xbdef){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE BYU +if(0xbdf0===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xbe0c){// Lo [27] HANGUL SYLLABLE BYUG..HANGUL SYLLABLE BYUH +if(0xbdf1<=code&&code<=0xbe0b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xbe0d){// Lo HANGUL SYLLABLE BEU +if(0xbe0c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE BEUG..HANGUL SYLLABLE BEUH +if(0xbe0d<=code&&code<=0xbe27){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xbe45){if(code<0xbe29){// Lo HANGUL SYLLABLE BYI +if(0xbe28===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xbe44){// Lo [27] HANGUL SYLLABLE BYIG..HANGUL SYLLABLE BYIH +if(0xbe29<=code&&code<=0xbe43){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE BI +if(0xbe44===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xbe60){// Lo [27] HANGUL SYLLABLE BIG..HANGUL SYLLABLE BIH +if(0xbe45<=code&&code<=0xbe5f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xbe61){// Lo HANGUL SYLLABLE BBA +if(0xbe60===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE BBAG..HANGUL SYLLABLE BBAH +if(0xbe61<=code&&code<=0xbe7b){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}else{if(code<0xbeb5){if(code<0xbe98){if(code<0xbe7d){// Lo HANGUL SYLLABLE BBAE +if(0xbe7c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE BBAEG..HANGUL SYLLABLE BBAEH +if(0xbe7d<=code&&code<=0xbe97){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xbe99){// Lo HANGUL SYLLABLE BBYA +if(0xbe98===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xbeb4){// Lo [27] HANGUL SYLLABLE BBYAG..HANGUL SYLLABLE BBYAH +if(0xbe99<=code&&code<=0xbeb3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE BBYAE +if(0xbeb4===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xbeec){if(code<0xbed0){// Lo [27] HANGUL SYLLABLE BBYAEG..HANGUL SYLLABLE BBYAEH +if(0xbeb5<=code&&code<=0xbecf){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xbed1){// Lo HANGUL SYLLABLE BBEO +if(0xbed0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE BBEOG..HANGUL SYLLABLE BBEOH +if(0xbed1<=code&&code<=0xbeeb){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xbeed){// Lo HANGUL SYLLABLE BBE +if(0xbeec===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xbf08){// Lo [27] HANGUL SYLLABLE BBEG..HANGUL SYLLABLE BBEH +if(0xbeed<=code&&code<=0xbf07){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE BBYEO +if(0xbf08===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}}}}}}}else{if(code<0xd1d8){if(code<0xc870){if(code<0xc3bc){if(code<0xc155){if(code<0xc03c){if(code<0xbf95){if(code<0xbf5c){if(code<0xbf25){if(code<0xbf24){// Lo [27] HANGUL SYLLABLE BBYEOG..HANGUL SYLLABLE BBYEOH +if(0xbf09<=code&&code<=0xbf23){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE BBYE +if(0xbf24===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xbf40){// Lo [27] HANGUL SYLLABLE BBYEG..HANGUL SYLLABLE BBYEH +if(0xbf25<=code&&code<=0xbf3f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xbf41){// Lo HANGUL SYLLABLE BBO +if(0xbf40===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE BBOG..HANGUL SYLLABLE BBOH +if(0xbf41<=code&&code<=0xbf5b){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xbf78){if(code<0xbf5d){// Lo HANGUL SYLLABLE BBWA +if(0xbf5c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE BBWAG..HANGUL SYLLABLE BBWAH +if(0xbf5d<=code&&code<=0xbf77){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xbf79){// Lo HANGUL SYLLABLE BBWAE +if(0xbf78===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xbf94){// Lo [27] HANGUL SYLLABLE BBWAEG..HANGUL SYLLABLE BBWAEH +if(0xbf79<=code&&code<=0xbf93){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE BBOE +if(0xbf94===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}else{if(code<0xbfe8){if(code<0xbfb1){if(code<0xbfb0){// Lo [27] HANGUL SYLLABLE BBOEG..HANGUL SYLLABLE BBOEH +if(0xbf95<=code&&code<=0xbfaf){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE BBYO +if(0xbfb0===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xbfcc){// Lo [27] HANGUL SYLLABLE BBYOG..HANGUL SYLLABLE BBYOH +if(0xbfb1<=code&&code<=0xbfcb){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xbfcd){// Lo HANGUL SYLLABLE BBU +if(0xbfcc===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE BBUG..HANGUL SYLLABLE BBUH +if(0xbfcd<=code&&code<=0xbfe7){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xc005){if(code<0xbfe9){// Lo HANGUL SYLLABLE BBWEO +if(0xbfe8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc004){// Lo [27] HANGUL SYLLABLE BBWEOG..HANGUL SYLLABLE BBWEOH +if(0xbfe9<=code&&code<=0xc003){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE BBWE +if(0xc004===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xc020){// Lo [27] HANGUL SYLLABLE BBWEG..HANGUL SYLLABLE BBWEH +if(0xc005<=code&&code<=0xc01f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc021){// Lo HANGUL SYLLABLE BBWI +if(0xc020===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE BBWIG..HANGUL SYLLABLE BBWIH +if(0xc021<=code&&code<=0xc03b){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}}else{if(code<0xc0c8){if(code<0xc075){if(code<0xc058){if(code<0xc03d){// Lo HANGUL SYLLABLE BBYU +if(0xc03c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE BBYUG..HANGUL SYLLABLE BBYUH +if(0xc03d<=code&&code<=0xc057){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xc059){// Lo HANGUL SYLLABLE BBEU +if(0xc058===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc074){// Lo [27] HANGUL SYLLABLE BBEUG..HANGUL SYLLABLE BBEUH +if(0xc059<=code&&code<=0xc073){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE BBYI +if(0xc074===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xc091){if(code<0xc090){// Lo [27] HANGUL SYLLABLE BBYIG..HANGUL SYLLABLE BBYIH +if(0xc075<=code&&code<=0xc08f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE BBI +if(0xc090===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xc0ac){// Lo [27] HANGUL SYLLABLE BBIG..HANGUL SYLLABLE BBIH +if(0xc091<=code&&code<=0xc0ab){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc0ad){// Lo HANGUL SYLLABLE SA +if(0xc0ac===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE SAG..HANGUL SYLLABLE SAH +if(0xc0ad<=code&&code<=0xc0c7){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}else{if(code<0xc101){if(code<0xc0e4){if(code<0xc0c9){// Lo HANGUL SYLLABLE SAE +if(0xc0c8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE SAEG..HANGUL SYLLABLE SAEH +if(0xc0c9<=code&&code<=0xc0e3){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xc0e5){// Lo HANGUL SYLLABLE SYA +if(0xc0e4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc100){// Lo [27] HANGUL SYLLABLE SYAG..HANGUL SYLLABLE SYAH +if(0xc0e5<=code&&code<=0xc0ff){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE SYAE +if(0xc100===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xc138){if(code<0xc11c){// Lo [27] HANGUL SYLLABLE SYAEG..HANGUL SYLLABLE SYAEH +if(0xc101<=code&&code<=0xc11b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc11d){// Lo HANGUL SYLLABLE SEO +if(0xc11c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE SEOG..HANGUL SYLLABLE SEOH +if(0xc11d<=code&&code<=0xc137){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xc139){// Lo HANGUL SYLLABLE SE +if(0xc138===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc154){// Lo [27] HANGUL SYLLABLE SEG..HANGUL SYLLABLE SEH +if(0xc139<=code&&code<=0xc153){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE SYEO +if(0xc154===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}}}else{if(code<0xc288){if(code<0xc1e1){if(code<0xc1a8){if(code<0xc171){if(code<0xc170){// Lo [27] HANGUL SYLLABLE SYEOG..HANGUL SYLLABLE SYEOH +if(0xc155<=code&&code<=0xc16f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE SYE +if(0xc170===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xc18c){// Lo [27] HANGUL SYLLABLE SYEG..HANGUL SYLLABLE SYEH +if(0xc171<=code&&code<=0xc18b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc18d){// Lo HANGUL SYLLABLE SO +if(0xc18c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE SOG..HANGUL SYLLABLE SOH +if(0xc18d<=code&&code<=0xc1a7){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xc1c4){if(code<0xc1a9){// Lo HANGUL SYLLABLE SWA +if(0xc1a8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE SWAG..HANGUL SYLLABLE SWAH +if(0xc1a9<=code&&code<=0xc1c3){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xc1c5){// Lo HANGUL SYLLABLE SWAE +if(0xc1c4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc1e0){// Lo [27] HANGUL SYLLABLE SWAEG..HANGUL SYLLABLE SWAEH +if(0xc1c5<=code&&code<=0xc1df){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE SOE +if(0xc1e0===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}else{if(code<0xc234){if(code<0xc1fd){if(code<0xc1fc){// Lo [27] HANGUL SYLLABLE SOEG..HANGUL SYLLABLE SOEH +if(0xc1e1<=code&&code<=0xc1fb){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE SYO +if(0xc1fc===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xc218){// Lo [27] HANGUL SYLLABLE SYOG..HANGUL SYLLABLE SYOH +if(0xc1fd<=code&&code<=0xc217){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc219){// Lo HANGUL SYLLABLE SU +if(0xc218===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE SUG..HANGUL SYLLABLE SUH +if(0xc219<=code&&code<=0xc233){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xc251){if(code<0xc235){// Lo HANGUL SYLLABLE SWEO +if(0xc234===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc250){// Lo [27] HANGUL SYLLABLE SWEOG..HANGUL SYLLABLE SWEOH +if(0xc235<=code&&code<=0xc24f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE SWE +if(0xc250===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xc26c){// Lo [27] HANGUL SYLLABLE SWEG..HANGUL SYLLABLE SWEH +if(0xc251<=code&&code<=0xc26b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc26d){// Lo HANGUL SYLLABLE SWI +if(0xc26c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE SWIG..HANGUL SYLLABLE SWIH +if(0xc26d<=code&&code<=0xc287){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}}else{if(code<0xc315){if(code<0xc2c1){if(code<0xc2a4){if(code<0xc289){// Lo HANGUL SYLLABLE SYU +if(0xc288===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE SYUG..HANGUL SYLLABLE SYUH +if(0xc289<=code&&code<=0xc2a3){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xc2a5){// Lo HANGUL SYLLABLE SEU +if(0xc2a4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc2c0){// Lo [27] HANGUL SYLLABLE SEUG..HANGUL SYLLABLE SEUH +if(0xc2a5<=code&&code<=0xc2bf){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE SYI +if(0xc2c0===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xc2f8){if(code<0xc2dc){// Lo [27] HANGUL SYLLABLE SYIG..HANGUL SYLLABLE SYIH +if(0xc2c1<=code&&code<=0xc2db){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc2dd){// Lo HANGUL SYLLABLE SI +if(0xc2dc===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE SIG..HANGUL SYLLABLE SIH +if(0xc2dd<=code&&code<=0xc2f7){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xc2f9){// Lo HANGUL SYLLABLE SSA +if(0xc2f8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc314){// Lo [27] HANGUL SYLLABLE SSAG..HANGUL SYLLABLE SSAH +if(0xc2f9<=code&&code<=0xc313){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE SSAE +if(0xc314===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}else{if(code<0xc368){if(code<0xc331){if(code<0xc330){// Lo [27] HANGUL SYLLABLE SSAEG..HANGUL SYLLABLE SSAEH +if(0xc315<=code&&code<=0xc32f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE SSYA +if(0xc330===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xc34c){// Lo [27] HANGUL SYLLABLE SSYAG..HANGUL SYLLABLE SSYAH +if(0xc331<=code&&code<=0xc34b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc34d){// Lo HANGUL SYLLABLE SSYAE +if(0xc34c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE SSYAEG..HANGUL SYLLABLE SSYAEH +if(0xc34d<=code&&code<=0xc367){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xc385){if(code<0xc369){// Lo HANGUL SYLLABLE SSEO +if(0xc368===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc384){// Lo [27] HANGUL SYLLABLE SSEOG..HANGUL SYLLABLE SSEOH +if(0xc369<=code&&code<=0xc383){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE SSE +if(0xc384===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xc3a0){// Lo [27] HANGUL SYLLABLE SSEG..HANGUL SYLLABLE SSEH +if(0xc385<=code&&code<=0xc39f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc3a1){// Lo HANGUL SYLLABLE SSYEO +if(0xc3a0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE SSYEOG..HANGUL SYLLABLE SSYEOH +if(0xc3a1<=code&&code<=0xc3bb){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}}}}else{if(code<0xc609){if(code<0xc4d5){if(code<0xc448){if(code<0xc3f5){if(code<0xc3d8){if(code<0xc3bd){// Lo HANGUL SYLLABLE SSYE +if(0xc3bc===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE SSYEG..HANGUL SYLLABLE SSYEH +if(0xc3bd<=code&&code<=0xc3d7){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xc3d9){// Lo HANGUL SYLLABLE SSO +if(0xc3d8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc3f4){// Lo [27] HANGUL SYLLABLE SSOG..HANGUL SYLLABLE SSOH +if(0xc3d9<=code&&code<=0xc3f3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE SSWA +if(0xc3f4===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xc411){if(code<0xc410){// Lo [27] HANGUL SYLLABLE SSWAG..HANGUL SYLLABLE SSWAH +if(0xc3f5<=code&&code<=0xc40f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE SSWAE +if(0xc410===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xc42c){// Lo [27] HANGUL SYLLABLE SSWAEG..HANGUL SYLLABLE SSWAEH +if(0xc411<=code&&code<=0xc42b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc42d){// Lo HANGUL SYLLABLE SSOE +if(0xc42c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE SSOEG..HANGUL SYLLABLE SSOEH +if(0xc42d<=code&&code<=0xc447){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}else{if(code<0xc481){if(code<0xc464){if(code<0xc449){// Lo HANGUL SYLLABLE SSYO +if(0xc448===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE SSYOG..HANGUL SYLLABLE SSYOH +if(0xc449<=code&&code<=0xc463){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xc465){// Lo HANGUL SYLLABLE SSU +if(0xc464===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc480){// Lo [27] HANGUL SYLLABLE SSUG..HANGUL SYLLABLE SSUH +if(0xc465<=code&&code<=0xc47f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE SSWEO +if(0xc480===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xc4b8){if(code<0xc49c){// Lo [27] HANGUL SYLLABLE SSWEOG..HANGUL SYLLABLE SSWEOH +if(0xc481<=code&&code<=0xc49b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc49d){// Lo HANGUL SYLLABLE SSWE +if(0xc49c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE SSWEG..HANGUL SYLLABLE SSWEH +if(0xc49d<=code&&code<=0xc4b7){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xc4b9){// Lo HANGUL SYLLABLE SSWI +if(0xc4b8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc4d4){// Lo [27] HANGUL SYLLABLE SSWIG..HANGUL SYLLABLE SSWIH +if(0xc4b9<=code&&code<=0xc4d3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE SSYU +if(0xc4d4===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}}else{if(code<0xc57c){if(code<0xc528){if(code<0xc4f1){if(code<0xc4f0){// Lo [27] HANGUL SYLLABLE SSYUG..HANGUL SYLLABLE SSYUH +if(0xc4d5<=code&&code<=0xc4ef){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE SSEU +if(0xc4f0===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xc50c){// Lo [27] HANGUL SYLLABLE SSEUG..HANGUL SYLLABLE SSEUH +if(0xc4f1<=code&&code<=0xc50b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc50d){// Lo HANGUL SYLLABLE SSYI +if(0xc50c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE SSYIG..HANGUL SYLLABLE SSYIH +if(0xc50d<=code&&code<=0xc527){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xc545){if(code<0xc529){// Lo HANGUL SYLLABLE SSI +if(0xc528===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc544){// Lo [27] HANGUL SYLLABLE SSIG..HANGUL SYLLABLE SSIH +if(0xc529<=code&&code<=0xc543){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE A +if(0xc544===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xc560){// Lo [27] HANGUL SYLLABLE AG..HANGUL SYLLABLE AH +if(0xc545<=code&&code<=0xc55f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc561){// Lo HANGUL SYLLABLE AE +if(0xc560===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE AEG..HANGUL SYLLABLE AEH +if(0xc561<=code&&code<=0xc57b){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}else{if(code<0xc5b5){if(code<0xc598){if(code<0xc57d){// Lo HANGUL SYLLABLE YA +if(0xc57c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE YAG..HANGUL SYLLABLE YAH +if(0xc57d<=code&&code<=0xc597){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xc599){// Lo HANGUL SYLLABLE YAE +if(0xc598===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc5b4){// Lo [27] HANGUL SYLLABLE YAEG..HANGUL SYLLABLE YAEH +if(0xc599<=code&&code<=0xc5b3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE EO +if(0xc5b4===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xc5ec){if(code<0xc5d0){// Lo [27] HANGUL SYLLABLE EOG..HANGUL SYLLABLE EOH +if(0xc5b5<=code&&code<=0xc5cf){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc5d1){// Lo HANGUL SYLLABLE E +if(0xc5d0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE EG..HANGUL SYLLABLE EH +if(0xc5d1<=code&&code<=0xc5eb){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xc5ed){// Lo HANGUL SYLLABLE YEO +if(0xc5ec===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc608){// Lo [27] HANGUL SYLLABLE YEOG..HANGUL SYLLABLE YEOH +if(0xc5ed<=code&&code<=0xc607){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE YE +if(0xc608===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}}}else{if(code<0xc73c){if(code<0xc695){if(code<0xc65c){if(code<0xc625){if(code<0xc624){// Lo [27] HANGUL SYLLABLE YEG..HANGUL SYLLABLE YEH +if(0xc609<=code&&code<=0xc623){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE O +if(0xc624===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xc640){// Lo [27] HANGUL SYLLABLE OG..HANGUL SYLLABLE OH +if(0xc625<=code&&code<=0xc63f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc641){// Lo HANGUL SYLLABLE WA +if(0xc640===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE WAG..HANGUL SYLLABLE WAH +if(0xc641<=code&&code<=0xc65b){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xc678){if(code<0xc65d){// Lo HANGUL SYLLABLE WAE +if(0xc65c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE WAEG..HANGUL SYLLABLE WAEH +if(0xc65d<=code&&code<=0xc677){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xc679){// Lo HANGUL SYLLABLE OE +if(0xc678===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc694){// Lo [27] HANGUL SYLLABLE OEG..HANGUL SYLLABLE OEH +if(0xc679<=code&&code<=0xc693){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE YO +if(0xc694===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}else{if(code<0xc6e8){if(code<0xc6b1){if(code<0xc6b0){// Lo [27] HANGUL SYLLABLE YOG..HANGUL SYLLABLE YOH +if(0xc695<=code&&code<=0xc6af){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE U +if(0xc6b0===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xc6cc){// Lo [27] HANGUL SYLLABLE UG..HANGUL SYLLABLE UH +if(0xc6b1<=code&&code<=0xc6cb){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc6cd){// Lo HANGUL SYLLABLE WEO +if(0xc6cc===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE WEOG..HANGUL SYLLABLE WEOH +if(0xc6cd<=code&&code<=0xc6e7){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xc705){if(code<0xc6e9){// Lo HANGUL SYLLABLE WE +if(0xc6e8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc704){// Lo [27] HANGUL SYLLABLE WEG..HANGUL SYLLABLE WEH +if(0xc6e9<=code&&code<=0xc703){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE WI +if(0xc704===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xc720){// Lo [27] HANGUL SYLLABLE WIG..HANGUL SYLLABLE WIH +if(0xc705<=code&&code<=0xc71f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc721){// Lo HANGUL SYLLABLE YU +if(0xc720===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE YUG..HANGUL SYLLABLE YUH +if(0xc721<=code&&code<=0xc73b){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}}else{if(code<0xc7c9){if(code<0xc775){if(code<0xc758){if(code<0xc73d){// Lo HANGUL SYLLABLE EU +if(0xc73c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE EUG..HANGUL SYLLABLE EUH +if(0xc73d<=code&&code<=0xc757){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xc759){// Lo HANGUL SYLLABLE YI +if(0xc758===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc774){// Lo [27] HANGUL SYLLABLE YIG..HANGUL SYLLABLE YIH +if(0xc759<=code&&code<=0xc773){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE I +if(0xc774===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xc7ac){if(code<0xc790){// Lo [27] HANGUL SYLLABLE IG..HANGUL SYLLABLE IH +if(0xc775<=code&&code<=0xc78f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc791){// Lo HANGUL SYLLABLE JA +if(0xc790===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE JAG..HANGUL SYLLABLE JAH +if(0xc791<=code&&code<=0xc7ab){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xc7ad){// Lo HANGUL SYLLABLE JAE +if(0xc7ac===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc7c8){// Lo [27] HANGUL SYLLABLE JAEG..HANGUL SYLLABLE JAEH +if(0xc7ad<=code&&code<=0xc7c7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE JYA +if(0xc7c8===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}else{if(code<0xc81c){if(code<0xc7e5){if(code<0xc7e4){// Lo [27] HANGUL SYLLABLE JYAG..HANGUL SYLLABLE JYAH +if(0xc7c9<=code&&code<=0xc7e3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE JYAE +if(0xc7e4===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xc800){// Lo [27] HANGUL SYLLABLE JYAEG..HANGUL SYLLABLE JYAEH +if(0xc7e5<=code&&code<=0xc7ff){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc801){// Lo HANGUL SYLLABLE JEO +if(0xc800===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE JEOG..HANGUL SYLLABLE JEOH +if(0xc801<=code&&code<=0xc81b){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xc839){if(code<0xc81d){// Lo HANGUL SYLLABLE JE +if(0xc81c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc838){// Lo [27] HANGUL SYLLABLE JEG..HANGUL SYLLABLE JEH +if(0xc81d<=code&&code<=0xc837){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE JYEO +if(0xc838===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xc854){// Lo [27] HANGUL SYLLABLE JYEOG..HANGUL SYLLABLE JYEOH +if(0xc839<=code&&code<=0xc853){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc855){// Lo HANGUL SYLLABLE JYE +if(0xc854===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE JYEG..HANGUL SYLLABLE JYEH +if(0xc855<=code&&code<=0xc86f){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}}}}}else{if(code<0xcd24){if(code<0xcabd){if(code<0xc989){if(code<0xc8fc){if(code<0xc8a9){if(code<0xc88c){if(code<0xc871){// Lo HANGUL SYLLABLE JO +if(0xc870===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE JOG..HANGUL SYLLABLE JOH +if(0xc871<=code&&code<=0xc88b){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xc88d){// Lo HANGUL SYLLABLE JWA +if(0xc88c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc8a8){// Lo [27] HANGUL SYLLABLE JWAG..HANGUL SYLLABLE JWAH +if(0xc88d<=code&&code<=0xc8a7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE JWAE +if(0xc8a8===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xc8c5){if(code<0xc8c4){// Lo [27] HANGUL SYLLABLE JWAEG..HANGUL SYLLABLE JWAEH +if(0xc8a9<=code&&code<=0xc8c3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE JOE +if(0xc8c4===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xc8e0){// Lo [27] HANGUL SYLLABLE JOEG..HANGUL SYLLABLE JOEH +if(0xc8c5<=code&&code<=0xc8df){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc8e1){// Lo HANGUL SYLLABLE JYO +if(0xc8e0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE JYOG..HANGUL SYLLABLE JYOH +if(0xc8e1<=code&&code<=0xc8fb){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}else{if(code<0xc935){if(code<0xc918){if(code<0xc8fd){// Lo HANGUL SYLLABLE JU +if(0xc8fc===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE JUG..HANGUL SYLLABLE JUH +if(0xc8fd<=code&&code<=0xc917){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xc919){// Lo HANGUL SYLLABLE JWEO +if(0xc918===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc934){// Lo [27] HANGUL SYLLABLE JWEOG..HANGUL SYLLABLE JWEOH +if(0xc919<=code&&code<=0xc933){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE JWE +if(0xc934===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xc96c){if(code<0xc950){// Lo [27] HANGUL SYLLABLE JWEG..HANGUL SYLLABLE JWEH +if(0xc935<=code&&code<=0xc94f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc951){// Lo HANGUL SYLLABLE JWI +if(0xc950===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE JWIG..HANGUL SYLLABLE JWIH +if(0xc951<=code&&code<=0xc96b){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xc96d){// Lo HANGUL SYLLABLE JYU +if(0xc96c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc988){// Lo [27] HANGUL SYLLABLE JYUG..HANGUL SYLLABLE JYUH +if(0xc96d<=code&&code<=0xc987){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE JEU +if(0xc988===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}}else{if(code<0xca30){if(code<0xc9dc){if(code<0xc9a5){if(code<0xc9a4){// Lo [27] HANGUL SYLLABLE JEUG..HANGUL SYLLABLE JEUH +if(0xc989<=code&&code<=0xc9a3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE JYI +if(0xc9a4===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xc9c0){// Lo [27] HANGUL SYLLABLE JYIG..HANGUL SYLLABLE JYIH +if(0xc9a5<=code&&code<=0xc9bf){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xc9c1){// Lo HANGUL SYLLABLE JI +if(0xc9c0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE JIG..HANGUL SYLLABLE JIH +if(0xc9c1<=code&&code<=0xc9db){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xc9f9){if(code<0xc9dd){// Lo HANGUL SYLLABLE JJA +if(0xc9dc===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xc9f8){// Lo [27] HANGUL SYLLABLE JJAG..HANGUL SYLLABLE JJAH +if(0xc9dd<=code&&code<=0xc9f7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE JJAE +if(0xc9f8===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xca14){// Lo [27] HANGUL SYLLABLE JJAEG..HANGUL SYLLABLE JJAEH +if(0xc9f9<=code&&code<=0xca13){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xca15){// Lo HANGUL SYLLABLE JJYA +if(0xca14===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE JJYAG..HANGUL SYLLABLE JJYAH +if(0xca15<=code&&code<=0xca2f){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}else{if(code<0xca69){if(code<0xca4c){if(code<0xca31){// Lo HANGUL SYLLABLE JJYAE +if(0xca30===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE JJYAEG..HANGUL SYLLABLE JJYAEH +if(0xca31<=code&&code<=0xca4b){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xca4d){// Lo HANGUL SYLLABLE JJEO +if(0xca4c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xca68){// Lo [27] HANGUL SYLLABLE JJEOG..HANGUL SYLLABLE JJEOH +if(0xca4d<=code&&code<=0xca67){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE JJE +if(0xca68===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xcaa0){if(code<0xca84){// Lo [27] HANGUL SYLLABLE JJEG..HANGUL SYLLABLE JJEH +if(0xca69<=code&&code<=0xca83){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xca85){// Lo HANGUL SYLLABLE JJYEO +if(0xca84===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE JJYEOG..HANGUL SYLLABLE JJYEOH +if(0xca85<=code&&code<=0xca9f){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xcaa1){// Lo HANGUL SYLLABLE JJYE +if(0xcaa0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xcabc){// Lo [27] HANGUL SYLLABLE JJYEG..HANGUL SYLLABLE JJYEH +if(0xcaa1<=code&&code<=0xcabb){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE JJO +if(0xcabc===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}}}else{if(code<0xcbf0){if(code<0xcb49){if(code<0xcb10){if(code<0xcad9){if(code<0xcad8){// Lo [27] HANGUL SYLLABLE JJOG..HANGUL SYLLABLE JJOH +if(0xcabd<=code&&code<=0xcad7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE JJWA +if(0xcad8===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xcaf4){// Lo [27] HANGUL SYLLABLE JJWAG..HANGUL SYLLABLE JJWAH +if(0xcad9<=code&&code<=0xcaf3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xcaf5){// Lo HANGUL SYLLABLE JJWAE +if(0xcaf4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE JJWAEG..HANGUL SYLLABLE JJWAEH +if(0xcaf5<=code&&code<=0xcb0f){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xcb2c){if(code<0xcb11){// Lo HANGUL SYLLABLE JJOE +if(0xcb10===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE JJOEG..HANGUL SYLLABLE JJOEH +if(0xcb11<=code&&code<=0xcb2b){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xcb2d){// Lo HANGUL SYLLABLE JJYO +if(0xcb2c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xcb48){// Lo [27] HANGUL SYLLABLE JJYOG..HANGUL SYLLABLE JJYOH +if(0xcb2d<=code&&code<=0xcb47){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE JJU +if(0xcb48===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}else{if(code<0xcb9c){if(code<0xcb65){if(code<0xcb64){// Lo [27] HANGUL SYLLABLE JJUG..HANGUL SYLLABLE JJUH +if(0xcb49<=code&&code<=0xcb63){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE JJWEO +if(0xcb64===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xcb80){// Lo [27] HANGUL SYLLABLE JJWEOG..HANGUL SYLLABLE JJWEOH +if(0xcb65<=code&&code<=0xcb7f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xcb81){// Lo HANGUL SYLLABLE JJWE +if(0xcb80===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE JJWEG..HANGUL SYLLABLE JJWEH +if(0xcb81<=code&&code<=0xcb9b){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xcbb9){if(code<0xcb9d){// Lo HANGUL SYLLABLE JJWI +if(0xcb9c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xcbb8){// Lo [27] HANGUL SYLLABLE JJWIG..HANGUL SYLLABLE JJWIH +if(0xcb9d<=code&&code<=0xcbb7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE JJYU +if(0xcbb8===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xcbd4){// Lo [27] HANGUL SYLLABLE JJYUG..HANGUL SYLLABLE JJYUH +if(0xcbb9<=code&&code<=0xcbd3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xcbd5){// Lo HANGUL SYLLABLE JJEU +if(0xcbd4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE JJEUG..HANGUL SYLLABLE JJEUH +if(0xcbd5<=code&&code<=0xcbef){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}}else{if(code<0xcc7d){if(code<0xcc29){if(code<0xcc0c){if(code<0xcbf1){// Lo HANGUL SYLLABLE JJYI +if(0xcbf0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE JJYIG..HANGUL SYLLABLE JJYIH +if(0xcbf1<=code&&code<=0xcc0b){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xcc0d){// Lo HANGUL SYLLABLE JJI +if(0xcc0c===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xcc28){// Lo [27] HANGUL SYLLABLE JJIG..HANGUL SYLLABLE JJIH +if(0xcc0d<=code&&code<=0xcc27){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE CA +if(0xcc28===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xcc60){if(code<0xcc44){// Lo [27] HANGUL SYLLABLE CAG..HANGUL SYLLABLE CAH +if(0xcc29<=code&&code<=0xcc43){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xcc45){// Lo HANGUL SYLLABLE CAE +if(0xcc44===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE CAEG..HANGUL SYLLABLE CAEH +if(0xcc45<=code&&code<=0xcc5f){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xcc61){// Lo HANGUL SYLLABLE CYA +if(0xcc60===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xcc7c){// Lo [27] HANGUL SYLLABLE CYAG..HANGUL SYLLABLE CYAH +if(0xcc61<=code&&code<=0xcc7b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE CYAE +if(0xcc7c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}else{if(code<0xccd0){if(code<0xcc99){if(code<0xcc98){// Lo [27] HANGUL SYLLABLE CYAEG..HANGUL SYLLABLE CYAEH +if(0xcc7d<=code&&code<=0xcc97){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE CEO +if(0xcc98===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xccb4){// Lo [27] HANGUL SYLLABLE CEOG..HANGUL SYLLABLE CEOH +if(0xcc99<=code&&code<=0xccb3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xccb5){// Lo HANGUL SYLLABLE CE +if(0xccb4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE CEG..HANGUL SYLLABLE CEH +if(0xccb5<=code&&code<=0xcccf){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xcced){if(code<0xccd1){// Lo HANGUL SYLLABLE CYEO +if(0xccd0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xccec){// Lo [27] HANGUL SYLLABLE CYEOG..HANGUL SYLLABLE CYEOH +if(0xccd1<=code&&code<=0xcceb){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE CYE +if(0xccec===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xcd08){// Lo [27] HANGUL SYLLABLE CYEG..HANGUL SYLLABLE CYEH +if(0xcced<=code&&code<=0xcd07){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xcd09){// Lo HANGUL SYLLABLE CO +if(0xcd08===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE COG..HANGUL SYLLABLE COH +if(0xcd09<=code&&code<=0xcd23){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}}}}else{if(code<0xcf71){if(code<0xce3d){if(code<0xcdb0){if(code<0xcd5d){if(code<0xcd40){if(code<0xcd25){// Lo HANGUL SYLLABLE CWA +if(0xcd24===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE CWAG..HANGUL SYLLABLE CWAH +if(0xcd25<=code&&code<=0xcd3f){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xcd41){// Lo HANGUL SYLLABLE CWAE +if(0xcd40===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xcd5c){// Lo [27] HANGUL SYLLABLE CWAEG..HANGUL SYLLABLE CWAEH +if(0xcd41<=code&&code<=0xcd5b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE COE +if(0xcd5c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xcd79){if(code<0xcd78){// Lo [27] HANGUL SYLLABLE COEG..HANGUL SYLLABLE COEH +if(0xcd5d<=code&&code<=0xcd77){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE CYO +if(0xcd78===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xcd94){// Lo [27] HANGUL SYLLABLE CYOG..HANGUL SYLLABLE CYOH +if(0xcd79<=code&&code<=0xcd93){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xcd95){// Lo HANGUL SYLLABLE CU +if(0xcd94===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE CUG..HANGUL SYLLABLE CUH +if(0xcd95<=code&&code<=0xcdaf){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}else{if(code<0xcde9){if(code<0xcdcc){if(code<0xcdb1){// Lo HANGUL SYLLABLE CWEO +if(0xcdb0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE CWEOG..HANGUL SYLLABLE CWEOH +if(0xcdb1<=code&&code<=0xcdcb){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xcdcd){// Lo HANGUL SYLLABLE CWE +if(0xcdcc===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xcde8){// Lo [27] HANGUL SYLLABLE CWEG..HANGUL SYLLABLE CWEH +if(0xcdcd<=code&&code<=0xcde7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE CWI +if(0xcde8===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xce20){if(code<0xce04){// Lo [27] HANGUL SYLLABLE CWIG..HANGUL SYLLABLE CWIH +if(0xcde9<=code&&code<=0xce03){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xce05){// Lo HANGUL SYLLABLE CYU +if(0xce04===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE CYUG..HANGUL SYLLABLE CYUH +if(0xce05<=code&&code<=0xce1f){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xce21){// Lo HANGUL SYLLABLE CEU +if(0xce20===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xce3c){// Lo [27] HANGUL SYLLABLE CEUG..HANGUL SYLLABLE CEUH +if(0xce21<=code&&code<=0xce3b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE CYI +if(0xce3c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}}else{if(code<0xcee4){if(code<0xce90){if(code<0xce59){if(code<0xce58){// Lo [27] HANGUL SYLLABLE CYIG..HANGUL SYLLABLE CYIH +if(0xce3d<=code&&code<=0xce57){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE CI +if(0xce58===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xce74){// Lo [27] HANGUL SYLLABLE CIG..HANGUL SYLLABLE CIH +if(0xce59<=code&&code<=0xce73){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xce75){// Lo HANGUL SYLLABLE KA +if(0xce74===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE KAG..HANGUL SYLLABLE KAH +if(0xce75<=code&&code<=0xce8f){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xcead){if(code<0xce91){// Lo HANGUL SYLLABLE KAE +if(0xce90===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xceac){// Lo [27] HANGUL SYLLABLE KAEG..HANGUL SYLLABLE KAEH +if(0xce91<=code&&code<=0xceab){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE KYA +if(0xceac===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xcec8){// Lo [27] HANGUL SYLLABLE KYAG..HANGUL SYLLABLE KYAH +if(0xcead<=code&&code<=0xcec7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xcec9){// Lo HANGUL SYLLABLE KYAE +if(0xcec8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE KYAEG..HANGUL SYLLABLE KYAEH +if(0xcec9<=code&&code<=0xcee3){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}else{if(code<0xcf1d){if(code<0xcf00){if(code<0xcee5){// Lo HANGUL SYLLABLE KEO +if(0xcee4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE KEOG..HANGUL SYLLABLE KEOH +if(0xcee5<=code&&code<=0xceff){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xcf01){// Lo HANGUL SYLLABLE KE +if(0xcf00===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xcf1c){// Lo [27] HANGUL SYLLABLE KEG..HANGUL SYLLABLE KEH +if(0xcf01<=code&&code<=0xcf1b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE KYEO +if(0xcf1c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xcf54){if(code<0xcf38){// Lo [27] HANGUL SYLLABLE KYEOG..HANGUL SYLLABLE KYEOH +if(0xcf1d<=code&&code<=0xcf37){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xcf39){// Lo HANGUL SYLLABLE KYE +if(0xcf38===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE KYEG..HANGUL SYLLABLE KYEH +if(0xcf39<=code&&code<=0xcf53){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xcf55){// Lo HANGUL SYLLABLE KO +if(0xcf54===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xcf70){// Lo [27] HANGUL SYLLABLE KOG..HANGUL SYLLABLE KOH +if(0xcf55<=code&&code<=0xcf6f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE KWA +if(0xcf70===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}}}else{if(code<0xd0a4){if(code<0xcffd){if(code<0xcfc4){if(code<0xcf8d){if(code<0xcf8c){// Lo [27] HANGUL SYLLABLE KWAG..HANGUL SYLLABLE KWAH +if(0xcf71<=code&&code<=0xcf8b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE KWAE +if(0xcf8c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xcfa8){// Lo [27] HANGUL SYLLABLE KWAEG..HANGUL SYLLABLE KWAEH +if(0xcf8d<=code&&code<=0xcfa7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xcfa9){// Lo HANGUL SYLLABLE KOE +if(0xcfa8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE KOEG..HANGUL SYLLABLE KOEH +if(0xcfa9<=code&&code<=0xcfc3){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xcfe0){if(code<0xcfc5){// Lo HANGUL SYLLABLE KYO +if(0xcfc4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE KYOG..HANGUL SYLLABLE KYOH +if(0xcfc5<=code&&code<=0xcfdf){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xcfe1){// Lo HANGUL SYLLABLE KU +if(0xcfe0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xcffc){// Lo [27] HANGUL SYLLABLE KUG..HANGUL SYLLABLE KUH +if(0xcfe1<=code&&code<=0xcffb){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE KWEO +if(0xcffc===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}else{if(code<0xd050){if(code<0xd019){if(code<0xd018){// Lo [27] HANGUL SYLLABLE KWEOG..HANGUL SYLLABLE KWEOH +if(0xcffd<=code&&code<=0xd017){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE KWE +if(0xd018===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xd034){// Lo [27] HANGUL SYLLABLE KWEG..HANGUL SYLLABLE KWEH +if(0xd019<=code&&code<=0xd033){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xd035){// Lo HANGUL SYLLABLE KWI +if(0xd034===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE KWIG..HANGUL SYLLABLE KWIH +if(0xd035<=code&&code<=0xd04f){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xd06d){if(code<0xd051){// Lo HANGUL SYLLABLE KYU +if(0xd050===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xd06c){// Lo [27] HANGUL SYLLABLE KYUG..HANGUL SYLLABLE KYUH +if(0xd051<=code&&code<=0xd06b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE KEU +if(0xd06c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xd088){// Lo [27] HANGUL SYLLABLE KEUG..HANGUL SYLLABLE KEUH +if(0xd06d<=code&&code<=0xd087){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xd089){// Lo HANGUL SYLLABLE KYI +if(0xd088===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE KYIG..HANGUL SYLLABLE KYIH +if(0xd089<=code&&code<=0xd0a3){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}}else{if(code<0xd131){if(code<0xd0dd){if(code<0xd0c0){if(code<0xd0a5){// Lo HANGUL SYLLABLE KI +if(0xd0a4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE KIG..HANGUL SYLLABLE KIH +if(0xd0a5<=code&&code<=0xd0bf){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xd0c1){// Lo HANGUL SYLLABLE TA +if(0xd0c0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xd0dc){// Lo [27] HANGUL SYLLABLE TAG..HANGUL SYLLABLE TAH +if(0xd0c1<=code&&code<=0xd0db){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE TAE +if(0xd0dc===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xd114){if(code<0xd0f8){// Lo [27] HANGUL SYLLABLE TAEG..HANGUL SYLLABLE TAEH +if(0xd0dd<=code&&code<=0xd0f7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xd0f9){// Lo HANGUL SYLLABLE TYA +if(0xd0f8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE TYAG..HANGUL SYLLABLE TYAH +if(0xd0f9<=code&&code<=0xd113){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xd115){// Lo HANGUL SYLLABLE TYAE +if(0xd114===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xd130){// Lo [27] HANGUL SYLLABLE TYAEG..HANGUL SYLLABLE TYAEH +if(0xd115<=code&&code<=0xd12f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE TEO +if(0xd130===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}else{if(code<0xd184){if(code<0xd14d){if(code<0xd14c){// Lo [27] HANGUL SYLLABLE TEOG..HANGUL SYLLABLE TEOH +if(0xd131<=code&&code<=0xd14b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE TE +if(0xd14c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xd168){// Lo [27] HANGUL SYLLABLE TEG..HANGUL SYLLABLE TEH +if(0xd14d<=code&&code<=0xd167){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xd169){// Lo HANGUL SYLLABLE TYEO +if(0xd168===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE TYEOG..HANGUL SYLLABLE TYEOH +if(0xd169<=code&&code<=0xd183){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xd1a1){if(code<0xd185){// Lo HANGUL SYLLABLE TYE +if(0xd184===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xd1a0){// Lo [27] HANGUL SYLLABLE TYEG..HANGUL SYLLABLE TYEH +if(0xd185<=code&&code<=0xd19f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE TO +if(0xd1a0===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xd1bc){// Lo [27] HANGUL SYLLABLE TOG..HANGUL SYLLABLE TOH +if(0xd1a1<=code&&code<=0xd1bb){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xd1bd){// Lo HANGUL SYLLABLE TWA +if(0xd1bc===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE TWAG..HANGUL SYLLABLE TWAH +if(0xd1bd<=code&&code<=0xd1d7){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}}}}}}else{if(code<0x1133b){if(code<0xd671){if(code<0xd424){if(code<0xd2f1){if(code<0xd264){if(code<0xd211){if(code<0xd1f4){if(code<0xd1d9){// Lo HANGUL SYLLABLE TWAE +if(0xd1d8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE TWAEG..HANGUL SYLLABLE TWAEH +if(0xd1d9<=code&&code<=0xd1f3){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xd1f5){// Lo HANGUL SYLLABLE TOE +if(0xd1f4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xd210){// Lo [27] HANGUL SYLLABLE TOEG..HANGUL SYLLABLE TOEH +if(0xd1f5<=code&&code<=0xd20f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE TYO +if(0xd210===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xd22d){if(code<0xd22c){// Lo [27] HANGUL SYLLABLE TYOG..HANGUL SYLLABLE TYOH +if(0xd211<=code&&code<=0xd22b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE TU +if(0xd22c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xd248){// Lo [27] HANGUL SYLLABLE TUG..HANGUL SYLLABLE TUH +if(0xd22d<=code&&code<=0xd247){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xd249){// Lo HANGUL SYLLABLE TWEO +if(0xd248===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE TWEOG..HANGUL SYLLABLE TWEOH +if(0xd249<=code&&code<=0xd263){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}else{if(code<0xd29d){if(code<0xd280){if(code<0xd265){// Lo HANGUL SYLLABLE TWE +if(0xd264===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE TWEG..HANGUL SYLLABLE TWEH +if(0xd265<=code&&code<=0xd27f){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xd281){// Lo HANGUL SYLLABLE TWI +if(0xd280===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xd29c){// Lo [27] HANGUL SYLLABLE TWIG..HANGUL SYLLABLE TWIH +if(0xd281<=code&&code<=0xd29b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE TYU +if(0xd29c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xd2d4){if(code<0xd2b8){// Lo [27] HANGUL SYLLABLE TYUG..HANGUL SYLLABLE TYUH +if(0xd29d<=code&&code<=0xd2b7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xd2b9){// Lo HANGUL SYLLABLE TEU +if(0xd2b8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE TEUG..HANGUL SYLLABLE TEUH +if(0xd2b9<=code&&code<=0xd2d3){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xd2d5){// Lo HANGUL SYLLABLE TYI +if(0xd2d4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xd2f0){// Lo [27] HANGUL SYLLABLE TYIG..HANGUL SYLLABLE TYIH +if(0xd2d5<=code&&code<=0xd2ef){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE TI +if(0xd2f0===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}}else{if(code<0xd37d){if(code<0xd344){if(code<0xd30d){if(code<0xd30c){// Lo [27] HANGUL SYLLABLE TIG..HANGUL SYLLABLE TIH +if(0xd2f1<=code&&code<=0xd30b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE PA +if(0xd30c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xd328){// Lo [27] HANGUL SYLLABLE PAG..HANGUL SYLLABLE PAH +if(0xd30d<=code&&code<=0xd327){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xd329){// Lo HANGUL SYLLABLE PAE +if(0xd328===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE PAEG..HANGUL SYLLABLE PAEH +if(0xd329<=code&&code<=0xd343){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xd360){if(code<0xd345){// Lo HANGUL SYLLABLE PYA +if(0xd344===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE PYAG..HANGUL SYLLABLE PYAH +if(0xd345<=code&&code<=0xd35f){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xd361){// Lo HANGUL SYLLABLE PYAE +if(0xd360===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xd37c){// Lo [27] HANGUL SYLLABLE PYAEG..HANGUL SYLLABLE PYAEH +if(0xd361<=code&&code<=0xd37b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE PEO +if(0xd37c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}else{if(code<0xd3d0){if(code<0xd399){if(code<0xd398){// Lo [27] HANGUL SYLLABLE PEOG..HANGUL SYLLABLE PEOH +if(0xd37d<=code&&code<=0xd397){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE PE +if(0xd398===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xd3b4){// Lo [27] HANGUL SYLLABLE PEG..HANGUL SYLLABLE PEH +if(0xd399<=code&&code<=0xd3b3){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xd3b5){// Lo HANGUL SYLLABLE PYEO +if(0xd3b4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE PYEOG..HANGUL SYLLABLE PYEOH +if(0xd3b5<=code&&code<=0xd3cf){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xd3ed){if(code<0xd3d1){// Lo HANGUL SYLLABLE PYE +if(0xd3d0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xd3ec){// Lo [27] HANGUL SYLLABLE PYEG..HANGUL SYLLABLE PYEH +if(0xd3d1<=code&&code<=0xd3eb){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE PO +if(0xd3ec===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xd408){// Lo [27] HANGUL SYLLABLE POG..HANGUL SYLLABLE POH +if(0xd3ed<=code&&code<=0xd407){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xd409){// Lo HANGUL SYLLABLE PWA +if(0xd408===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE PWAG..HANGUL SYLLABLE PWAH +if(0xd409<=code&&code<=0xd423){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}}}else{if(code<0xd53d){if(code<0xd4b0){if(code<0xd45d){if(code<0xd440){if(code<0xd425){// Lo HANGUL SYLLABLE PWAE +if(0xd424===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE PWAEG..HANGUL SYLLABLE PWAEH +if(0xd425<=code&&code<=0xd43f){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xd441){// Lo HANGUL SYLLABLE POE +if(0xd440===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xd45c){// Lo [27] HANGUL SYLLABLE POEG..HANGUL SYLLABLE POEH +if(0xd441<=code&&code<=0xd45b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE PYO +if(0xd45c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xd479){if(code<0xd478){// Lo [27] HANGUL SYLLABLE PYOG..HANGUL SYLLABLE PYOH +if(0xd45d<=code&&code<=0xd477){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE PU +if(0xd478===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xd494){// Lo [27] HANGUL SYLLABLE PUG..HANGUL SYLLABLE PUH +if(0xd479<=code&&code<=0xd493){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xd495){// Lo HANGUL SYLLABLE PWEO +if(0xd494===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE PWEOG..HANGUL SYLLABLE PWEOH +if(0xd495<=code&&code<=0xd4af){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}else{if(code<0xd4e9){if(code<0xd4cc){if(code<0xd4b1){// Lo HANGUL SYLLABLE PWE +if(0xd4b0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE PWEG..HANGUL SYLLABLE PWEH +if(0xd4b1<=code&&code<=0xd4cb){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xd4cd){// Lo HANGUL SYLLABLE PWI +if(0xd4cc===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xd4e8){// Lo [27] HANGUL SYLLABLE PWIG..HANGUL SYLLABLE PWIH +if(0xd4cd<=code&&code<=0xd4e7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE PYU +if(0xd4e8===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xd520){if(code<0xd504){// Lo [27] HANGUL SYLLABLE PYUG..HANGUL SYLLABLE PYUH +if(0xd4e9<=code&&code<=0xd503){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xd505){// Lo HANGUL SYLLABLE PEU +if(0xd504===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE PEUG..HANGUL SYLLABLE PEUH +if(0xd505<=code&&code<=0xd51f){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xd521){// Lo HANGUL SYLLABLE PYI +if(0xd520===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xd53c){// Lo [27] HANGUL SYLLABLE PYIG..HANGUL SYLLABLE PYIH +if(0xd521<=code&&code<=0xd53b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE PI +if(0xd53c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}}else{if(code<0xd5e4){if(code<0xd590){if(code<0xd559){if(code<0xd558){// Lo [27] HANGUL SYLLABLE PIG..HANGUL SYLLABLE PIH +if(0xd53d<=code&&code<=0xd557){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE HA +if(0xd558===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xd574){// Lo [27] HANGUL SYLLABLE HAG..HANGUL SYLLABLE HAH +if(0xd559<=code&&code<=0xd573){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xd575){// Lo HANGUL SYLLABLE HAE +if(0xd574===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE HAEG..HANGUL SYLLABLE HAEH +if(0xd575<=code&&code<=0xd58f){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xd5ad){if(code<0xd591){// Lo HANGUL SYLLABLE HYA +if(0xd590===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xd5ac){// Lo [27] HANGUL SYLLABLE HYAG..HANGUL SYLLABLE HYAH +if(0xd591<=code&&code<=0xd5ab){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE HYAE +if(0xd5ac===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xd5c8){// Lo [27] HANGUL SYLLABLE HYAEG..HANGUL SYLLABLE HYAEH +if(0xd5ad<=code&&code<=0xd5c7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xd5c9){// Lo HANGUL SYLLABLE HEO +if(0xd5c8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE HEOG..HANGUL SYLLABLE HEOH +if(0xd5c9<=code&&code<=0xd5e3){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}else{if(code<0xd61d){if(code<0xd600){if(code<0xd5e5){// Lo HANGUL SYLLABLE HE +if(0xd5e4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE HEG..HANGUL SYLLABLE HEH +if(0xd5e5<=code&&code<=0xd5ff){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xd601){// Lo HANGUL SYLLABLE HYEO +if(0xd600===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xd61c){// Lo [27] HANGUL SYLLABLE HYEOG..HANGUL SYLLABLE HYEOH +if(0xd601<=code&&code<=0xd61b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE HYE +if(0xd61c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}else{if(code<0xd654){if(code<0xd638){// Lo [27] HANGUL SYLLABLE HYEG..HANGUL SYLLABLE HYEH +if(0xd61d<=code&&code<=0xd637){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xd639){// Lo HANGUL SYLLABLE HO +if(0xd638===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE HOG..HANGUL SYLLABLE HOH +if(0xd639<=code&&code<=0xd653){return boundaries_1.CLUSTER_BREAK.LVT;}}}}else{if(code<0xd655){// Lo HANGUL SYLLABLE HWA +if(0xd654===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xd670){// Lo [27] HANGUL SYLLABLE HWAG..HANGUL SYLLABLE HWAH +if(0xd655<=code&&code<=0xd66f){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE HWAE +if(0xd670===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}}}}else{if(code<0x11000){if(code<0xd7b0){if(code<0xd6fd){if(code<0xd6c4){if(code<0xd68d){if(code<0xd68c){// Lo [27] HANGUL SYLLABLE HWAEG..HANGUL SYLLABLE HWAEH +if(0xd671<=code&&code<=0xd68b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE HOE +if(0xd68c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xd6a8){// Lo [27] HANGUL SYLLABLE HOEG..HANGUL SYLLABLE HOEH +if(0xd68d<=code&&code<=0xd6a7){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xd6a9){// Lo HANGUL SYLLABLE HYO +if(0xd6a8===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE HYOG..HANGUL SYLLABLE HYOH +if(0xd6a9<=code&&code<=0xd6c3){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xd6e0){if(code<0xd6c5){// Lo HANGUL SYLLABLE HU +if(0xd6c4===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE HUG..HANGUL SYLLABLE HUH +if(0xd6c5<=code&&code<=0xd6df){return boundaries_1.CLUSTER_BREAK.LVT;}}}else{if(code<0xd6e1){// Lo HANGUL SYLLABLE HWEO +if(0xd6e0===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xd6fc){// Lo [27] HANGUL SYLLABLE HWEOG..HANGUL SYLLABLE HWEOH +if(0xd6e1<=code&&code<=0xd6fb){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE HWE +if(0xd6fc===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}}}else{if(code<0xd750){if(code<0xd719){if(code<0xd718){// Lo [27] HANGUL SYLLABLE HWEG..HANGUL SYLLABLE HWEH +if(0xd6fd<=code&&code<=0xd717){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE HWI +if(0xd718===code){return boundaries_1.CLUSTER_BREAK.LV;}}}else{if(code<0xd734){// Lo [27] HANGUL SYLLABLE HWIG..HANGUL SYLLABLE HWIH +if(0xd719<=code&&code<=0xd733){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xd735){// Lo HANGUL SYLLABLE HYU +if(0xd734===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE HYUG..HANGUL SYLLABLE HYUH +if(0xd735<=code&&code<=0xd74f){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}else{if(code<0xd76d){if(code<0xd751){// Lo HANGUL SYLLABLE HEU +if(0xd750===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{if(code<0xd76c){// Lo [27] HANGUL SYLLABLE HEUG..HANGUL SYLLABLE HEUH +if(0xd751<=code&&code<=0xd76b){return boundaries_1.CLUSTER_BREAK.LVT;}}else{// Lo HANGUL SYLLABLE HYI +if(0xd76c===code){return boundaries_1.CLUSTER_BREAK.LV;}}}}else{if(code<0xd788){// Lo [27] HANGUL SYLLABLE HYIG..HANGUL SYLLABLE HYIH +if(0xd76d<=code&&code<=0xd787){return boundaries_1.CLUSTER_BREAK.LVT;}}else{if(code<0xd789){// Lo HANGUL SYLLABLE HI +if(0xd788===code){return boundaries_1.CLUSTER_BREAK.LV;}}else{// Lo [27] HANGUL SYLLABLE HIG..HANGUL SYLLABLE HIH +if(0xd789<=code&&code<=0xd7a3){return boundaries_1.CLUSTER_BREAK.LVT;}}}}}}}else{if(code<0x10a01){if(code<0xfeff){if(code<0xfb1e){if(code<0xd7cb){// Lo [23] HANGUL JUNGSEONG O-YEO..HANGUL JUNGSEONG ARAEA-E +if(0xd7b0<=code&&code<=0xd7c6){return boundaries_1.CLUSTER_BREAK.V;}}else{// Lo [49] HANGUL JONGSEONG NIEUN-RIEUL..HANGUL JONGSEONG PHIEUPH-THIEUTH +if(0xd7cb<=code&&code<=0xd7fb){return boundaries_1.CLUSTER_BREAK.T;}}}else{if(code<0xfe00){// Mn HEBREW POINT JUDEO-SPANISH VARIKA +if(0xfb1e===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xfe20){// Mn [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16 +if(0xfe00<=code&&code<=0xfe0f){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITLO RIGHT HALF +if(0xfe20<=code&&code<=0xfe2f){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0x101fd){if(code<0xff9e){// Cf ZERO WIDTH NO-BREAK SPACE +if(0xfeff===code){return boundaries_1.CLUSTER_BREAK.CONTROL;}}else{if(code<0xfff0){// Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK +if(0xff9e<=code&&code<=0xff9f){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Cn [9] .. +// Cf [3] INTERLINEAR ANNOTATION ANCHOR..INTERLINEAR ANNOTATION TERMINATOR +if(0xfff0<=code&&code<=0xfffb){return boundaries_1.CLUSTER_BREAK.CONTROL;}}}}else{if(code<0x102e0){// Mn PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE +if(0x101fd===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x10376){// Mn COPTIC EPACT THOUSANDS MARK +if(0x102e0===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [5] COMBINING OLD PERMIC LETTER AN..COMBINING OLD PERMIC LETTER SII +if(0x10376<=code&&code<=0x1037a){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}else{if(code<0x10ae5){if(code<0x10a0c){if(code<0x10a05){// Mn [3] KHAROSHTHI VOWEL SIGN I..KHAROSHTHI VOWEL SIGN VOCALIC R +if(0x10a01<=code&&code<=0x10a03){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [2] KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O +if(0x10a05<=code&&code<=0x10a06){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x10a38){// Mn [4] KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI SIGN VISARGA +if(0x10a0c<=code&&code<=0x10a0f){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x10a3f){// Mn [3] KHAROSHTHI SIGN BAR ABOVE..KHAROSHTHI SIGN DOT BELOW +if(0x10a38<=code&&code<=0x10a3a){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn KHAROSHTHI VIRAMA +if(0x10a3f===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0x10efd){if(code<0x10d24){// Mn [2] MANICHAEAN ABBREVIATION MARK ABOVE..MANICHAEAN ABBREVIATION MARK BELOW +if(0x10ae5<=code&&code<=0x10ae6){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x10eab){// Mn [4] HANIFI ROHINGYA SIGN HARBAHAY..HANIFI ROHINGYA SIGN TASSI +if(0x10d24<=code&&code<=0x10d27){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [2] YEZIDI COMBINING HAMZA MARK..YEZIDI COMBINING MADDA MARK +if(0x10eab<=code&&code<=0x10eac){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0x10f46){// Mn [3] ARABIC SMALL LOW WORD SAKTA..ARABIC SMALL LOW WORD MADDA +if(0x10efd<=code&&code<=0x10eff){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x10f82){// Mn [11] SOGDIAN COMBINING DOT BELOW..SOGDIAN COMBINING STROKE BELOW +if(0x10f46<=code&&code<=0x10f50){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [4] OLD UYGHUR COMBINING DOT ABOVE..OLD UYGHUR COMBINING TWO DOTS BELOW +if(0x10f82<=code&&code<=0x10f85){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}}}else{if(code<0x11180){if(code<0x110b7){if(code<0x11073){if(code<0x11002){// Mc BRAHMI SIGN CANDRABINDU +if(0x11000===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}// Mn BRAHMI SIGN ANUSVARA +if(0x11001===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x11038){// Mc BRAHMI SIGN VISARGA +if(0x11002===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x11070){// Mn [15] BRAHMI VOWEL SIGN AA..BRAHMI VIRAMA +if(0x11038<=code&&code<=0x11046){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn BRAHMI SIGN OLD TAMIL VIRAMA +if(0x11070===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0x11082){if(code<0x1107f){// Mn [2] BRAHMI VOWEL SIGN OLD TAMIL SHORT E..BRAHMI VOWEL SIGN OLD TAMIL SHORT O +if(0x11073<=code&&code<=0x11074){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [3] BRAHMI NUMBER JOINER..KAITHI SIGN ANUSVARA +if(0x1107f<=code&&code<=0x11081){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x110b0){// Mc KAITHI SIGN VISARGA +if(0x11082===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x110b3){// Mc [3] KAITHI VOWEL SIGN AA..KAITHI VOWEL SIGN II +if(0x110b0<=code&&code<=0x110b2){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [4] KAITHI VOWEL SIGN U..KAITHI VOWEL SIGN AI +if(0x110b3<=code&&code<=0x110b6){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}else{if(code<0x11100){if(code<0x110bd){if(code<0x110b9){// Mc [2] KAITHI VOWEL SIGN O..KAITHI VOWEL SIGN AU +if(0x110b7<=code&&code<=0x110b8){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [2] KAITHI SIGN VIRAMA..KAITHI SIGN NUKTA +if(0x110b9<=code&&code<=0x110ba){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x110c2){// Cf KAITHI NUMBER SIGN +if(0x110bd===code){return boundaries_1.CLUSTER_BREAK.PREPEND;}}else{// Mn KAITHI VOWEL SIGN VOCALIC R +if(0x110c2===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}// Cf KAITHI NUMBER SIGN ABOVE +if(0x110cd===code){return boundaries_1.CLUSTER_BREAK.PREPEND;}}}}else{if(code<0x1112d){if(code<0x11127){// Mn [3] CHAKMA SIGN CANDRABINDU..CHAKMA SIGN VISARGA +if(0x11100<=code&&code<=0x11102){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x1112c){// Mn [5] CHAKMA VOWEL SIGN A..CHAKMA VOWEL SIGN UU +if(0x11127<=code&&code<=0x1112b){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc CHAKMA VOWEL SIGN E +if(0x1112c===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}else{if(code<0x11145){// Mn [8] CHAKMA VOWEL SIGN AI..CHAKMA MAAYYAA +if(0x1112d<=code&&code<=0x11134){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x11173){// Mc [2] CHAKMA VOWEL SIGN AA..CHAKMA VOWEL SIGN EI +if(0x11145<=code&&code<=0x11146){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn MAHAJANI SIGN NUKTA +if(0x11173===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}}else{if(code<0x11232){if(code<0x111c2){if(code<0x111b3){if(code<0x11182){// Mn [2] SHARADA SIGN CANDRABINDU..SHARADA SIGN ANUSVARA +if(0x11180<=code&&code<=0x11181){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc SHARADA SIGN VISARGA +if(0x11182===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}else{if(code<0x111b6){// Mc [3] SHARADA VOWEL SIGN AA..SHARADA VOWEL SIGN II +if(0x111b3<=code&&code<=0x111b5){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x111bf){// Mn [9] SHARADA VOWEL SIGN U..SHARADA VOWEL SIGN O +if(0x111b6<=code&&code<=0x111be){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [2] SHARADA VOWEL SIGN AU..SHARADA SIGN VIRAMA +if(0x111bf<=code&&code<=0x111c0){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}else{if(code<0x111cf){if(code<0x111c9){// Lo [2] SHARADA SIGN JIHVAMULIYA..SHARADA SIGN UPADHMANIYA +if(0x111c2<=code&&code<=0x111c3){return boundaries_1.CLUSTER_BREAK.PREPEND;}}else{if(code<0x111ce){// Mn [4] SHARADA SANDHI MARK..SHARADA EXTRA SHORT VOWEL MARK +if(0x111c9<=code&&code<=0x111cc){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc SHARADA VOWEL SIGN PRISHTHAMATRA E +if(0x111ce===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}else{if(code<0x1122c){// Mn SHARADA SIGN INVERTED CANDRABINDU +if(0x111cf===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x1122f){// Mc [3] KHOJKI VOWEL SIGN AA..KHOJKI VOWEL SIGN II +if(0x1122c<=code&&code<=0x1122e){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [3] KHOJKI VOWEL SIGN U..KHOJKI VOWEL SIGN AI +if(0x1122f<=code&&code<=0x11231){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}else{if(code<0x11241){if(code<0x11235){if(code<0x11234){// Mc [2] KHOJKI VOWEL SIGN O..KHOJKI VOWEL SIGN AU +if(0x11232<=code&&code<=0x11233){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn KHOJKI SIGN ANUSVARA +if(0x11234===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x11236){// Mc KHOJKI SIGN VIRAMA +if(0x11235===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x1123e){// Mn [2] KHOJKI SIGN NUKTA..KHOJKI SIGN SHADDA +if(0x11236<=code&&code<=0x11237){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn KHOJKI SIGN SUKUN +if(0x1123e===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0x112e3){if(code<0x112df){// Mn KHOJKI VOWEL SIGN VOCALIC R +if(0x11241===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x112e0){// Mn KHUDAWADI SIGN ANUSVARA +if(0x112df===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [3] KHUDAWADI VOWEL SIGN AA..KHUDAWADI VOWEL SIGN II +if(0x112e0<=code&&code<=0x112e2){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}else{if(code<0x11300){// Mn [8] KHUDAWADI VOWEL SIGN U..KHUDAWADI SIGN VIRAMA +if(0x112e3<=code&&code<=0x112ea){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x11302){// Mn [2] GRANTHA SIGN COMBINING ANUSVARA ABOVE..GRANTHA SIGN CANDRABINDU +if(0x11300<=code&&code<=0x11301){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [2] GRANTHA SIGN ANUSVARA..GRANTHA SIGN VISARGA +if(0x11302<=code&&code<=0x11303){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}}}}}}else{if(code<0x11a97){if(code<0x116ab){if(code<0x114b9){if(code<0x11370){if(code<0x11347){if(code<0x1133f){if(code<0x1133e){// Mn [2] COMBINING BINDU BELOW..GRANTHA SIGN NUKTA +if(0x1133b<=code&&code<=0x1133c){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc GRANTHA VOWEL SIGN AA +if(0x1133e===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x11340){// Mc GRANTHA VOWEL SIGN I +if(0x1133f===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x11341){// Mn GRANTHA VOWEL SIGN II +if(0x11340===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [4] GRANTHA VOWEL SIGN U..GRANTHA VOWEL SIGN VOCALIC RR +if(0x11341<=code&&code<=0x11344){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}else{if(code<0x11357){if(code<0x1134b){// Mc [2] GRANTHA VOWEL SIGN EE..GRANTHA VOWEL SIGN AI +if(0x11347<=code&&code<=0x11348){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mc [3] GRANTHA VOWEL SIGN OO..GRANTHA SIGN VIRAMA +if(0x1134b<=code&&code<=0x1134d){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}else{if(code<0x11362){// Mc GRANTHA AU LENGTH MARK +if(0x11357===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x11366){// Mc [2] GRANTHA VOWEL SIGN VOCALIC L..GRANTHA VOWEL SIGN VOCALIC LL +if(0x11362<=code&&code<=0x11363){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [7] COMBINING GRANTHA DIGIT ZERO..COMBINING GRANTHA DIGIT SIX +if(0x11366<=code&&code<=0x1136c){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}else{if(code<0x11445){if(code<0x11438){if(code<0x11435){// Mn [5] COMBINING GRANTHA LETTER A..COMBINING GRANTHA LETTER PA +if(0x11370<=code&&code<=0x11374){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [3] NEWA VOWEL SIGN AA..NEWA VOWEL SIGN II +if(0x11435<=code&&code<=0x11437){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}else{if(code<0x11440){// Mn [8] NEWA VOWEL SIGN U..NEWA VOWEL SIGN AI +if(0x11438<=code&&code<=0x1143f){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x11442){// Mc [2] NEWA VOWEL SIGN O..NEWA VOWEL SIGN AU +if(0x11440<=code&&code<=0x11441){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [3] NEWA SIGN VIRAMA..NEWA SIGN ANUSVARA +if(0x11442<=code&&code<=0x11444){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0x114b0){if(code<0x11446){// Mc NEWA SIGN VISARGA +if(0x11445===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn NEWA SIGN NUKTA +if(0x11446===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}// Mn NEWA SANDHI MARK +if(0x1145e===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x114b1){// Mc TIRHUTA VOWEL SIGN AA +if(0x114b0===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x114b3){// Mc [2] TIRHUTA VOWEL SIGN I..TIRHUTA VOWEL SIGN II +if(0x114b1<=code&&code<=0x114b2){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [6] TIRHUTA VOWEL SIGN U..TIRHUTA VOWEL SIGN VOCALIC LL +if(0x114b3<=code&&code<=0x114b8){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}}else{if(code<0x115b8){if(code<0x114bf){if(code<0x114bb){// Mc TIRHUTA VOWEL SIGN E +if(0x114b9===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}// Mn TIRHUTA VOWEL SIGN SHORT E +if(0x114ba===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x114bd){// Mc [2] TIRHUTA VOWEL SIGN AI..TIRHUTA VOWEL SIGN O +if(0x114bb<=code&&code<=0x114bc){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mc TIRHUTA VOWEL SIGN SHORT O +if(0x114bd===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}// Mc TIRHUTA VOWEL SIGN AU +if(0x114be===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}else{if(code<0x115af){if(code<0x114c1){// Mn [2] TIRHUTA SIGN CANDRABINDU..TIRHUTA SIGN ANUSVARA +if(0x114bf<=code&&code<=0x114c0){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x114c2){// Mc TIRHUTA SIGN VISARGA +if(0x114c1===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [2] TIRHUTA SIGN VIRAMA..TIRHUTA SIGN NUKTA +if(0x114c2<=code&&code<=0x114c3){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0x115b0){// Mc SIDDHAM VOWEL SIGN AA +if(0x115af===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x115b2){// Mc [2] SIDDHAM VOWEL SIGN I..SIDDHAM VOWEL SIGN II +if(0x115b0<=code&&code<=0x115b1){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [4] SIDDHAM VOWEL SIGN U..SIDDHAM VOWEL SIGN VOCALIC RR +if(0x115b2<=code&&code<=0x115b5){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}else{if(code<0x11630){if(code<0x115be){if(code<0x115bc){// Mc [4] SIDDHAM VOWEL SIGN E..SIDDHAM VOWEL SIGN AU +if(0x115b8<=code&&code<=0x115bb){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [2] SIDDHAM SIGN CANDRABINDU..SIDDHAM SIGN ANUSVARA +if(0x115bc<=code&&code<=0x115bd){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x115bf){// Mc SIDDHAM SIGN VISARGA +if(0x115be===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x115dc){// Mn [2] SIDDHAM SIGN VIRAMA..SIDDHAM SIGN NUKTA +if(0x115bf<=code&&code<=0x115c0){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [2] SIDDHAM VOWEL SIGN ALTERNATE U..SIDDHAM VOWEL SIGN ALTERNATE UU +if(0x115dc<=code&&code<=0x115dd){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0x1163d){if(code<0x11633){// Mc [3] MODI VOWEL SIGN AA..MODI VOWEL SIGN II +if(0x11630<=code&&code<=0x11632){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x1163b){// Mn [8] MODI VOWEL SIGN U..MODI VOWEL SIGN AI +if(0x11633<=code&&code<=0x1163a){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [2] MODI VOWEL SIGN O..MODI VOWEL SIGN AU +if(0x1163b<=code&&code<=0x1163c){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}else{if(code<0x1163e){// Mn MODI SIGN ANUSVARA +if(0x1163d===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x1163f){// Mc MODI SIGN VISARGA +if(0x1163e===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [2] MODI SIGN VIRAMA..MODI SIGN ARDHACANDRA +if(0x1163f<=code&&code<=0x11640){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}}}else{if(code<0x1193f){if(code<0x11727){if(code<0x116b6){if(code<0x116ad){// Mn TAKRI SIGN ANUSVARA +if(0x116ab===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}// Mc TAKRI SIGN VISARGA +if(0x116ac===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x116ae){// Mn TAKRI VOWEL SIGN AA +if(0x116ad===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x116b0){// Mc [2] TAKRI VOWEL SIGN I..TAKRI VOWEL SIGN II +if(0x116ae<=code&&code<=0x116af){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [6] TAKRI VOWEL SIGN U..TAKRI VOWEL SIGN AU +if(0x116b0<=code&&code<=0x116b5){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0x1171d){// Mc TAKRI SIGN VIRAMA +if(0x116b6===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}// Mn TAKRI SIGN NUKTA +if(0x116b7===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x11722){// Mn [3] AHOM CONSONANT SIGN MEDIAL LA..AHOM CONSONANT SIGN MEDIAL LIGATING RA +if(0x1171d<=code&&code<=0x1171f){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x11726){// Mn [4] AHOM VOWEL SIGN I..AHOM VOWEL SIGN UU +if(0x11722<=code&&code<=0x11725){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc AHOM VOWEL SIGN E +if(0x11726===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}}else{if(code<0x11930){if(code<0x1182f){if(code<0x1182c){// Mn [5] AHOM VOWEL SIGN AW..AHOM SIGN KILLER +if(0x11727<=code&&code<=0x1172b){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [3] DOGRA VOWEL SIGN AA..DOGRA VOWEL SIGN II +if(0x1182c<=code&&code<=0x1182e){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}else{if(code<0x11838){// Mn [9] DOGRA VOWEL SIGN U..DOGRA SIGN ANUSVARA +if(0x1182f<=code&&code<=0x11837){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x11839){// Mc DOGRA SIGN VISARGA +if(0x11838===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [2] DOGRA SIGN VIRAMA..DOGRA SIGN NUKTA +if(0x11839<=code&&code<=0x1183a){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0x1193b){if(code<0x11931){// Mc DIVES AKURU VOWEL SIGN AA +if(0x11930===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x11937){// Mc [5] DIVES AKURU VOWEL SIGN I..DIVES AKURU VOWEL SIGN E +if(0x11931<=code&&code<=0x11935){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mc [2] DIVES AKURU VOWEL SIGN AI..DIVES AKURU VOWEL SIGN O +if(0x11937<=code&&code<=0x11938){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}else{if(code<0x1193d){// Mn [2] DIVES AKURU SIGN ANUSVARA..DIVES AKURU SIGN CANDRABINDU +if(0x1193b<=code&&code<=0x1193c){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc DIVES AKURU SIGN HALANTA +if(0x1193d===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}// Mn DIVES AKURU VIRAMA +if(0x1193e===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}else{if(code<0x11a01){if(code<0x119d1){if(code<0x11941){// Lo DIVES AKURU PREFIXED NASAL SIGN +if(0x1193f===code){return boundaries_1.CLUSTER_BREAK.PREPEND;}// Mc DIVES AKURU MEDIAL YA +if(0x11940===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x11942){// Lo DIVES AKURU INITIAL RA +if(0x11941===code){return boundaries_1.CLUSTER_BREAK.PREPEND;}}else{// Mc DIVES AKURU MEDIAL RA +if(0x11942===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}// Mn DIVES AKURU SIGN NUKTA +if(0x11943===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0x119dc){if(code<0x119d4){// Mc [3] NANDINAGARI VOWEL SIGN AA..NANDINAGARI VOWEL SIGN II +if(0x119d1<=code&&code<=0x119d3){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x119da){// Mn [4] NANDINAGARI VOWEL SIGN U..NANDINAGARI VOWEL SIGN VOCALIC RR +if(0x119d4<=code&&code<=0x119d7){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [2] NANDINAGARI VOWEL SIGN E..NANDINAGARI VOWEL SIGN AI +if(0x119da<=code&&code<=0x119db){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0x119e0){// Mc [4] NANDINAGARI VOWEL SIGN O..NANDINAGARI SIGN VISARGA +if(0x119dc<=code&&code<=0x119df){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn NANDINAGARI SIGN VIRAMA +if(0x119e0===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}// Mc NANDINAGARI VOWEL SIGN PRISHTHAMATRA E +if(0x119e4===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}else{if(code<0x11a47){if(code<0x11a39){if(code<0x11a33){// Mn [10] ZANABAZAR SQUARE VOWEL SIGN I..ZANABAZAR SQUARE VOWEL LENGTH MARK +if(0x11a01<=code&&code<=0x11a0a){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [6] ZANABAZAR SQUARE FINAL CONSONANT MARK..ZANABAZAR SQUARE SIGN ANUSVARA +if(0x11a33<=code&&code<=0x11a38){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x11a3a){// Mc ZANABAZAR SQUARE SIGN VISARGA +if(0x11a39===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x11a3b){// Lo ZANABAZAR SQUARE CLUSTER-INITIAL LETTER RA +if(0x11a3a===code){return boundaries_1.CLUSTER_BREAK.PREPEND;}}else{// Mn [4] ZANABAZAR SQUARE CLUSTER-FINAL LETTER YA..ZANABAZAR SQUARE CLUSTER-FINAL LETTER VA +if(0x11a3b<=code&&code<=0x11a3e){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0x11a59){if(code<0x11a51){// Mn ZANABAZAR SQUARE SUBJOINER +if(0x11a47===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x11a57){// Mn [6] SOYOMBO VOWEL SIGN I..SOYOMBO VOWEL SIGN OE +if(0x11a51<=code&&code<=0x11a56){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [2] SOYOMBO VOWEL SIGN AI..SOYOMBO VOWEL SIGN AU +if(0x11a57<=code&&code<=0x11a58){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}else{if(code<0x11a84){// Mn [3] SOYOMBO VOWEL SIGN VOCALIC R..SOYOMBO VOWEL LENGTH MARK +if(0x11a59<=code&&code<=0x11a5b){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x11a8a){// Lo [6] SOYOMBO SIGN JIHVAMULIYA..SOYOMBO CLUSTER-INITIAL LETTER SA +if(0x11a84<=code&&code<=0x11a89){return boundaries_1.CLUSTER_BREAK.PREPEND;}}else{// Mn [13] SOYOMBO FINAL CONSONANT SIGN G..SOYOMBO SIGN ANUSVARA +if(0x11a8a<=code&&code<=0x11a96){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}}}}else{if(code<0x16f51){if(code<0x11d90){if(code<0x11cb1){if(code<0x11c3e){if(code<0x11c2f){if(code<0x11a98){// Mc SOYOMBO SIGN VISARGA +if(0x11a97===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [2] SOYOMBO GEMINATION MARK..SOYOMBO SUBJOINER +if(0x11a98<=code&&code<=0x11a99){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x11c30){// Mc BHAIKSUKI VOWEL SIGN AA +if(0x11c2f===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x11c38){// Mn [7] BHAIKSUKI VOWEL SIGN I..BHAIKSUKI VOWEL SIGN VOCALIC L +if(0x11c30<=code&&code<=0x11c36){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [6] BHAIKSUKI VOWEL SIGN E..BHAIKSUKI SIGN ANUSVARA +if(0x11c38<=code&&code<=0x11c3d){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0x11c92){// Mc BHAIKSUKI SIGN VISARGA +if(0x11c3e===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}// Mn BHAIKSUKI SIGN VIRAMA +if(0x11c3f===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x11ca9){// Mn [22] MARCHEN SUBJOINED LETTER KA..MARCHEN SUBJOINED LETTER ZA +if(0x11c92<=code&&code<=0x11ca7){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x11caa){// Mc MARCHEN SUBJOINED LETTER YA +if(0x11ca9===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [7] MARCHEN SUBJOINED LETTER RA..MARCHEN VOWEL SIGN AA +if(0x11caa<=code&&code<=0x11cb0){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}else{if(code<0x11d3a){if(code<0x11cb4){if(code<0x11cb2){// Mc MARCHEN VOWEL SIGN I +if(0x11cb1===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [2] MARCHEN VOWEL SIGN U..MARCHEN VOWEL SIGN E +if(0x11cb2<=code&&code<=0x11cb3){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x11cb5){// Mc MARCHEN VOWEL SIGN O +if(0x11cb4===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{if(code<0x11d31){// Mn [2] MARCHEN SIGN ANUSVARA..MARCHEN SIGN CANDRABINDU +if(0x11cb5<=code&&code<=0x11cb6){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [6] MASARAM GONDI VOWEL SIGN AA..MASARAM GONDI VOWEL SIGN VOCALIC R +if(0x11d31<=code&&code<=0x11d36){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0x11d46){if(code<0x11d3c){// Mn MASARAM GONDI VOWEL SIGN E +if(0x11d3a===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x11d3f){// Mn [2] MASARAM GONDI VOWEL SIGN AI..MASARAM GONDI VOWEL SIGN O +if(0x11d3c<=code&&code<=0x11d3d){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [7] MASARAM GONDI VOWEL SIGN AU..MASARAM GONDI VIRAMA +if(0x11d3f<=code&&code<=0x11d45){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0x11d47){// Lo MASARAM GONDI REPHA +if(0x11d46===code){return boundaries_1.CLUSTER_BREAK.PREPEND;}}else{if(code<0x11d8a){// Mn MASARAM GONDI RA-KARA +if(0x11d47===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [5] GUNJALA GONDI VOWEL SIGN AA..GUNJALA GONDI VOWEL SIGN UU +if(0x11d8a<=code&&code<=0x11d8e){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}}}else{if(code<0x11f36){if(code<0x11ef3){if(code<0x11d95){if(code<0x11d93){// Mn [2] GUNJALA GONDI VOWEL SIGN EE..GUNJALA GONDI VOWEL SIGN AI +if(0x11d90<=code&&code<=0x11d91){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [2] GUNJALA GONDI VOWEL SIGN OO..GUNJALA GONDI VOWEL SIGN AU +if(0x11d93<=code&&code<=0x11d94){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}else{if(code<0x11d96){// Mn GUNJALA GONDI SIGN ANUSVARA +if(0x11d95===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc GUNJALA GONDI SIGN VISARGA +if(0x11d96===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}// Mn GUNJALA GONDI VIRAMA +if(0x11d97===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0x11f02){if(code<0x11ef5){// Mn [2] MAKASAR VOWEL SIGN I..MAKASAR VOWEL SIGN U +if(0x11ef3<=code&&code<=0x11ef4){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x11f00){// Mc [2] MAKASAR VOWEL SIGN E..MAKASAR VOWEL SIGN O +if(0x11ef5<=code&&code<=0x11ef6){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [2] KAWI SIGN CANDRABINDU..KAWI SIGN ANUSVARA +if(0x11f00<=code&&code<=0x11f01){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0x11f03){// Lo KAWI SIGN REPHA +if(0x11f02===code){return boundaries_1.CLUSTER_BREAK.PREPEND;}}else{if(code<0x11f34){// Mc KAWI SIGN VISARGA +if(0x11f03===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mc [2] KAWI VOWEL SIGN AA..KAWI VOWEL SIGN ALTERNATE AA +if(0x11f34<=code&&code<=0x11f35){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}}else{if(code<0x13430){if(code<0x11f40){if(code<0x11f3e){// Mn [5] KAWI VOWEL SIGN I..KAWI VOWEL SIGN VOCALIC R +if(0x11f36<=code&&code<=0x11f3a){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc [2] KAWI VOWEL SIGN E..KAWI VOWEL SIGN AI +if(0x11f3e<=code&&code<=0x11f3f){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}else{if(code<0x11f41){// Mn KAWI VOWEL SIGN EU +if(0x11f40===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc KAWI SIGN KILLER +if(0x11f41===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}// Mn KAWI CONJOINER +if(0x11f42===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0x16af0){if(code<0x13440){// Cf [16] EGYPTIAN HIEROGLYPH VERTICAL JOINER..EGYPTIAN HIEROGLYPH END WALLED ENCLOSURE +if(0x13430<=code&&code<=0x1343f){return boundaries_1.CLUSTER_BREAK.CONTROL;}}else{if(code<0x13447){// Mn EGYPTIAN HIEROGLYPH MIRROR HORIZONTALLY +if(0x13440===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [15] EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT TOP START..EGYPTIAN HIEROGLYPH MODIFIER DAMAGED +if(0x13447<=code&&code<=0x13455){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0x16b30){// Mn [5] BASSA VAH COMBINING HIGH TONE..BASSA VAH COMBINING HIGH-LOW TONE +if(0x16af0<=code&&code<=0x16af4){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x16f4f){// Mn [7] PAHAWH HMONG MARK CIM TUB..PAHAWH HMONG MARK CIM TAUM +if(0x16b30<=code&&code<=0x16b36){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn MIAO SIGN CONSONANT MODIFIER BAR +if(0x16f4f===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}}}else{if(code<0x1da84){if(code<0x1d167){if(code<0x1bca0){if(code<0x16fe4){if(code<0x16f8f){// Mc [55] MIAO SIGN ASPIRATION..MIAO VOWEL SIGN UI +if(0x16f51<=code&&code<=0x16f87){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [4] MIAO TONE RIGHT..MIAO TONE BELOW +if(0x16f8f<=code&&code<=0x16f92){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x16ff0){// Mn KHITAN SMALL SCRIPT FILLER +if(0x16fe4===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x1bc9d){// Mc [2] VIETNAMESE ALTERNATE READING MARK CA..VIETNAMESE ALTERNATE READING MARK NHAY +if(0x16ff0<=code&&code<=0x16ff1){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}else{// Mn [2] DUPLOYAN THICK LETTER SELECTOR..DUPLOYAN DOUBLE MARK +if(0x1bc9d<=code&&code<=0x1bc9e){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0x1cf30){if(code<0x1cf00){// Cf [4] SHORTHAND FORMAT LETTER OVERLAP..SHORTHAND FORMAT UP STEP +if(0x1bca0<=code&&code<=0x1bca3){return boundaries_1.CLUSTER_BREAK.CONTROL;}}else{// Mn [46] ZNAMENNY COMBINING MARK GORAZDO NIZKO S KRYZHEM ON LEFT..ZNAMENNY COMBINING MARK KRYZH ON LEFT +if(0x1cf00<=code&&code<=0x1cf2d){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x1d165){// Mn [23] ZNAMENNY COMBINING TONAL RANGE MARK MRACHNO..ZNAMENNY PRIZNAK MODIFIER ROG +if(0x1cf30<=code&&code<=0x1cf46){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc MUSICAL SYMBOL COMBINING STEM +if(0x1d165===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}// Mc MUSICAL SYMBOL COMBINING SPRECHGESANG STEM +if(0x1d166===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}}}else{if(code<0x1d185){if(code<0x1d16e){if(code<0x1d16d){// Mn [3] MUSICAL SYMBOL COMBINING TREMOLO-1..MUSICAL SYMBOL COMBINING TREMOLO-3 +if(0x1d167<=code&&code<=0x1d169){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mc MUSICAL SYMBOL COMBINING AUGMENTATION DOT +if(0x1d16d===code){return boundaries_1.CLUSTER_BREAK.SPACINGMARK;}}}else{if(code<0x1d173){// Mc [5] MUSICAL SYMBOL COMBINING FLAG-1..MUSICAL SYMBOL COMBINING FLAG-5 +if(0x1d16e<=code&&code<=0x1d172){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x1d17b){// Cf [8] MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE +if(0x1d173<=code&&code<=0x1d17a){return boundaries_1.CLUSTER_BREAK.CONTROL;}}else{// Mn [8] MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL COMBINING LOURE +if(0x1d17b<=code&&code<=0x1d182){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0x1da00){if(code<0x1d1aa){// Mn [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE +if(0x1d185<=code&&code<=0x1d18b){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x1d242){// Mn [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO +if(0x1d1aa<=code&&code<=0x1d1ad){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME +if(0x1d242<=code&&code<=0x1d244){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0x1da3b){// Mn [55] SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN +if(0x1da00<=code&&code<=0x1da36){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x1da75){// Mn [50] SIGNWRITING MOUTH CLOSED NEUTRAL..SIGNWRITING EXCITEMENT +if(0x1da3b<=code&&code<=0x1da6c){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS +if(0x1da75===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}}else{if(code<0x1e2ec){if(code<0x1e01b){if(code<0x1daa1){if(code<0x1da9b){// Mn SIGNWRITING LOCATION HEAD NECK +if(0x1da84===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [5] SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL MODIFIER-6 +if(0x1da9b<=code&&code<=0x1da9f){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x1e000){// Mn [15] SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16 +if(0x1daa1<=code&&code<=0x1daaf){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x1e008){// Mn [7] COMBINING GLAGOLITIC LETTER AZU..COMBINING GLAGOLITIC LETTER ZHIVETE +if(0x1e000<=code&&code<=0x1e006){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [17] COMBINING GLAGOLITIC LETTER ZEMLJA..COMBINING GLAGOLITIC LETTER HERU +if(0x1e008<=code&&code<=0x1e018){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}else{if(code<0x1e08f){if(code<0x1e023){// Mn [7] COMBINING GLAGOLITIC LETTER SHTA..COMBINING GLAGOLITIC LETTER YATI +if(0x1e01b<=code&&code<=0x1e021){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x1e026){// Mn [2] COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS +if(0x1e023<=code&&code<=0x1e024){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [5] COMBINING GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA +if(0x1e026<=code&&code<=0x1e02a){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0x1e130){// Mn COMBINING CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I +if(0x1e08f===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x1e2ae){// Mn [7] NYIAKENG PUACHUE HMONG TONE-B..NYIAKENG PUACHUE HMONG TONE-D +if(0x1e130<=code&&code<=0x1e136){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn TOTO SIGN RISING TONE +if(0x1e2ae===code){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}}}else{if(code<0x1f3fb){if(code<0x1e8d0){if(code<0x1e4ec){// Mn [4] WANCHO TONE TUP..WANCHO TONE KOINI +if(0x1e2ec<=code&&code<=0x1e2ef){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Mn [4] NAG MUNDARI SIGN MUHOR..NAG MUNDARI SIGN SUTUH +if(0x1e4ec<=code&&code<=0x1e4ef){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}else{if(code<0x1e944){// Mn [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS +if(0x1e8d0<=code&&code<=0x1e8d6){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0x1f1e6){// Mn [7] ADLAM ALIF LENGTHENER..ADLAM NUKTA +if(0x1e944<=code&&code<=0x1e94a){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// So [26] REGIONAL INDICATOR SYMBOL LETTER A..REGIONAL INDICATOR SYMBOL LETTER Z +if(0x1f1e6<=code&&code<=0x1f1ff){return boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR;}}}}}else{if(code<0xe0080){if(code<0xe0000){// Sk [5] EMOJI MODIFIER FITZPATRICK TYPE-1-2..EMOJI MODIFIER FITZPATRICK TYPE-6 +if(0x1f3fb<=code&&code<=0x1f3ff){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{if(code<0xe0020){// Cn +// Cf LANGUAGE TAG +// Cn [30] .. +if(0xe0000<=code&&code<=0xe001f){return boundaries_1.CLUSTER_BREAK.CONTROL;}}else{// Cf [96] TAG SPACE..CANCEL TAG +if(0xe0020<=code&&code<=0xe007f){return boundaries_1.CLUSTER_BREAK.EXTEND;}}}}else{if(code<0xe0100){// Cn [128] .. +if(0xe0080<=code&&code<=0xe00ff){return boundaries_1.CLUSTER_BREAK.CONTROL;}}else{if(code<0xe01f0){// Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 +if(0xe0100<=code&&code<=0xe01ef){return boundaries_1.CLUSTER_BREAK.EXTEND;}}else{// Cn [3600] .. +if(0xe01f0<=code&&code<=0xe0fff){return boundaries_1.CLUSTER_BREAK.CONTROL;}}}}}}}}}}}}// unlisted code points are treated as a break property of "Other" +return boundaries_1.CLUSTER_BREAK.OTHER;}/** + * Given a Unicode code point, returns if symbol is an extended pictographic or some other break + * @param code {number} Unicode code point + * @returns {number} + */static getEmojiProperty(code){// emoji property taken from: +// https://www.unicode.org/Public/UCD/latest/ucd/emoji/emoji-data.txt +// and generated by +// node ./scripts/generate-emoji-extended-pictographic.js +if(code<0x27b0){if(code<0x2600){if(code<0x2328){if(code<0x2122){if(code<0x203c){// E0.6 [1] (©️) copyright +if(0xa9===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}// E0.6 [1] (®️) registered +if(0xae===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.6 [1] (‼️) double exclamation mark +if(0x203c===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}// E0.6 [1] (⁉️) exclamation question mark +if(0x2049===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}else{if(code<0x2194){// E0.6 [1] (™️) trade mark +if(0x2122===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}// E0.6 [1] (ℹ️) information +if(0x2139===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{if(code<0x21a9){// E0.6 [6] (↔️..↙️) left-right arrow..down-left arrow +if(0x2194<=code&&code<=0x2199){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{if(code<0x231a){// E0.6 [2] (↩️..↪️) right arrow curving left..left arrow curving right +if(0x21a9<=code&&code<=0x21aa){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.6 [2] (⌚..⌛) watch..hourglass done +if(0x231a<=code&&code<=0x231b){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}}}}else{if(code<0x24c2){if(code<0x23cf){// E1.0 [1] (⌨️) keyboard +if(0x2328===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}// E0.0 [1] (⎈) HELM SYMBOL +if(0x2388===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{if(code<0x23e9){// E1.0 [1] (⏏️) eject button +if(0x23cf===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{if(code<0x23f8){// E0.6 [4] (⏩..⏬) fast-forward button..fast down button +// E0.7 [2] (⏭️..⏮️) next track button..last track button +// E1.0 [1] (⏯️) play or pause button +// E0.6 [1] (⏰) alarm clock +// E1.0 [2] (⏱️..⏲️) stopwatch..timer clock +// E0.6 [1] (⏳) hourglass not done +if(0x23e9<=code&&code<=0x23f3){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.7 [3] (⏸️..⏺️) pause button..record button +if(0x23f8<=code&&code<=0x23fa){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}}}else{if(code<0x25b6){if(code<0x25aa){// E0.6 [1] (Ⓜ️) circled M +if(0x24c2===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.6 [2] (▪️..▫️) black small square..white small square +if(0x25aa<=code&&code<=0x25ab){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}else{if(code<0x25c0){// E0.6 [1] (▶️) play button +if(0x25b6===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{if(code<0x25fb){// E0.6 [1] (◀️) reverse button +if(0x25c0===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.6 [4] (◻️..◾) white medium square..black medium-small square +if(0x25fb<=code&&code<=0x25fe){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}}}}}else{if(code<0x2733){if(code<0x2714){if(code<0x2614){if(code<0x2607){// E0.6 [2] (☀️..☁️) sun..cloud +// E0.7 [2] (☂️..☃️) umbrella..snowman +// E1.0 [1] (☄️) comet +// E0.0 [1] (★) BLACK STAR +if(0x2600<=code&&code<=0x2605){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.0 [7] (☇..☍) LIGHTNING..OPPOSITION +// E0.6 [1] (☎️) telephone +// E0.0 [2] (☏..☐) WHITE TELEPHONE..BALLOT BOX +// E0.6 [1] (☑️) check box with check +// E0.0 [1] (☒) BALLOT BOX WITH X +if(0x2607<=code&&code<=0x2612){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}else{if(code<0x2690){// E0.6 [2] (☔..☕) umbrella with rain drops..hot beverage +// E0.0 [2] (☖..☗) WHITE SHOGI PIECE..BLACK SHOGI PIECE +// E1.0 [1] (☘️) shamrock +// E0.0 [4] (☙..☜) REVERSED ROTATED FLORAL HEART BULLET..WHITE LEFT POINTING INDEX +// E0.6 [1] (☝️) index pointing up +// E0.0 [2] (☞..☟) WHITE RIGHT POINTING INDEX..WHITE DOWN POINTING INDEX +// E1.0 [1] (☠️) skull and crossbones +// E0.0 [1] (☡) CAUTION SIGN +// E1.0 [2] (☢️..☣️) radioactive..biohazard +// E0.0 [2] (☤..☥) CADUCEUS..ANKH +// E1.0 [1] (☦️) orthodox cross +// E0.0 [3] (☧..☩) CHI RHO..CROSS OF JERUSALEM +// E0.7 [1] (☪️) star and crescent +// E0.0 [3] (☫..☭) FARSI SYMBOL..HAMMER AND SICKLE +// E1.0 [1] (☮️) peace symbol +// E0.7 [1] (☯️) yin yang +// E0.0 [8] (☰..☷) TRIGRAM FOR HEAVEN..TRIGRAM FOR EARTH +// E0.7 [2] (☸️..☹️) wheel of dharma..frowning face +// E0.6 [1] (☺️) smiling face +// E0.0 [5] (☻..☿) BLACK SMILING FACE..MERCURY +// E4.0 [1] (♀️) female sign +// E0.0 [1] (♁) EARTH +// E4.0 [1] (♂️) male sign +// E0.0 [5] (♃..♇) JUPITER..PLUTO +// E0.6 [12] (♈..♓) Aries..Pisces +// E0.0 [11] (♔..♞) WHITE CHESS KING..BLACK CHESS KNIGHT +// E11.0 [1] (♟️) chess pawn +// E0.6 [1] (♠️) spade suit +// E0.0 [2] (♡..♢) WHITE HEART SUIT..WHITE DIAMOND SUIT +// E0.6 [1] (♣️) club suit +// E0.0 [1] (♤) WHITE SPADE SUIT +// E0.6 [2] (♥️..♦️) heart suit..diamond suit +// E0.0 [1] (♧) WHITE CLUB SUIT +// E0.6 [1] (♨️) hot springs +// E0.0 [18] (♩..♺) QUARTER NOTE..RECYCLING SYMBOL FOR GENERIC MATERIALS +// E0.6 [1] (♻️) recycling symbol +// E0.0 [2] (♼..♽) RECYCLED PAPER SYMBOL..PARTIALLY-RECYCLED PAPER SYMBOL +// E11.0 [1] (♾️) infinity +// E0.6 [1] (♿) wheelchair symbol +// E0.0 [6] (⚀..⚅) DIE FACE-1..DIE FACE-6 +if(0x2614<=code&&code<=0x2685){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{if(code<0x2708){// E0.0 [2] (⚐..⚑) WHITE FLAG..BLACK FLAG +// E1.0 [1] (⚒️) hammer and pick +// E0.6 [1] (⚓) anchor +// E1.0 [1] (⚔️) crossed swords +// E4.0 [1] (⚕️) medical symbol +// E1.0 [2] (⚖️..⚗️) balance scale..alembic +// E0.0 [1] (⚘) FLOWER +// E1.0 [1] (⚙️) gear +// E0.0 [1] (⚚) STAFF OF HERMES +// E1.0 [2] (⚛️..⚜️) atom symbol..fleur-de-lis +// E0.0 [3] (⚝..⚟) OUTLINED WHITE STAR..THREE LINES CONVERGING LEFT +// E0.6 [2] (⚠️..⚡) warning..high voltage +// E0.0 [5] (⚢..⚦) DOUBLED FEMALE SIGN..MALE WITH STROKE SIGN +// E13.0 [1] (⚧️) transgender symbol +// E0.0 [2] (⚨..⚩) VERTICAL MALE WITH STROKE SIGN..HORIZONTAL MALE WITH STROKE SIGN +// E0.6 [2] (⚪..⚫) white circle..black circle +// E0.0 [4] (⚬..⚯) MEDIUM SMALL WHITE CIRCLE..UNMARRIED PARTNERSHIP SYMBOL +// E1.0 [2] (⚰️..⚱️) coffin..funeral urn +// E0.0 [11] (⚲..⚼) NEUTER..SESQUIQUADRATE +// E0.6 [2] (⚽..⚾) soccer ball..baseball +// E0.0 [5] (⚿..⛃) SQUARED KEY..BLACK DRAUGHTS KING +// E0.6 [2] (⛄..⛅) snowman without snow..sun behind cloud +// E0.0 [2] (⛆..⛇) RAIN..BLACK SNOWMAN +// E0.7 [1] (⛈️) cloud with lightning and rain +// E0.0 [5] (⛉..⛍) TURNED WHITE SHOGI PIECE..DISABLED CAR +// E0.6 [1] (⛎) Ophiuchus +// E0.7 [1] (⛏️) pick +// E0.0 [1] (⛐) CAR SLIDING +// E0.7 [1] (⛑️) rescue worker’s helmet +// E0.0 [1] (⛒) CIRCLED CROSSING LANES +// E0.7 [1] (⛓️) chains +// E0.6 [1] (⛔) no entry +// E0.0 [20] (⛕..⛨) ALTERNATE ONE-WAY LEFT WAY TRAFFIC..BLACK CROSS ON SHIELD +// E0.7 [1] (⛩️) shinto shrine +// E0.6 [1] (⛪) church +// E0.0 [5] (⛫..⛯) CASTLE..MAP SYMBOL FOR LIGHTHOUSE +// E0.7 [2] (⛰️..⛱️) mountain..umbrella on ground +// E0.6 [2] (⛲..⛳) fountain..flag in hole +// E0.7 [1] (⛴️) ferry +// E0.6 [1] (⛵) sailboat +// E0.0 [1] (⛶) SQUARE FOUR CORNERS +// E0.7 [3] (⛷️..⛹️) skier..person bouncing ball +// E0.6 [1] (⛺) tent +// E0.0 [2] (⛻..⛼) JAPANESE BANK SYMBOL..HEADSTONE GRAVEYARD SYMBOL +// E0.6 [1] (⛽) fuel pump +// E0.0 [4] (⛾..✁) CUP ON BLACK SQUARE..UPPER BLADE SCISSORS +// E0.6 [1] (✂️) scissors +// E0.0 [2] (✃..✄) LOWER BLADE SCISSORS..WHITE SCISSORS +// E0.6 [1] (✅) check mark button +if(0x2690<=code&&code<=0x2705){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.6 [5] (✈️..✌️) airplane..victory hand +// E0.7 [1] (✍️) writing hand +// E0.0 [1] (✎) LOWER RIGHT PENCIL +// E0.6 [1] (✏️) pencil +// E0.0 [2] (✐..✑) UPPER RIGHT PENCIL..WHITE NIB +// E0.6 [1] (✒️) black nib +if(0x2708<=code&&code<=0x2712){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}}}else{if(code<0x271d){// E0.6 [1] (✔️) check mark +if(0x2714===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}// E0.6 [1] (✖️) multiply +if(0x2716===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{if(code<0x2721){// E0.7 [1] (✝️) latin cross +if(0x271d===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.7 [1] (✡️) star of David +if(0x2721===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}// E0.6 [1] (✨) sparkles +if(0x2728===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}}}else{if(code<0x2753){if(code<0x2747){if(code<0x2744){// E0.6 [2] (✳️..✴️) eight-spoked asterisk..eight-pointed star +if(0x2733<=code&&code<=0x2734){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.6 [1] (❄️) snowflake +if(0x2744===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}else{if(code<0x274c){// E0.6 [1] (❇️) sparkle +if(0x2747===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.6 [1] (❌) cross mark +if(0x274c===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}// E0.6 [1] (❎) cross mark button +if(0x274e===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}}else{if(code<0x2763){if(code<0x2757){// E0.6 [3] (❓..❕) red question mark..white exclamation mark +if(0x2753<=code&&code<=0x2755){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.6 [1] (❗) red exclamation mark +if(0x2757===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}else{if(code<0x2795){// E1.0 [1] (❣️) heart exclamation +// E0.6 [1] (❤️) red heart +// E0.0 [3] (❥..❧) ROTATED HEAVY BLACK HEART BULLET..ROTATED FLORAL HEART BULLET +if(0x2763<=code&&code<=0x2767){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{if(code<0x27a1){// E0.6 [3] (➕..➗) plus..divide +if(0x2795<=code&&code<=0x2797){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.6 [1] (➡️) right arrow +if(0x27a1===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}}}}}}else{if(code<0x1f201){if(code<0x3297){if(code<0x2b1b){if(code<0x2934){// E0.6 [1] (➰) curly loop +if(0x27b0===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}// E1.0 [1] (➿) double curly loop +if(0x27bf===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{if(code<0x2b05){// E0.6 [2] (⤴️..⤵️) right arrow curving up..right arrow curving down +if(0x2934<=code&&code<=0x2935){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.6 [3] (⬅️..⬇️) left arrow..down arrow +if(0x2b05<=code&&code<=0x2b07){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}}else{if(code<0x2b55){if(code<0x2b50){// E0.6 [2] (⬛..⬜) black large square..white large square +if(0x2b1b<=code&&code<=0x2b1c){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.6 [1] (⭐) star +if(0x2b50===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}else{if(code<0x3030){// E0.6 [1] (⭕) hollow red circle +if(0x2b55===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.6 [1] (〰️) wavy dash +if(0x3030===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}// E0.6 [1] (〽️) part alternation mark +if(0x303d===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}}}else{if(code<0x1f16c){if(code<0x1f000){// E0.6 [1] (㊗️) Japanese “congratulations” button +if(0x3297===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}// E0.6 [1] (㊙️) Japanese “secret” button +if(0x3299===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{if(code<0x1f10d){// E0.0 [4] (🀀..🀃) MAHJONG TILE EAST WIND..MAHJONG TILE NORTH WIND +// E0.6 [1] (🀄) mahjong red dragon +// E0.0 [202] (🀅..🃎) MAHJONG TILE GREEN DRAGON..PLAYING CARD KING OF DIAMONDS +// E0.6 [1] (🃏) joker +// E0.0 [48] (🃐..🃿) .. +if(0x1f000<=code&&code<=0x1f0ff){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{if(code<0x1f12f){// E0.0 [3] (🄍..🄏) CIRCLED ZERO WITH SLASH..CIRCLED DOLLAR SIGN WITH OVERLAID BACKSLASH +if(0x1f10d<=code&&code<=0x1f10f){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.0 [1] (🄯) COPYLEFT SYMBOL +if(0x1f12f===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}}}else{if(code<0x1f18e){if(code<0x1f17e){// E0.0 [4] (🅬..🅯) RAISED MR SIGN..CIRCLED HUMAN FIGURE +// E0.6 [2] (🅰️..🅱️) A button (blood type)..B button (blood type) +if(0x1f16c<=code&&code<=0x1f171){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.6 [2] (🅾️..🅿️) O button (blood type)..P button +if(0x1f17e<=code&&code<=0x1f17f){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}else{if(code<0x1f191){// E0.6 [1] (🆎) AB button (blood type) +if(0x1f18e===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{if(code<0x1f1ad){// E0.6 [10] (🆑..🆚) CL button..VS button +if(0x1f191<=code&&code<=0x1f19a){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.0 [57] (🆭..🇥) MASK WORK SYMBOL.. +if(0x1f1ad<=code&&code<=0x1f1e5){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}}}}}else{if(code<0x1f7d5){if(code<0x1f249){if(code<0x1f22f){if(code<0x1f21a){// E0.6 [2] (🈁..🈂️) Japanese “here” button..Japanese “service charge” button +// E0.0 [13] (🈃..🈏) .. +if(0x1f201<=code&&code<=0x1f20f){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.6 [1] (🈚) Japanese “free of charge” button +if(0x1f21a===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}else{if(code<0x1f232){// E0.6 [1] (🈯) Japanese “reserved” button +if(0x1f22f===code){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{if(code<0x1f23c){// E0.6 [9] (🈲..🈺) Japanese “prohibited” button..Japanese “open for business” button +if(0x1f232<=code&&code<=0x1f23a){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.0 [4] (🈼..🈿) .. +if(0x1f23c<=code&&code<=0x1f23f){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}}}else{if(code<0x1f546){if(code<0x1f400){// E0.0 [7] (🉉..🉏) .. +// E0.6 [2] (🉐..🉑) Japanese “bargain” button..Japanese “acceptable” button +// E0.0 [174] (🉒..🋿) .. +// E0.6 [13] (🌀..🌌) cyclone..milky way +// E0.7 [2] (🌍..🌎) globe showing Europe-Africa..globe showing Americas +// E0.6 [1] (🌏) globe showing Asia-Australia +// E1.0 [1] (🌐) globe with meridians +// E0.6 [1] (🌑) new moon +// E1.0 [1] (🌒) waxing crescent moon +// E0.6 [3] (🌓..🌕) first quarter moon..full moon +// E1.0 [3] (🌖..🌘) waning gibbous moon..waning crescent moon +// E0.6 [1] (🌙) crescent moon +// E1.0 [1] (🌚) new moon face +// E0.6 [1] (🌛) first quarter moon face +// E0.7 [1] (🌜) last quarter moon face +// E1.0 [2] (🌝..🌞) full moon face..sun with face +// E0.6 [2] (🌟..🌠) glowing star..shooting star +// E0.7 [1] (🌡️) thermometer +// E0.0 [2] (🌢..🌣) BLACK DROPLET..WHITE SUN +// E0.7 [9] (🌤️..🌬️) sun behind small cloud..wind face +// E1.0 [3] (🌭..🌯) hot dog..burrito +// E0.6 [2] (🌰..🌱) chestnut..seedling +// E1.0 [2] (🌲..🌳) evergreen tree..deciduous tree +// E0.6 [2] (🌴..🌵) palm tree..cactus +// E0.7 [1] (🌶️) hot pepper +// E0.6 [20] (🌷..🍊) tulip..tangerine +// E1.0 [1] (🍋) lemon +// E0.6 [4] (🍌..🍏) banana..green apple +// E1.0 [1] (🍐) pear +// E0.6 [43] (🍑..🍻) peach..clinking beer mugs +// E1.0 [1] (🍼) baby bottle +// E0.7 [1] (🍽️) fork and knife with plate +// E1.0 [2] (🍾..🍿) bottle with popping cork..popcorn +// E0.6 [20] (🎀..🎓) ribbon..graduation cap +// E0.0 [2] (🎔..🎕) HEART WITH TIP ON THE LEFT..BOUQUET OF FLOWERS +// E0.7 [2] (🎖️..🎗️) military medal..reminder ribbon +// E0.0 [1] (🎘) MUSICAL KEYBOARD WITH JACKS +// E0.7 [3] (🎙️..🎛️) studio microphone..control knobs +// E0.0 [2] (🎜..🎝) BEAMED ASCENDING MUSICAL NOTES..BEAMED DESCENDING MUSICAL NOTES +// E0.7 [2] (🎞️..🎟️) film frames..admission tickets +// E0.6 [37] (🎠..🏄) carousel horse..person surfing +// E1.0 [1] (🏅) sports medal +// E0.6 [1] (🏆) trophy +// E1.0 [1] (🏇) horse racing +// E0.6 [1] (🏈) american football +// E1.0 [1] (🏉) rugby football +// E0.6 [1] (🏊) person swimming +// E0.7 [4] (🏋️..🏎️) person lifting weights..racing car +// E1.0 [5] (🏏..🏓) cricket game..ping pong +// E0.7 [12] (🏔️..🏟️) snow-capped mountain..stadium +// E0.6 [4] (🏠..🏣) house..Japanese post office +// E1.0 [1] (🏤) post office +// E0.6 [12] (🏥..🏰) hospital..castle +// E0.0 [2] (🏱..🏲) WHITE PENNANT..BLACK PENNANT +// E0.7 [1] (🏳️) white flag +// E1.0 [1] (🏴) black flag +// E0.7 [1] (🏵️) rosette +// E0.0 [1] (🏶) BLACK ROSETTE +// E0.7 [1] (🏷️) label +// E1.0 [3] (🏸..🏺) badminton..amphora +if(0x1f249<=code&&code<=0x1f3fa){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E1.0 [8] (🐀..🐇) rat..rabbit +// E0.7 [1] (🐈) cat +// E1.0 [3] (🐉..🐋) dragon..whale +// E0.6 [3] (🐌..🐎) snail..horse +// E1.0 [2] (🐏..🐐) ram..goat +// E0.6 [2] (🐑..🐒) ewe..monkey +// E1.0 [1] (🐓) rooster +// E0.6 [1] (🐔) chicken +// E0.7 [1] (🐕) dog +// E1.0 [1] (🐖) pig +// E0.6 [19] (🐗..🐩) boar..poodle +// E1.0 [1] (🐪) camel +// E0.6 [20] (🐫..🐾) two-hump camel..paw prints +// E0.7 [1] (🐿️) chipmunk +// E0.6 [1] (👀) eyes +// E0.7 [1] (👁️) eye +// E0.6 [35] (👂..👤) ear..bust in silhouette +// E1.0 [1] (👥) busts in silhouette +// E0.6 [6] (👦..👫) boy..woman and man holding hands +// E1.0 [2] (👬..👭) men holding hands..women holding hands +// E0.6 [63] (👮..💬) police officer..speech balloon +// E1.0 [1] (💭) thought balloon +// E0.6 [8] (💮..💵) white flower..dollar banknote +// E1.0 [2] (💶..💷) euro banknote..pound banknote +// E0.6 [52] (💸..📫) money with wings..closed mailbox with raised flag +// E0.7 [2] (📬..📭) open mailbox with raised flag..open mailbox with lowered flag +// E0.6 [1] (📮) postbox +// E1.0 [1] (📯) postal horn +// E0.6 [5] (📰..📴) newspaper..mobile phone off +// E1.0 [1] (📵) no mobile phones +// E0.6 [2] (📶..📷) antenna bars..camera +// E1.0 [1] (📸) camera with flash +// E0.6 [4] (📹..📼) video camera..videocassette +// E0.7 [1] (📽️) film projector +// E0.0 [1] (📾) PORTABLE STEREO +// E1.0 [4] (📿..🔂) prayer beads..repeat single button +// E0.6 [1] (🔃) clockwise vertical arrows +// E1.0 [4] (🔄..🔇) counterclockwise arrows button..muted speaker +// E0.7 [1] (🔈) speaker low volume +// E1.0 [1] (🔉) speaker medium volume +// E0.6 [11] (🔊..🔔) speaker high volume..bell +// E1.0 [1] (🔕) bell with slash +// E0.6 [22] (🔖..🔫) bookmark..water pistol +// E1.0 [2] (🔬..🔭) microscope..telescope +// E0.6 [16] (🔮..🔽) crystal ball..downwards button +if(0x1f400<=code&&code<=0x1f53d){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}else{if(code<0x1f680){// E0.0 [3] (🕆..🕈) WHITE LATIN CROSS..CELTIC CROSS +// E0.7 [2] (🕉️..🕊️) om..dove +// E1.0 [4] (🕋..🕎) kaaba..menorah +// E0.0 [1] (🕏) BOWL OF HYGIEIA +// E0.6 [12] (🕐..🕛) one o’clock..twelve o’clock +// E0.7 [12] (🕜..🕧) one-thirty..twelve-thirty +// E0.0 [7] (🕨..🕮) RIGHT SPEAKER..BOOK +// E0.7 [2] (🕯️..🕰️) candle..mantelpiece clock +// E0.0 [2] (🕱..🕲) BLACK SKULL AND CROSSBONES..NO PIRACY +// E0.7 [7] (🕳️..🕹️) hole..joystick +// E3.0 [1] (🕺) man dancing +// E0.0 [12] (🕻..🖆) LEFT HAND TELEPHONE RECEIVER..PEN OVER STAMPED ENVELOPE +// E0.7 [1] (🖇️) linked paperclips +// E0.0 [2] (🖈..🖉) BLACK PUSHPIN..LOWER LEFT PENCIL +// E0.7 [4] (🖊️..🖍️) pen..crayon +// E0.0 [2] (🖎..🖏) LEFT WRITING HAND..TURNED OK HAND SIGN +// E0.7 [1] (🖐️) hand with fingers splayed +// E0.0 [4] (🖑..🖔) REVERSED RAISED HAND WITH FINGERS SPLAYED..REVERSED VICTORY HAND +// E1.0 [2] (🖕..🖖) middle finger..vulcan salute +// E0.0 [13] (🖗..🖣) WHITE DOWN POINTING LEFT HAND INDEX..BLACK DOWN POINTING BACKHAND INDEX +// E3.0 [1] (🖤) black heart +// E0.7 [1] (🖥️) desktop computer +// E0.0 [2] (🖦..🖧) KEYBOARD AND MOUSE..THREE NETWORKED COMPUTERS +// E0.7 [1] (🖨️) printer +// E0.0 [8] (🖩..🖰) POCKET CALCULATOR..TWO BUTTON MOUSE +// E0.7 [2] (🖱️..🖲️) computer mouse..trackball +// E0.0 [9] (🖳..🖻) OLD PERSONAL COMPUTER..DOCUMENT WITH PICTURE +// E0.7 [1] (🖼️) framed picture +// E0.0 [5] (🖽..🗁) FRAME WITH TILES..OPEN FOLDER +// E0.7 [3] (🗂️..🗄️) card index dividers..file cabinet +// E0.0 [12] (🗅..🗐) EMPTY NOTE..PAGES +// E0.7 [3] (🗑️..🗓️) wastebasket..spiral calendar +// E0.0 [8] (🗔..🗛) DESKTOP WINDOW..DECREASE FONT SIZE SYMBOL +// E0.7 [3] (🗜️..🗞️) clamp..rolled-up newspaper +// E0.0 [2] (🗟..🗠) PAGE WITH CIRCLED TEXT..STOCK CHART +// E0.7 [1] (🗡️) dagger +// E0.0 [1] (🗢) LIPS +// E0.7 [1] (🗣️) speaking head +// E0.0 [4] (🗤..🗧) THREE RAYS ABOVE..THREE RAYS RIGHT +// E2.0 [1] (🗨️) left speech bubble +// E0.0 [6] (🗩..🗮) RIGHT SPEECH BUBBLE..LEFT ANGER BUBBLE +// E0.7 [1] (🗯️) right anger bubble +// E0.0 [3] (🗰..🗲) MOOD BUBBLE..LIGHTNING MOOD +// E0.7 [1] (🗳️) ballot box with ballot +// E0.0 [6] (🗴..🗹) BALLOT SCRIPT X..BALLOT BOX WITH BOLD CHECK +// E0.7 [1] (🗺️) world map +// E0.6 [5] (🗻..🗿) mount fuji..moai +// E1.0 [1] (😀) grinning face +// E0.6 [6] (😁..😆) beaming face with smiling eyes..grinning squinting face +// E1.0 [2] (😇..😈) smiling face with halo..smiling face with horns +// E0.6 [5] (😉..😍) winking face..smiling face with heart-eyes +// E1.0 [1] (😎) smiling face with sunglasses +// E0.6 [1] (😏) smirking face +// E0.7 [1] (😐) neutral face +// E1.0 [1] (😑) expressionless face +// E0.6 [3] (😒..😔) unamused face..pensive face +// E1.0 [1] (😕) confused face +// E0.6 [1] (😖) confounded face +// E1.0 [1] (😗) kissing face +// E0.6 [1] (😘) face blowing a kiss +// E1.0 [1] (😙) kissing face with smiling eyes +// E0.6 [1] (😚) kissing face with closed eyes +// E1.0 [1] (😛) face with tongue +// E0.6 [3] (😜..😞) winking face with tongue..disappointed face +// E1.0 [1] (😟) worried face +// E0.6 [6] (😠..😥) angry face..sad but relieved face +// E1.0 [2] (😦..😧) frowning face with open mouth..anguished face +// E0.6 [4] (😨..😫) fearful face..tired face +// E1.0 [1] (😬) grimacing face +// E0.6 [1] (😭) loudly crying face +// E1.0 [2] (😮..😯) face with open mouth..hushed face +// E0.6 [4] (😰..😳) anxious face with sweat..flushed face +// E1.0 [1] (😴) sleeping face +// E0.6 [1] (😵) face with crossed-out eyes +// E1.0 [1] (😶) face without mouth +// E0.6 [10] (😷..🙀) face with medical mask..weary cat +// E1.0 [4] (🙁..🙄) slightly frowning face..face with rolling eyes +// E0.6 [11] (🙅..🙏) person gesturing NO..folded hands +if(0x1f546<=code&&code<=0x1f64f){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{if(code<0x1f774){// E0.6 [1] (🚀) rocket +// E1.0 [2] (🚁..🚂) helicopter..locomotive +// E0.6 [3] (🚃..🚅) railway car..bullet train +// E1.0 [1] (🚆) train +// E0.6 [1] (🚇) metro +// E1.0 [1] (🚈) light rail +// E0.6 [1] (🚉) station +// E1.0 [2] (🚊..🚋) tram..tram car +// E0.6 [1] (🚌) bus +// E0.7 [1] (🚍) oncoming bus +// E1.0 [1] (🚎) trolleybus +// E0.6 [1] (🚏) bus stop +// E1.0 [1] (🚐) minibus +// E0.6 [3] (🚑..🚓) ambulance..police car +// E0.7 [1] (🚔) oncoming police car +// E0.6 [1] (🚕) taxi +// E1.0 [1] (🚖) oncoming taxi +// E0.6 [1] (🚗) automobile +// E0.7 [1] (🚘) oncoming automobile +// E0.6 [2] (🚙..🚚) sport utility vehicle..delivery truck +// E1.0 [7] (🚛..🚡) articulated lorry..aerial tramway +// E0.6 [1] (🚢) ship +// E1.0 [1] (🚣) person rowing boat +// E0.6 [2] (🚤..🚥) speedboat..horizontal traffic light +// E1.0 [1] (🚦) vertical traffic light +// E0.6 [7] (🚧..🚭) construction..no smoking +// E1.0 [4] (🚮..🚱) litter in bin sign..non-potable water +// E0.6 [1] (🚲) bicycle +// E1.0 [3] (🚳..🚵) no bicycles..person mountain biking +// E0.6 [1] (🚶) person walking +// E1.0 [2] (🚷..🚸) no pedestrians..children crossing +// E0.6 [6] (🚹..🚾) men’s room..water closet +// E1.0 [1] (🚿) shower +// E0.6 [1] (🛀) person taking bath +// E1.0 [5] (🛁..🛅) bathtub..left luggage +// E0.0 [5] (🛆..🛊) TRIANGLE WITH ROUNDED CORNERS..GIRLS SYMBOL +// E0.7 [1] (🛋️) couch and lamp +// E1.0 [1] (🛌) person in bed +// E0.7 [3] (🛍️..🛏️) shopping bags..bed +// E1.0 [1] (🛐) place of worship +// E3.0 [2] (🛑..🛒) stop sign..shopping cart +// E0.0 [2] (🛓..🛔) STUPA..PAGODA +// E12.0 [1] (🛕) hindu temple +// E13.0 [2] (🛖..🛗) hut..elevator +// E0.0 [4] (🛘..🛛) .. +// E15.0 [1] (🛜) wireless +// E14.0 [3] (🛝..🛟) playground slide..ring buoy +// E0.7 [6] (🛠️..🛥️) hammer and wrench..motor boat +// E0.0 [3] (🛦..🛨) UP-POINTING MILITARY AIRPLANE..UP-POINTING SMALL AIRPLANE +// E0.7 [1] (🛩️) small airplane +// E0.0 [1] (🛪) NORTHEAST-POINTING AIRPLANE +// E1.0 [2] (🛫..🛬) airplane departure..airplane arrival +// E0.0 [3] (🛭..🛯) .. +// E0.7 [1] (🛰️) satellite +// E0.0 [2] (🛱..🛲) ONCOMING FIRE ENGINE..DIESEL LOCOMOTIVE +// E0.7 [1] (🛳️) passenger ship +// E3.0 [3] (🛴..🛶) kick scooter..canoe +// E5.0 [2] (🛷..🛸) sled..flying saucer +// E11.0 [1] (🛹) skateboard +// E12.0 [1] (🛺) auto rickshaw +// E13.0 [2] (🛻..🛼) pickup truck..roller skate +// E0.0 [3] (🛽..🛿) .. +if(0x1f680<=code&&code<=0x1f6ff){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.0 [12] (🝴..🝿) LOT OF FORTUNE..ORCUS +if(0x1f774<=code&&code<=0x1f77f){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}}}}else{if(code<0x1f8ae){if(code<0x1f848){if(code<0x1f80c){// E0.0 [11] (🟕..🟟) CIRCLED TRIANGLE.. +// E12.0 [12] (🟠..🟫) orange circle..brown square +// E0.0 [4] (🟬..🟯) .. +// E14.0 [1] (🟰) heavy equals sign +// E0.0 [15] (🟱..🟿) .. +if(0x1f7d5<=code&&code<=0x1f7ff){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.0 [4] (🠌..🠏) .. +if(0x1f80c<=code&&code<=0x1f80f){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}else{if(code<0x1f85a){// E0.0 [8] (🡈..🡏) .. +if(0x1f848<=code&&code<=0x1f84f){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{if(code<0x1f888){// E0.0 [6] (🡚..🡟) .. +if(0x1f85a<=code&&code<=0x1f85f){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.0 [8] (🢈..🢏) .. +if(0x1f888<=code&&code<=0x1f88f){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}}}else{if(code<0x1f93c){if(code<0x1f90c){// E0.0 [82] (🢮..🣿) .. +if(0x1f8ae<=code&&code<=0x1f8ff){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E13.0 [1] (🤌) pinched fingers +// E12.0 [3] (🤍..🤏) white heart..pinching hand +// E1.0 [9] (🤐..🤘) zipper-mouth face..sign of the horns +// E3.0 [6] (🤙..🤞) call me hand..crossed fingers +// E5.0 [1] (🤟) love-you gesture +// E3.0 [8] (🤠..🤧) cowboy hat face..sneezing face +// E5.0 [8] (🤨..🤯) face with raised eyebrow..exploding head +// E3.0 [1] (🤰) pregnant woman +// E5.0 [2] (🤱..🤲) breast-feeding..palms up together +// E3.0 [8] (🤳..🤺) selfie..person fencing +if(0x1f90c<=code&&code<=0x1f93a){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}else{if(code<0x1f947){// E3.0 [3] (🤼..🤾) people wrestling..person playing handball +// E12.0 [1] (🤿) diving mask +// E3.0 [6] (🥀..🥅) wilted flower..goal net +if(0x1f93c<=code&&code<=0x1f945){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{if(code<0x1fc00){// E3.0 [5] (🥇..🥋) 1st place medal..martial arts uniform +// E5.0 [1] (🥌) curling stone +// E11.0 [3] (🥍..🥏) lacrosse..flying disc +// E3.0 [15] (🥐..🥞) croissant..pancakes +// E5.0 [13] (🥟..🥫) dumpling..canned food +// E11.0 [5] (🥬..🥰) leafy green..smiling face with hearts +// E12.0 [1] (🥱) yawning face +// E13.0 [1] (🥲) smiling face with tear +// E11.0 [4] (🥳..🥶) partying face..cold face +// E13.0 [2] (🥷..🥸) ninja..disguised face +// E14.0 [1] (🥹) face holding back tears +// E11.0 [1] (🥺) pleading face +// E12.0 [1] (🥻) sari +// E11.0 [4] (🥼..🥿) lab coat..flat shoe +// E1.0 [5] (🦀..🦄) crab..unicorn +// E3.0 [13] (🦅..🦑) eagle..squid +// E5.0 [6] (🦒..🦗) giraffe..cricket +// E11.0 [11] (🦘..🦢) kangaroo..swan +// E13.0 [2] (🦣..🦤) mammoth..dodo +// E12.0 [6] (🦥..🦪) sloth..oyster +// E13.0 [3] (🦫..🦭) beaver..seal +// E12.0 [2] (🦮..🦯) guide dog..white cane +// E11.0 [10] (🦰..🦹) red hair..supervillain +// E12.0 [6] (🦺..🦿) safety vest..mechanical leg +// E1.0 [1] (🧀) cheese wedge +// E11.0 [2] (🧁..🧂) cupcake..salt +// E12.0 [8] (🧃..🧊) beverage box..ice +// E13.0 [1] (🧋) bubble tea +// E14.0 [1] (🧌) troll +// E12.0 [3] (🧍..🧏) person standing..deaf person +// E5.0 [23] (🧐..🧦) face with monocle..socks +// E11.0 [25] (🧧..🧿) red envelope..nazar amulet +// E0.0 [112] (🨀..🩯) NEUTRAL CHESS KING.. +// E12.0 [4] (🩰..🩳) ballet shoes..shorts +// E13.0 [1] (🩴) thong sandal +// E15.0 [3] (🩵..🩷) light blue heart..pink heart +// E12.0 [3] (🩸..🩺) drop of blood..stethoscope +// E14.0 [2] (🩻..🩼) x-ray..crutch +// E0.0 [3] (🩽..🩿) .. +// E12.0 [3] (🪀..🪂) yo-yo..parachute +// E13.0 [4] (🪃..🪆) boomerang..nesting dolls +// E15.0 [2] (🪇..🪈) maracas..flute +// E0.0 [7] (🪉..🪏) .. +// E12.0 [6] (🪐..🪕) ringed planet..banjo +// E13.0 [19] (🪖..🪨) military helmet..rock +// E14.0 [4] (🪩..🪬) mirror ball..hamsa +// E15.0 [3] (🪭..🪯) folding hand fan..khanda +// E13.0 [7] (🪰..🪶) fly..feather +// E14.0 [4] (🪷..🪺) lotus..nest with eggs +// E15.0 [3] (🪻..🪽) hyacinth..wing +// E0.0 [1] (🪾) +// E15.0 [1] (🪿) goose +// E13.0 [3] (🫀..🫂) anatomical heart..people hugging +// E14.0 [3] (🫃..🫅) pregnant man..person with crown +// E0.0 [8] (🫆..🫍) .. +// E15.0 [2] (🫎..🫏) moose..donkey +// E13.0 [7] (🫐..🫖) blueberries..teapot +// E14.0 [3] (🫗..🫙) pouring liquid..jar +// E15.0 [2] (🫚..🫛) ginger root..pea pod +// E0.0 [4] (🫜..🫟) .. +// E14.0 [8] (🫠..🫧) melting face..bubbles +// E15.0 [1] (🫨) shaking face +// E0.0 [7] (🫩..🫯) .. +// E14.0 [7] (🫰..🫶) hand with index finger and thumb crossed..heart hands +// E15.0 [2] (🫷..🫸) leftwards pushing hand..rightwards pushing hand +// E0.0 [7] (🫹..🫿) .. +if(0x1f947<=code&&code<=0x1faff){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}else{// E0.0[1022] (🰀..🿽) .. +if(0x1fc00<=code&&code<=0x1fffd){return boundaries_1.EXTENDED_PICTOGRAPHIC;}}}}}}}}// unlisted code points are treated as a break property of "Other" +return boundaries_1.CLUSTER_BREAK.OTHER;}}exports["default"]=Graphemer; + +/***/ }), +/* 666 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +/** + * The Grapheme_Cluster_Break property value + * @see https://www.unicode.org/reports/tr29/#Default_Grapheme_Cluster_Table + */ +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.EXTENDED_PICTOGRAPHIC = exports.CLUSTER_BREAK = void 0; +var CLUSTER_BREAK; +(function (CLUSTER_BREAK) { + CLUSTER_BREAK[CLUSTER_BREAK["CR"] = 0] = "CR"; + CLUSTER_BREAK[CLUSTER_BREAK["LF"] = 1] = "LF"; + CLUSTER_BREAK[CLUSTER_BREAK["CONTROL"] = 2] = "CONTROL"; + CLUSTER_BREAK[CLUSTER_BREAK["EXTEND"] = 3] = "EXTEND"; + CLUSTER_BREAK[CLUSTER_BREAK["REGIONAL_INDICATOR"] = 4] = "REGIONAL_INDICATOR"; + CLUSTER_BREAK[CLUSTER_BREAK["SPACINGMARK"] = 5] = "SPACINGMARK"; + CLUSTER_BREAK[CLUSTER_BREAK["L"] = 6] = "L"; + CLUSTER_BREAK[CLUSTER_BREAK["V"] = 7] = "V"; + CLUSTER_BREAK[CLUSTER_BREAK["T"] = 8] = "T"; + CLUSTER_BREAK[CLUSTER_BREAK["LV"] = 9] = "LV"; + CLUSTER_BREAK[CLUSTER_BREAK["LVT"] = 10] = "LVT"; + CLUSTER_BREAK[CLUSTER_BREAK["OTHER"] = 11] = "OTHER"; + CLUSTER_BREAK[CLUSTER_BREAK["PREPEND"] = 12] = "PREPEND"; + CLUSTER_BREAK[CLUSTER_BREAK["E_BASE"] = 13] = "E_BASE"; + CLUSTER_BREAK[CLUSTER_BREAK["E_MODIFIER"] = 14] = "E_MODIFIER"; + CLUSTER_BREAK[CLUSTER_BREAK["ZWJ"] = 15] = "ZWJ"; + CLUSTER_BREAK[CLUSTER_BREAK["GLUE_AFTER_ZWJ"] = 16] = "GLUE_AFTER_ZWJ"; + CLUSTER_BREAK[CLUSTER_BREAK["E_BASE_GAZ"] = 17] = "E_BASE_GAZ"; +})(CLUSTER_BREAK = exports.CLUSTER_BREAK || (exports.CLUSTER_BREAK = {})); +/** + * The Emoji character property is an extension of UCD but shares the same namespace and structure + * @see http://www.unicode.org/reports/tr51/tr51-14.html#Emoji_Properties_and_Data_Files + * + * Here we model Extended_Pictograhpic only to implement UAX #29 GB11 + * \p{Extended_Pictographic} Extend* ZWJ × \p{Extended_Pictographic} + * + * The Emoji character property should not be mixed with Grapheme_Cluster_Break since they are not exclusive + */ +exports.EXTENDED_PICTOGRAPHIC = 101; + +/***/ }), +/* 667 */ +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +const boundaries_1 = __webpack_require__(666); +// BreakTypes +// @type {BreakType} +const NotBreak = 0; +const BreakStart = 1; +const Break = 2; +const BreakLastRegional = 3; +const BreakPenultimateRegional = 4; +class GraphemerHelper { + /** + * Check if the the character at the position {pos} of the string is surrogate + * @param str {string} + * @param pos {number} + * @returns {boolean} + */ + static isSurrogate(str, pos) { + return 0xd800 <= str.charCodeAt(pos) && str.charCodeAt(pos) <= 0xdbff && 0xdc00 <= str.charCodeAt(pos + 1) && str.charCodeAt(pos + 1) <= 0xdfff; + } + /** + * The String.prototype.codePointAt polyfill + * Private function, gets a Unicode code point from a JavaScript UTF-16 string + * handling surrogate pairs appropriately + * @param str {string} + * @param idx {number} + * @returns {number} + */ + static codePointAt(str, idx) { + if (idx === undefined) { + idx = 0; + } + const code = str.charCodeAt(idx); + // if a high surrogate + if (0xd800 <= code && code <= 0xdbff && idx < str.length - 1) { + const hi = code; + const low = str.charCodeAt(idx + 1); + if (0xdc00 <= low && low <= 0xdfff) { + return (hi - 0xd800) * 0x400 + (low - 0xdc00) + 0x10000; + } + return hi; + } + // if a low surrogate + if (0xdc00 <= code && code <= 0xdfff && idx >= 1) { + const hi = str.charCodeAt(idx - 1); + const low = code; + if (0xd800 <= hi && hi <= 0xdbff) { + return (hi - 0xd800) * 0x400 + (low - 0xdc00) + 0x10000; + } + return low; + } + // just return the char if an unmatched surrogate half or a + // single-char codepoint + return code; + } + // + /** + * Private function, returns whether a break is allowed between the two given grapheme breaking classes + * Implemented the UAX #29 3.1.1 Grapheme Cluster Boundary Rules on extended grapheme clusters + * @param start {number} + * @param mid {Array} + * @param end {number} + * @param startEmoji {number} + * @param midEmoji {Array} + * @param endEmoji {number} + * @returns {number} + */ + static shouldBreak(start, mid, end, startEmoji, midEmoji, endEmoji) { + const all = [start].concat(mid).concat([end]); + const allEmoji = [startEmoji].concat(midEmoji).concat([endEmoji]); + const previous = all[all.length - 2]; + const next = end; + const nextEmoji = endEmoji; + // Lookahead terminator for: + // GB12. ^ (RI RI)* RI ? RI + // GB13. [^RI] (RI RI)* RI ? RI + const rIIndex = all.lastIndexOf(boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR); + if (rIIndex > 0 && all.slice(1, rIIndex).every(function (c) { + return c === boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR; + }) && [boundaries_1.CLUSTER_BREAK.PREPEND, boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR].indexOf(previous) === -1) { + if (all.filter(function (c) { + return c === boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR; + }).length % 2 === 1) { + return BreakLastRegional; + } else { + return BreakPenultimateRegional; + } + } + // GB3. CR × LF + if (previous === boundaries_1.CLUSTER_BREAK.CR && next === boundaries_1.CLUSTER_BREAK.LF) { + return NotBreak; + } + // GB4. (Control|CR|LF) ÷ + else if (previous === boundaries_1.CLUSTER_BREAK.CONTROL || previous === boundaries_1.CLUSTER_BREAK.CR || previous === boundaries_1.CLUSTER_BREAK.LF) { + return BreakStart; + } + // GB5. ÷ (Control|CR|LF) + else if (next === boundaries_1.CLUSTER_BREAK.CONTROL || next === boundaries_1.CLUSTER_BREAK.CR || next === boundaries_1.CLUSTER_BREAK.LF) { + return BreakStart; + } + // GB6. L × (L|V|LV|LVT) + else if (previous === boundaries_1.CLUSTER_BREAK.L && (next === boundaries_1.CLUSTER_BREAK.L || next === boundaries_1.CLUSTER_BREAK.V || next === boundaries_1.CLUSTER_BREAK.LV || next === boundaries_1.CLUSTER_BREAK.LVT)) { + return NotBreak; + } + // GB7. (LV|V) × (V|T) + else if ((previous === boundaries_1.CLUSTER_BREAK.LV || previous === boundaries_1.CLUSTER_BREAK.V) && (next === boundaries_1.CLUSTER_BREAK.V || next === boundaries_1.CLUSTER_BREAK.T)) { + return NotBreak; + } + // GB8. (LVT|T) × (T) + else if ((previous === boundaries_1.CLUSTER_BREAK.LVT || previous === boundaries_1.CLUSTER_BREAK.T) && next === boundaries_1.CLUSTER_BREAK.T) { + return NotBreak; + } + // GB9. × (Extend|ZWJ) + else if (next === boundaries_1.CLUSTER_BREAK.EXTEND || next === boundaries_1.CLUSTER_BREAK.ZWJ) { + return NotBreak; + } + // GB9a. × SpacingMark + else if (next === boundaries_1.CLUSTER_BREAK.SPACINGMARK) { + return NotBreak; + } + // GB9b. Prepend × + else if (previous === boundaries_1.CLUSTER_BREAK.PREPEND) { + return NotBreak; + } + // GB11. \p{Extended_Pictographic} Extend* ZWJ × \p{Extended_Pictographic} + const previousNonExtendIndex = allEmoji.slice(0, -1).lastIndexOf(boundaries_1.EXTENDED_PICTOGRAPHIC); + if (previousNonExtendIndex !== -1 && allEmoji[previousNonExtendIndex] === boundaries_1.EXTENDED_PICTOGRAPHIC && all.slice(previousNonExtendIndex + 1, -2).every(function (c) { + return c === boundaries_1.CLUSTER_BREAK.EXTEND; + }) && previous === boundaries_1.CLUSTER_BREAK.ZWJ && nextEmoji === boundaries_1.EXTENDED_PICTOGRAPHIC) { + return NotBreak; + } + // GB12. ^ (RI RI)* RI × RI + // GB13. [^RI] (RI RI)* RI × RI + if (mid.indexOf(boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR) !== -1) { + return Break; + } + if (previous === boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR && next === boundaries_1.CLUSTER_BREAK.REGIONAL_INDICATOR) { + return NotBreak; + } + // GB999. Any ? Any + return BreakStart; + } +} +exports["default"] = GraphemerHelper; + +/***/ }), +/* 668 */ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +/** + * GraphemerIterator + * + * Takes a string and a "BreakHandler" method during initialisation + * and creates an iterable object that returns individual graphemes. + * + * @param str {string} + * @return GraphemerIterator + */ +class GraphemerIterator { + constructor(str, nextBreak) { + this._index = 0; + this._str = str; + this._nextBreak = nextBreak; + } + [Symbol.iterator]() { + return this; + } + next() { + let brk; + if ((brk = this._nextBreak(this._str, this._index)) < this._str.length) { + const value = this._str.slice(this._index, brk); + this._index = brk; + return { + value: value, + done: false + }; + } + if (this._index < this._str.length) { + const value = this._str.slice(this._index); + this._index = this._str.length; + return { + value: value, + done: false + }; + } + return { + value: undefined, + done: true + }; + } +} +exports["default"] = GraphemerIterator; + +/***/ }), +/* 669 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -68662,20 +63373,20 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent spacing inside computed property brackets", recommended: false, - url: "https://eslint.org/docs/rules/computed-property-spacing" + url: "https://eslint.org/docs/latest/rules/computed-property-spacing" }, fixable: "whitespace", schema: [{ @@ -68697,12 +63408,12 @@ module.exports = { missingSpaceAfter: "A space is required after '{{tokenValue}}'." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const propertyNameMustBeSpaced = context.options[0] === "always"; // default is "never" + const enforceForClassMembers = !context.options[1] || context.options[1].enforceForClassMembers; - const enforceForClassMembers = !context.options[1] || context.options[1].enforceForClassMembers; //-------------------------------------------------------------------------- + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -68713,7 +63424,6 @@ module.exports = { * @param {Token} tokenAfter The token after `token`. * @returns {void} */ - function reportNoBeginningSpace(node, token, tokenAfter) { context.report({ node, @@ -68725,13 +63435,12 @@ module.exports = { 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. @@ -68739,8 +63448,6 @@ module.exports = { * @param {Token} tokenBefore The token before `token`. * @returns {void} */ - - function reportNoEndingSpace(node, token, tokenBefore) { context.report({ node, @@ -68752,21 +63459,18 @@ module.exports = { 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, @@ -68775,21 +63479,18 @@ module.exports = { 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, @@ -68798,37 +63499,32 @@ module.exports = { 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 - }); - + 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)) { @@ -68840,7 +63536,6 @@ module.exports = { } } } - if (astUtils.isTokenOnSameLine(last, after)) { if (propertyNameMustBeSpaced) { if (!sourceCode.isSpaceBetweenTokens(last, after) && astUtils.isTokenOnSameLine(last, after)) { @@ -68853,27 +63548,25 @@ module.exports = { } } }; - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- - const listeners = { Property: checkSpacing("key"), MemberExpression: checkSpacing("property") }; - if (enforceForClassMembers) { listeners.MethodDefinition = listeners.PropertyDefinition = listeners.Property; } - return listeners; } - }; /***/ }), -/* 644 */ +/* 670 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -68881,15 +63574,17 @@ module.exports = { * @fileoverview Rule to flag consistent return values * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - -const astUtils = __webpack_require__(618); - +const astUtils = __webpack_require__(639); const { upperCaseFirst -} = __webpack_require__(642); //------------------------------------------------------------------------------ +} = __webpack_require__(663); + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -68898,34 +63593,31 @@ const { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Require `return` statements to either always or never specify values", recommended: false, - url: "https://eslint.org/docs/rules/consistent-return" + url: "https://eslint.org/docs/latest/rules/consistent-return" }, schema: [{ type: "object", @@ -68943,30 +63635,29 @@ module.exports = { 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. - + } + // Adjust a location and a message. if (node.type === "Program") { // The head of program. loc = { @@ -68976,20 +63667,19 @@ module.exports = { name = "program"; } else if (node.type === "ArrowFunctionExpression") { // `=>` token - loc = context.getSourceCode().getTokenBefore(node.body, astUtils.isArrowToken).loc; + loc = context.sourceCode.getTokenBefore(node.body, astUtils.isArrowToken).loc; } else if (node.parent.type === "MethodDefinition" || node.parent.type === "Property" && node.parent.method) { // Method name. loc = node.parent.key.loc; } else { // Function name or `function` keyword. - loc = (node.id || context.getSourceCode().getFirstToken(node)).loc; + loc = (node.id || context.sourceCode.getFirstToken(node)).loc; } - if (!name) { name = astUtils.getFunctionNameWithKind(node); - } // Reports. - + } + // Reports. context.report({ node, loc, @@ -68999,7 +63689,6 @@ module.exports = { } }); } - return { // Initializes/Disposes state of each code path. onCodePathStart(codePath, node) { @@ -69012,20 +63701,16 @@ module.exports = { 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; @@ -69041,7 +63726,6 @@ module.exports = { }); } }, - // Reports a given program/function if the implicit returning is not consistent. "Program:exit": checkLastSegment, "FunctionDeclaration:exit": checkLastSegment, @@ -69049,11 +63733,10 @@ module.exports = { "ArrowFunctionExpression:exit": checkLastSegment }; } - }; /***/ }), -/* 645 */ +/* 671 */ /***/ ((module) => { "use strict"; @@ -69061,19 +63744,20 @@ module.exports = { * @fileoverview Rule to enforce consistent naming of "this" context variables * @author Raphael Pigulla */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce consistent naming when capturing the current execution context", recommended: false, - url: "https://eslint.org/docs/rules/consistent-this" + url: "https://eslint.org/docs/latest/rules/consistent-this" }, schema: { type: "array", @@ -69088,15 +63772,15 @@ module.exports = { unexpectedAlias: "Unexpected alias '{{name}}' for 'this'." } }, - create(context) { let aliases = []; - + const sourceCode = context.sourceCode; 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. @@ -69104,8 +63788,6 @@ module.exports = { * @param {string} name the name of the alias that was incorrectly used. * @returns {void} */ - - function reportBadAssignment(node, name) { context.report({ node, @@ -69115,6 +63797,7 @@ module.exports = { } }); } + /** * Checks that an assignment to an identifier only assigns 'this' to the * appropriate alias, and the alias is only assigned to 'this'. @@ -69123,11 +63806,8 @@ module.exports = { * @param {Expression} value The value of the assignment. * @returns {void} */ - - function checkAssignment(node, name, value) { const isThis = value.type === "ThisExpression"; - if (aliases.includes(name)) { if (!isThis || node.operator && node.operator !== "=") { reportBadAssignment(node, name); @@ -69142,6 +63822,7 @@ module.exports = { }); } } + /** * Ensures that a variable declaration of the alias in a program or function * is assigned to the correct value. @@ -69150,24 +63831,19 @@ module.exports = { * @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 === "="; @@ -69177,46 +63853,40 @@ module.exports = { }); } } + /** * Check each alias to ensure that is was assigned to the correct value. + * @param {ASTNode} node The node that represents the scope to check. * @returns {void} */ - - - function ensureWasAssigned() { - const scope = context.getScope(); + function ensureWasAssigned(node) { + const scope = sourceCode.getScope(node); 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); } } - }; } - }; /***/ }), -/* 646 */ +/* 672 */ /***/ ((module) => { "use strict"; @@ -69224,7 +63894,10 @@ module.exports = { * @fileoverview A rule to verify `super()` callings in constructor. * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -69233,10 +63906,10 @@ module.exports = { * @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 @@ -69244,23 +63917,19 @@ function isReachable(segment) { * `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": @@ -69273,27 +63942,22 @@ function isPossibleConstructor(node) { 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": /* * If the && operator short-circuits, the left side was falsy and therefore not a constructor, and if @@ -69304,35 +63968,31 @@ function isPossibleConstructor(node) { if (node.operator === "&&") { return isPossibleConstructor(node.right); } - 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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Require `super()` calls in constructors", recommended: true, - url: "https://eslint.org/docs/rules/constructor-super" + url: "https://eslint.org/docs/latest/rules/constructor-super" }, schema: [], messages: { @@ -69343,7 +64003,6 @@ module.exports = { unexpected: "Unexpected 'super()'." } }, - create(context) { /* * {{hasExtends: boolean, scope: Scope, codePath: CodePath}[]} @@ -69355,6 +64014,7 @@ module.exports = { * - codePath: The code path object of the constructor. */ let funcInfo = null; + /* * {Map} * Information for each code path segment. @@ -69362,24 +64022,22 @@ module.exports = { * - 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, @@ -69389,10 +64047,8 @@ module.exports = { if (segment.nextSegments.length === 1 && segment.nextSegments[0].isLoopedPrevSegment(segment)) { return true; } - return segment.reachable && segInfoMap[segment.id].calledInEveryPaths; } - return { /** * Stacks a constructor information. @@ -69422,7 +64078,6 @@ module.exports = { }; } }, - /** * Pops a constructor information. * And reports if `super()` lacked. @@ -69431,19 +64086,18 @@ module.exports = { * @returns {void} */ onCodePathEnd(codePath, node) { - const hasExtends = funcInfo.hasExtends; // Pop. + const hasExtends = funcInfo.hasExtends; + // Pop. funcInfo = funcInfo.upper; - if (!hasExtends) { return; - } // Reports if `super()` lacked. - + } + // 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", @@ -69451,7 +64105,6 @@ module.exports = { }); } }, - /** * Initialize information of a given code path segment. * @param {CodePathSegment} segment A code path segment to initialize. @@ -69460,23 +64113,22 @@ module.exports = { onCodePathSegmentStart(segment) { if (!(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends)) { return; - } // Initialize info. - + } + // Initialize info. const info = segInfoMap[segment.id] = { calledInSomePaths: false, calledInEveryPaths: false, validNodes: [] - }; // When there are previous segments, aggregates these. + }; + // 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. @@ -69489,24 +64141,25 @@ module.exports = { onCodePathSegmentLoop(fromSegment, toSegment) { if (!(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends)) { return; - } // Update information inside of the loop. - + } + // 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. + 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. + 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({ @@ -69517,7 +64170,6 @@ module.exports = { } }); }, - /** * Checks for a call of `super()`. * @param {ASTNode} node A CallExpression node to check. @@ -69526,29 +64178,26 @@ module.exports = { "CallExpression:exit"(node) { if (!(funcInfo && funcInfo.isConstructor)) { return; - } // Skips except `super()`. - + } + // Skips except `super()`. if (node.callee.type !== "Super") { return; - } // Reports if needed. - + } + // 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({ @@ -69571,7 +64220,6 @@ module.exports = { }); } }, - /** * Set the mark to the returned path as `super()` was called. * @param {ASTNode} node A ReturnStatement node to check. @@ -69580,26 +64228,23 @@ module.exports = { ReturnStatement(node) { if (!(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends)) { return; - } // Skips if no argument. - + } + // Skips if no argument. if (!node.argument) { return; - } // Returning argument is a substitute of 'super()'. - + } + // 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} @@ -69607,14 +64252,12 @@ module.exports = { "Program:exit"() { segInfoMap = Object.create(null); } - }; } - }; /***/ }), -/* 647 */ +/* 673 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -69622,24 +64265,25 @@ module.exports = { * @fileoverview Rule to flag statements without curly braces * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce consistent brace style for all control statements", recommended: false, - url: "https://eslint.org/docs/rules/curly" + url: "https://eslint.org/docs/latest/rules/curly" }, schema: { anyOf: [{ @@ -69668,13 +64312,14 @@ module.exports = { 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(); //-------------------------------------------------------------------------- + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -69684,89 +64329,78 @@ module.exports = { * @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"; } + /** * 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), @@ -69775,25 +64409,23 @@ module.exports = { */ 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. - + } + // 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. @@ -69844,17 +64476,13 @@ module.exports = { * @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": @@ -69862,11 +64490,11 @@ module.exports = { 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: @@ -69895,12 +64523,11 @@ module.exports = { * @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. @@ -69915,12 +64542,9 @@ module.exports = { * "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) { @@ -69928,8 +64552,9 @@ module.exports = { } else if (multiLine) { if (!isCollapsedOneLiner(body)) { expected = true; - } // otherwise, the body is allowed to have braces or not to have braces + } + // otherwise, the body is allowed to have braces or not to have braces } else if (multiOrNest) { if (hasBlock) { const statement = body.body[0]; @@ -69942,11 +64567,9 @@ module.exports = { // default "all" expected = true; } - return { actual: hasBlock, expected, - check() { if (this.expected !== null && this.expected !== this.actual) { if (this.expected) { @@ -69967,7 +64590,6 @@ module.exports = { data: { name }, - fix(fixer) { /* * `do while` expressions sometimes need a space to be inserted after `do`. @@ -69979,7 +64601,6 @@ module.exports = { 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 @@ -69987,40 +64608,33 @@ module.exports = { */ 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 @@ -70031,32 +64645,31 @@ module.exports = { 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) + } + // Skip `else if`, it's already checked (when the top `if` was visited) }, WhileStatement(node) { @@ -70064,32 +64677,26 @@ module.exports = { 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(); } - }; } - }; /***/ }), -/* 648 */ +/* 674 */ /***/ ((module) => { "use strict"; @@ -70099,19 +64706,20 @@ module.exports = { */ -const DEFAULT_COMMENT_PATTERN = /^no default$/iu; //------------------------------------------------------------------------------ +const DEFAULT_COMMENT_PATTERN = /^no default$/iu; + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Require `default` cases in `switch` statements", recommended: false, - url: "https://eslint.org/docs/rules/default-case" + url: "https://eslint.org/docs/latest/rules/default-case" }, schema: [{ type: "object", @@ -70126,11 +64734,12 @@ module.exports = { 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(); //-------------------------------------------------------------------------- + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -70139,14 +64748,14 @@ module.exports = { * @param {*[]} collection Array * @returns {any} Last element */ - function last(collection) { return collection[collection.length - 1]; - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- - return { SwitchStatement(node) { if (!node.cases.length) { @@ -70156,18 +64765,14 @@ module.exports = { */ 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, @@ -70176,14 +64781,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 649 */ +/* 675 */ /***/ ((module) => { "use strict"; @@ -70191,32 +64794,32 @@ module.exports = { * @fileoverview Rule to enforce default clauses in switch statements to be last * @author Milos Djermanovic */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce default clauses in switch statements to be last", recommended: false, - url: "https://eslint.org/docs/rules/default-case-last" + url: "https://eslint.org/docs/latest/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); - + indexOfDefault = cases.findIndex(c => c.test === null); if (indexOfDefault !== -1 && indexOfDefault !== cases.length - 1) { const defaultClause = cases[indexOfDefault]; context.report({ @@ -70225,14 +64828,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 650 */ +/* 676 */ /***/ ((module) => { "use strict"; @@ -70241,22 +64842,22 @@ module.exports = { * @author Chiawen Chen */ -/** @type {import('../shared/types').Rule} */ + +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { description: "Enforce default parameters to be last", recommended: false, - url: "https://eslint.org/docs/rules/default-param-last" + url: "https://eslint.org/docs/latest/rules/default-param-last" }, schema: [], messages: { shouldBeLast: "Default parameters should be last." } }, - create(context) { /** * Handler for function contexts. @@ -70265,15 +64866,12 @@ module.exports = { */ 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, @@ -70282,18 +64880,16 @@ module.exports = { } } } - return { FunctionDeclaration: handleFunction, FunctionExpression: handleFunction, ArrowFunctionExpression: handleFunction }; } - }; /***/ }), -/* 651 */ +/* 677 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -70303,20 +64899,21 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent newlines before and after dots", recommended: false, - url: "https://eslint.org/docs/rules/dot-location" + url: "https://eslint.org/docs/latest/rules/dot-location" }, schema: [{ enum: ["object", "property"] @@ -70327,42 +64924,37 @@ module.exports = { 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 config = context.options[0]; + // default to onObject if no preference is passed const onObject = config === "object" || !config; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * Reports if the dot between object and property is on the correct location. * @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)) { @@ -70370,37 +64962,32 @@ module.exports = { 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 }; } - }; /***/ }), -/* 652 */ +/* 678 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -70408,29 +64995,31 @@ module.exports = { * @fileoverview Rule to warn about using dot notation instead of square bracket notation when possible. * @author Josh Perez */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); +const keywords = __webpack_require__(679); -const astUtils = __webpack_require__(618); - -const keywords = __webpack_require__(653); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +const validIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/u; -const validIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/u; // `null` literal must be handled separately. - +// `null` literal must be handled separately. const literalTypesToCheck = new Set(["string", "boolean"]); -/** @type {import('../shared/types').Rule} */ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { description: "Enforce dot notation whenever possible", recommended: false, - url: "https://eslint.org/docs/rules/dot-notation" + url: "https://eslint.org/docs/latest/rules/dot-notation" }, schema: [{ type: "object", @@ -70452,24 +65041,21 @@ module.exports = { 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(); + const sourceCode = context.sourceCode; 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.includes(String(value))) && !(allowPattern && allowPattern.test(value))) { const formattedValue = node.property.type === "Literal" ? JSON.stringify(value) : `\`${value}\``; @@ -70479,42 +65065,38 @@ module.exports = { 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. + const nextToken = sourceCode.getTokenAfter(node); + // Don't perform any fixes if there are comments inside the brackets. if (sourceCode.commentsExistBetween(leftBracket, rightBracket)) { return; - } // Replace the brackets by an identifier. - + } + // 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); - 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. - + // 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 && node.property.type === "Identifier" && keywords.includes(String(node.property.name))) { context.report({ node: node.property, @@ -70522,38 +65104,34 @@ module.exports = { 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. + 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; - } // Don't perform any fixes if there are comments between the dot and the property name. - + } + // Don't perform any fixes if there are comments between the dot and the property name. if (sourceCode.commentsExistBetween(dotToken, node.property)) { return; - } // Replace the identifier to brackets. - + } + // Replace the identifier to brackets. if (!node.optional) { yield fixer.remove(dotToken); } - yield fixer.replaceText(node.property, `["${node.property.name}"]`); } - }); } } - }; } - }; /***/ }), -/* 653 */ +/* 679 */ /***/ ((module) => { "use strict"; @@ -70566,7 +65144,7 @@ module.exports = { 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"]; /***/ }), -/* 654 */ +/* 680 */ /***/ ((module) => { "use strict"; @@ -70574,19 +65152,20 @@ module.exports = ["abstract", "boolean", "break", "byte", "case", "catch", "char * @fileoverview Require or disallow newline at the end of files * @author Nodeca Team */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "layout", docs: { description: "Require or disallow newline at the end of files", recommended: false, - url: "https://eslint.org/docs/rules/eol-last" + url: "https://eslint.org/docs/latest/rules/eol-last" }, fixable: "whitespace", schema: [{ @@ -70597,61 +65176,56 @@ module.exports = { unexpected: "Newline not allowed at end of file." } }, - create(context) { //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- + return { Program: function checkBadEOF(node) { - const sourceCode = context.getSourceCode(), - src = sourceCode.getText(), - lastLine = sourceCode.lines[sourceCode.lines.length - 1], - location = { - column: lastLine.length, - line: sourceCode.lines.length - }, - LF = "\n", - CRLF = `\r${LF}`, - endsWithNewline = src.endsWith(LF); + const sourceCode = context.sourceCode, + src = sourceCode.getText(), + lastLine = sourceCode.lines[sourceCode.lines.length - 1], + location = { + column: lastLine.length, + line: sourceCode.lines.length + }, + LF = "\n", + CRLF = `\r${LF}`, + endsWithNewline = src.endsWith(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; - + 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) { - const secondLastLine = sourceCode.lines[sourceCode.lines.length - 2]; // File is newline-terminated, but shouldn't be + const secondLastLine = sourceCode.lines[sourceCode.lines.length - 2]; + // File is newline-terminated, but shouldn't be context.report({ node, loc: { @@ -70665,25 +65239,22 @@ module.exports = { } }, messageId: "unexpected", - fix(fixer) { const finalEOLs = /(?:\r?\n)+$/u, - match = finalEOLs.exec(sourceCode.text), - start = match.index, - end = sourceCode.text.length; + match = finalEOLs.exec(sourceCode.text), + start = match.index, + end = sourceCode.text.length; return fixer.replaceTextRange([start, end], ""); } - }); } } }; } - }; /***/ }), -/* 655 */ +/* 681 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -70691,24 +65262,26 @@ module.exports = { * @fileoverview Rule to flag statements that use != and == instead of !== and === * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Require the use of `===` and `!==`", recommended: false, - url: "https://eslint.org/docs/rules/eqeqeq" + url: "https://eslint.org/docs/latest/rules/eqeqeq" }, schema: { anyOf: [{ @@ -70738,56 +65311,53 @@ module.exports = { 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 sourceCode = context.sourceCode; 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 @@ -70795,8 +65365,6 @@ module.exports = { * @returns {void} * @private */ - - function report(node, expectedOperator) { const operatorToken = sourceCode.getFirstTokenBetween(node.left, node.right, token => token.value === node.operator); context.report({ @@ -70807,49 +65375,38 @@ module.exports = { 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}=`); } - }; } - }; /***/ }), -/* 656 */ +/* 682 */ /***/ ((module) => { "use strict"; @@ -70857,19 +65414,21 @@ module.exports = { * @fileoverview enforce "for" loop update clause moving the counter in the right direction.(for-direction) * @author Aladdin-ADD */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { - description: "Enforce \"for\" loop update clause moving the counter in the right direction.", + description: "Enforce \"for\" loop update clause moving the counter in the right direction", recommended: true, - url: "https://eslint.org/docs/rules/for-direction" + url: "https://eslint.org/docs/latest/rules/for-direction" }, fixable: null, schema: [], @@ -70877,7 +65436,6 @@ module.exports = { incorrectDirection: "The update clause in this loop moves the variable in the wrong direction." } }, - create(context) { /** * report an error. @@ -70890,14 +65448,13 @@ module.exports = { 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 === "-") { @@ -70906,52 +65463,44 @@ module.exports = { } 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) { @@ -70959,7 +65508,6 @@ module.exports = { const operator = node.test.operator; const update = node.update; let wrongDirection; - if (operator === "<" || operator === "<=") { wrongDirection = -1; } else if (operator === ">" || operator === ">=") { @@ -70967,7 +65515,6 @@ module.exports = { } else { return; } - if (update.type === "UpdateExpression") { if (getUpdateDirection(update, counter) === wrongDirection) { report(node); @@ -70977,14 +65524,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 657 */ +/* 683 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -70992,24 +65537,26 @@ module.exports = { * @fileoverview Rule to control spacing within function calls * @author Matt DuVall */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Require or disallow spacing between function identifiers and their invocations", recommended: false, - url: "https://eslint.org/docs/rules/func-call-spacing" + url: "https://eslint.org/docs/latest/rules/func-call-spacing" }, fixable: "whitespace", schema: { @@ -71043,12 +65590,12 @@ module.exports = { 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 sourceCode = context.sourceCode; const text = sourceCode.getText(); + /** * Check if open space is present in a function name * @param {ASTNode} node node to evaluate @@ -71057,11 +65604,11 @@ module.exports = { * @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. @@ -71097,30 +65644,26 @@ module.exports = { } }, messageId: "unexpectedWhitespace", - fix(fixer) { // Don't remove comments. if (sourceCode.commentsExistBetween(leftToken, rightToken)) { return null; - } // If `?.` exists, it doesn't hide no-unexpected-multiline errors - + } + // If `?.` exists, it doesn't hide no-unexpected-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({ @@ -71133,7 +65676,6 @@ module.exports = { end: rightToken.loc.start }, messageId: "missing", - fix(fixer) { if (node.optional) { return null; // Not sure if inserting a space to either before/after `?.` token. @@ -71141,7 +65683,6 @@ module.exports = { return fixer.insertTextBefore(rightToken, " "); } - }); } else if (!never && !allowNewlines && hasNewline) { context.report({ @@ -71151,7 +65692,6 @@ module.exports = { end: rightToken.loc.start }, messageId: "unexpectedNewline", - fix(fixer) { /* * Only autofix if there is no newline @@ -71160,58 +65700,49 @@ module.exports = { */ if (!node.optional) { return null; - } // Don't remove comments. - + } + // 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 + 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); } - }; } - }; /***/ }), -/* 658 */ +/* 684 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -71219,13 +65750,16 @@ module.exports = { * @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 */ - //-------------------------------------------------------------------------- + + + +//-------------------------------------------------------------------------- // Requirements //-------------------------------------------------------------------------- +const astUtils = __webpack_require__(639); +const esutils = __webpack_require__(640); -const astUtils = __webpack_require__(618); - -const esutils = __webpack_require__(619); //-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -71234,42 +65768,38 @@ const esutils = __webpack_require__(619); //------------------------------------ * @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"] - + } + // 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) { + if (ecmaVersion >= 2015) { return esutils.keyword.isIdentifierES6(name); } - return esutils.keyword.isIdentifierES5(name); -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ - const alwaysOrNever = { enum: ["always", "never"] }; @@ -71285,15 +65815,15 @@ const optionsObject = { }, additionalProperties: false }; -/** @type {import('../shared/types').Rule} */ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { description: "Require function names to match the name of the variable or property to which they are assigned", recommended: false, - url: "https://eslint.org/docs/rules/func-name-matching" + url: "https://eslint.org/docs/latest/rules/func-name-matching" }, schema: { anyOf: [{ @@ -71313,13 +65843,13 @@ module.exports = { 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; + const ecmaVersion = context.languageOptions.ecmaVersion; + /** * Check whether node is a certain CallExpression. * @param {string} objName object name @@ -71327,25 +65857,23 @@ module.exports = { * @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 @@ -71354,11 +65882,8 @@ module.exports = { * @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") { @@ -71368,7 +65893,6 @@ module.exports = { } else { messageId = "notMatchVariable"; } - context.report({ node, messageId, @@ -71378,69 +65902,59 @@ module.exports = { } }); } + /** * 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 && name && isIdentifier(name) && shouldWarn(name, node.right.id.name)) { report(node, name, node.right.id.name, isProp); } }, - "Property, PropertyDefinition[value]"(node) { if (!(node.value.type === "FunctionExpression" && node.value.id)) { return; } - if (node.key.type === "Identifier" && !node.computed) { const functionName = node.value.id.name; let propertyName = node.key.name; - if (considerPropertyDescriptor && propertyName === "value" && node.parent.type === "ObjectExpression") { 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); } @@ -71450,22 +65964,18 @@ module.exports = { } 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); } } - }; } - }; /***/ }), -/* 659 */ +/* 685 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -71473,34 +65983,35 @@ module.exports = { * @fileoverview Rule to warn when a function expression does not have a name. * @author Kyle T. Nunery */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); /** * 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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Require or disallow named `function` expressions", recommended: false, - url: "https://eslint.org/docs/rules/func-names" + url: "https://eslint.org/docs/latest/rules/func-names" }, schema: { definitions: { @@ -71525,53 +66036,48 @@ module.exports = { named: "Unexpected named {{name}}." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * 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 === "PropertyDefinition" && 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, @@ -71582,13 +66088,12 @@ module.exports = { } }); } + /** * 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, @@ -71599,24 +66104,20 @@ module.exports = { } }); } + /** * The listener for function nodes. * @param {ASTNode} node function node * @returns {void} */ - - function handleFunction(node) { // Skip recursive functions. - const nameVar = context.getDeclaredVariables(node)[0]; - + const nameVar = sourceCode.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); @@ -71631,17 +66132,15 @@ module.exports = { } } } - return { "FunctionExpression:exit": handleFunction, "ExportDefaultDeclaration > FunctionDeclaration": handleFunction }; } - }; /***/ }), -/* 660 */ +/* 686 */ /***/ ((module) => { "use strict"; @@ -71649,19 +66148,20 @@ module.exports = { * @fileoverview Rule to enforce a particular function style * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce the consistent use of either `function` declarations or expressions", recommended: false, - url: "https://eslint.org/docs/rules/func-style" + url: "https://eslint.org/docs/latest/rules/func-style" }, schema: [{ enum: ["declaration", "expression"] @@ -71680,16 +66180,14 @@ module.exports = { declaration: "Expected a function declaration." } }, - create(context) { const style = context.options[0], - allowArrowFunctions = context.options[1] && context.options[1].allowArrowFunctions, - enforceDeclarations = style === "declaration", - stack = []; + 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, @@ -71697,14 +66195,11 @@ module.exports = { }); } }, - "FunctionDeclaration:exit"() { stack.pop(); }, - FunctionExpression(node) { stack.push(false); - if (enforceDeclarations && node.parent.type === "VariableDeclarator") { context.report({ node: node.parent, @@ -71712,27 +66207,21 @@ module.exports = { }); } }, - "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, @@ -71741,14 +66230,12 @@ module.exports = { } }; } - return nodesToCheck; } - }; /***/ }), -/* 661 */ +/* 687 */ /***/ ((module) => { "use strict"; @@ -71756,19 +66243,21 @@ module.exports = { * @fileoverview Rule to enforce line breaks between arguments of a function call * @author Alexey Gonchar */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "layout", docs: { description: "Enforce line breaks between arguments of a function call", recommended: false, - url: "https://eslint.org/docs/rules/function-call-argument-newline" + url: "https://eslint.org/docs/latest/rules/function-call-argument-newline" }, fixable: "whitespace", schema: [{ @@ -71779,9 +66268,8 @@ module.exports = { missingLineBreak: "There should be a line break after this argument." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const checkers = { unexpected: { messageId: "unexpectedLineBreak", @@ -71794,6 +66282,7 @@ module.exports = { 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 @@ -71801,12 +66290,10 @@ module.exports = { * @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 @@ -71824,21 +66311,18 @@ module.exports = { } } } + /** * 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") { @@ -71846,7 +66330,6 @@ module.exports = { } 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 { @@ -71854,17 +66337,15 @@ module.exports = { } } } - return { CallExpression: check, NewExpression: check }; } - }; /***/ }), -/* 662 */ +/* 688 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -71872,24 +66353,25 @@ module.exports = { * @fileoverview enforce consistent line breaks inside function parentheses * @author Teddy Katz */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent line breaks inside function parentheses", recommended: false, - url: "https://eslint.org/docs/rules/function-paren-newline" + url: "https://eslint.org/docs/latest/rules/function-paren-newline" }, fixable: "whitespace", schema: [{ @@ -71914,15 +66396,13 @@ module.exports = { unexpectedAfter: "Unexpected newline after '('." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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") { @@ -71931,7 +66411,9 @@ module.exports = { minItems = Infinity; } else { minItems = null; - } //---------------------------------------------------------------------- + } + + //---------------------------------------------------------------------- // Helpers //---------------------------------------------------------------------- @@ -71941,31 +66423,25 @@ module.exports = { * @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; @@ -71974,17 +66450,16 @@ module.exports = { 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. + 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({ @@ -71993,17 +66468,16 @@ module.exports = { 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. + 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({ @@ -72013,25 +66487,22 @@ module.exports = { }); } } + /** * 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, @@ -72041,6 +66512,7 @@ module.exports = { } } } + /** * Gets the left paren and right paren tokens of a node. * @param {ASTNode} node The node with parens @@ -72049,8 +66521,6 @@ module.exports = { * 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": @@ -72068,7 +66538,6 @@ module.exports = { leftParen: sourceCode.getTokenAfter(node.callee, astUtils.isOpeningParenToken), rightParen: sourceCode.getLastToken(node) }; - case "FunctionDeclaration": case "FunctionExpression": { @@ -72079,25 +66548,21 @@ module.exports = { rightParen }; } - case "ArrowFunctionExpression": { const firstToken = sourceCode.getFirstToken(node, { skip: node.async ? 1 : 0 }); - if (!astUtils.isOpeningParenToken(firstToken)) { // If the ArrowFunctionExpression has a single param without parens, return null. return null; } - const rightParen = node.params.length ? sourceCode.getTokenAfter(node.params[node.params.length - 1], astUtils.isClosingParenToken) : sourceCode.getTokenAfter(firstToken); return { leftParen: firstToken, rightParen }; } - case "ImportExpression": { const leftParen = sourceCode.getFirstToken(node, 1); @@ -72107,20 +66572,19 @@ module.exports = { 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)) { @@ -72128,23 +66592,19 @@ module.exports = { } else { params = node.arguments; } - if (parens) { validateParens(parens, params); - if (multilineArgumentsOption) { validateArguments(parens, params); } } } - }; } - }; /***/ }), -/* 663 */ +/* 689 */ /***/ ((module) => { "use strict"; @@ -72152,10 +66612,12 @@ module.exports = { * @fileoverview Rule to check the spacing around the * in generator functions. * @author Jamund Ferguson */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ - const OVERRIDE_SCHEMA = { oneOf: [{ enum: ["before", "after", "both", "neither"] @@ -72172,15 +66634,15 @@ const OVERRIDE_SCHEMA = { additionalProperties: false }] }; -/** @type {import('../shared/types').Rule} */ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent spacing around `*` operators in generator functions", recommended: false, - url: "https://eslint.org/docs/rules/generator-star-spacing" + url: "https://eslint.org/docs/latest/rules/generator-star-spacing" }, fixable: "whitespace", schema: [{ @@ -72209,7 +66671,6 @@ module.exports = { unexpectedAfter: "Unexpected space after *." } }, - create(context) { const optionDefinitions = { before: { @@ -72229,21 +66690,19 @@ module.exports = { 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 { @@ -72252,37 +66711,35 @@ module.exports = { method: optionToDefinition(option.method, defaults) }; }(context.options[0] || {}); + const sourceCode = context.sourceCode; - 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" @@ -72293,8 +66750,6 @@ module.exports = { * 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 === "*"; @@ -72304,63 +66759,53 @@ module.exports = { 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 - + } + // 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 }; } - }; /***/ }), -/* 664 */ +/* 690 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -72368,38 +66813,40 @@ module.exports = { * @fileoverview Enforces that a return statement is present in property getters. * @author Aladdin-ADD(hh_2013@foxmail.com) */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // 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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Enforce `return` statements in getters", recommended: true, - url: "https://eslint.org/docs/rules/getter-return" + url: "https://eslint.org/docs/latest/rules/getter-return" }, fixable: null, schema: [{ @@ -72417,12 +66864,11 @@ module.exports = { expectedAlways: "Expected {{name}} to always return a value." } }, - create(context) { const options = context.options[0] || { allowImplicit: false }; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; let funcInfo = { upper: null, codePath: null, @@ -72430,6 +66876,7 @@ module.exports = { shouldCheck: false, node: null }; + /** * Checks whether or not the last code path segment is reachable. * Then reports this function if the segment is reachable. @@ -72439,7 +66886,6 @@ module.exports = { * @param {ASTNode} node A node to check. * @returns {void} */ - function checkLastSegment(node) { if (funcInfo.shouldCheck && funcInfo.codePath.currentSegments.some(isReachable)) { context.report({ @@ -72452,37 +66898,36 @@ module.exports = { }); } } + /** * 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() + // Object.defineProperty() or Reflect.defineProperty() + if (parent.parent.parent.type === "CallExpression") { + const callNode = parent.parent.parent.callee; + if (astUtils.isSpecificMemberAccess(callNode, "Object", "defineProperty") || astUtils.isSpecificMemberAccess(callNode, "Reflect", "defineProperty")) { + return true; + } + } - - 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; + // Object.defineProperties() or Object.create() + if (parent.parent.parent.type === "Property" && parent.parent.parent.parent.type === "ObjectExpression" && parent.parent.parent.parent.parent.type === "CallExpression") { + const callNode = parent.parent.parent.parent.parent.callee; + return astUtils.isSpecificMemberAccess(callNode, "Object", "defineProperties") || astUtils.isSpecificMemberAccess(callNode, "Object", "create"); } } } - return false; } - return { // Stacks this function's information. onCodePathStart(codePath, node) { @@ -72494,17 +66939,16 @@ module.exports = { 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 + funcInfo.hasReturn = true; + // if allowImplicit: false, should also check node.argument if (!options.allowImplicit && !node.argument) { context.report({ node, @@ -72516,17 +66960,15 @@ module.exports = { } } }, - // Reports a given function if the last path is reachable. "FunctionExpression:exit": checkLastSegment, "ArrowFunctionExpression:exit": checkLastSegment }; } - }; /***/ }), -/* 665 */ +/* 691 */ /***/ ((module) => { "use strict"; @@ -72537,40 +66979,37 @@ module.exports = { */ + const ACCEPTABLE_PARENTS = new Set(["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]); - if (references.length === 1) { return references[0]; } + /* c8 ignore next */ - - 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; } + /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { deprecated: true, @@ -72579,22 +67018,20 @@ module.exports = { docs: { description: "Require `require()` calls to be placed at top-level module scope", recommended: false, - url: "https://eslint.org/docs/rules/global-require" + url: "https://eslint.org/docs/latest/rules/global-require" }, schema: [], messages: { unexpected: "Unexpected require()." } }, - create(context) { + const sourceCode = context.sourceCode; return { CallExpression(node) { - const currentScope = context.getScope(); - + const currentScope = sourceCode.getScope(node); if (node.callee.name === "require" && !isShadowed(currentScope, node.callee)) { - const isGoodRequire = context.getAncestors().every(parent => ACCEPTABLE_PARENTS.has(parent.type)); - + const isGoodRequire = sourceCode.getAncestors(node).every(parent => ACCEPTABLE_PARENTS.has(parent.type)); if (!isGoodRequire) { context.report({ node, @@ -72603,14 +67040,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 666 */ +/* 692 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -72618,11 +67053,15 @@ module.exports = { * @fileoverview Rule to require grouped accessor pairs in object literals and classes * @author Milos Djermanovic */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Typedefs //------------------------------------------------------------------------------ @@ -72638,6 +67077,7 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @property {ASTNode[]} getters List of getter nodes. * @property {ASTNode[]} setters List of setter nodes. */ + //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -72649,68 +67089,59 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @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]; - + 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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Require grouped accessor pairs in object literals and classes", recommended: false, - url: "https://eslint.org/docs/rules/grouped-accessor-pairs" + url: "https://eslint.org/docs/latest/rules/grouped-accessor-pairs" }, schema: [{ enum: ["anyOrder", "getBeforeSet", "setBeforeGet"] @@ -72720,10 +67151,10 @@ module.exports = { invalidOrder: "Expected {{ latterName }} to be before {{ formerName }}." } }, - create(context) { const order = context.options[0] || "anyOrder"; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * Reports the given accessor pair. * @param {string} messageId messageId to report. @@ -72732,7 +67163,6 @@ module.exports = { * @returns {void} * @private */ - function report(messageId, formerNode, latterNode) { context.report({ node: latterNode, @@ -72744,14 +67174,13 @@ module.exports = { } }); } + /** * 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); @@ -72761,6 +67190,7 @@ module.exports = { setters: node.kind === "set" ? [node] : [] }; } + /** * Merges the given `AccessorData` object into the given accessors list. * @param {AccessorData[]} accessors The list to merge into. @@ -72768,20 +67198,17 @@ module.exports = { * @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. @@ -72789,11 +67216,8 @@ module.exports = { * @returns {void} * @private */ - - function checkList(nodes, shouldCheck) { const accessors = nodes.filter(shouldCheck).filter(isAccessorKind).map(createAccessorData).reduce(mergeAccessorData, []); - for (const { getters, setters @@ -72801,12 +67225,11 @@ module.exports = { // 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; - + [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) { @@ -72815,24 +67238,20 @@ module.exports = { } } } - 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); } - }; } - }; /***/ }), -/* 667 */ +/* 693 */ /***/ ((module) => { "use strict"; @@ -72840,77 +67259,77 @@ module.exports = { * @fileoverview Rule to flag for-in loops without if statements inside * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Require `for-in` loops to include an `if` statement", recommended: false, - url: "https://eslint.org/docs/rules/guard-for-in" + url: "https://eslint.org/docs/latest/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 + const body = node.body; + // empty statement if (body.type === "EmptyStatement") { return; - } // if statement - + } + // if statement if (body.type === "IfStatement") { return; - } // empty block - + } + // empty block if (body.type === "BlockStatement" && body.body.length === 0) { return; - } // block with just if statement - + } + // 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 - + } + // 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 + 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 - + } + // ... 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" }); } - }; } - }; /***/ }), -/* 668 */ +/* 694 */ /***/ ((module) => { "use strict"; @@ -72919,12 +67338,14 @@ module.exports = { * @author Jamund Ferguson * @deprecated in ESLint v7.0.0 */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { deprecated: true, @@ -72933,7 +67354,7 @@ module.exports = { docs: { description: "Require error handling in callbacks", recommended: false, - url: "https://eslint.org/docs/rules/handle-callback-err" + url: "https://eslint.org/docs/latest/rules/handle-callback-err" }, schema: [{ type: "string" @@ -72942,56 +67363,51 @@ module.exports = { expected: "Expected error to be handled." } }, - create(context) { const errorArgument = context.options[0] || "err"; + const sourceCode = context.sourceCode; + /** * 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]; - + const scope = sourceCode.getScope(node), + parameters = getParameters(scope), + firstParameter = parameters[0]; if (firstParameter && matchesConfiguredErrorName(firstParameter.name)) { if (firstParameter.references.length === 0) { context.report({ @@ -73001,18 +67417,16 @@ module.exports = { } } } - return { FunctionDeclaration: checkForError, FunctionExpression: checkForError, ArrowFunctionExpression: checkForError }; } - }; /***/ }), -/* 669 */ +/* 695 */ /***/ ((module) => { "use strict"; @@ -73022,7 +67436,10 @@ module.exports = { * @author Keith Cirkel (http://keithcirkel.co.uk) * @deprecated in ESLint v7.5.0 */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -73031,14 +67448,16 @@ module.exports = { * @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 + 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. * @@ -73048,13 +67467,13 @@ function isAssignmentTarget(node) { * @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 + 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. * @@ -73063,29 +67482,26 @@ function isRenamedImport(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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { deprecated: true, @@ -73094,7 +67510,7 @@ module.exports = { docs: { description: "Disallow specified identifiers", recommended: false, - url: "https://eslint.org/docs/rules/id-blacklist" + url: "https://eslint.org/docs/latest/rules/id-blacklist" }, schema: { type: "array", @@ -73107,62 +67523,58 @@ module.exports = { restricted: "Identifier '{{name}}' is restricted." } }, - create(context) { const denyList = new Set(context.options); const reportedNodes = new Set(); + const sourceCode = context.sourceCode; 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) { /* * We used the range instead of the node because it's possible @@ -73184,25 +67596,21 @@ module.exports = { reportedNodes.add(node.range.toString()); } } - return { - Program() { - globalScope = context.getScope(); + Program(node) { + globalScope = sourceCode.getScope(node); }, - Identifier(node) { if (isRestricted(node.name) && shouldCheck(node)) { report(node); } } - }; } - }; /***/ }), -/* 670 */ +/* 696 */ /***/ ((module) => { "use strict"; @@ -73211,7 +67619,10 @@ module.exports = { * specified in the configuration are used. * @author Keith Cirkel (http://keithcirkel.co.uk) */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -73220,14 +67631,16 @@ module.exports = { * @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 + 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. * @@ -73237,13 +67650,13 @@ function isAssignmentTarget(node) { * @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 + 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 an ObjectPattern destructuring. * @@ -73252,25 +67665,23 @@ function isRenamedImport(node) { * @param {ASTNode} node `Identifier` node to check. * @returns {boolean} `true` if the node is in an ObjectPattern destructuring. */ - - function isPropertyNameInDestructuring(node) { const parent = node.parent; return !parent.computed && parent.type === "Property" && parent.parent.type === "ObjectPattern" && parent.key === node; -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow specified identifiers", recommended: false, - url: "https://eslint.org/docs/rules/id-denylist" + url: "https://eslint.org/docs/latest/rules/id-denylist" }, schema: { type: "array", @@ -73284,62 +67695,58 @@ module.exports = { restrictedPrivate: "Identifier '#{{name}}' is restricted." } }, - create(context) { const denyList = new Set(context.options); const reportedNodes = new Set(); + const sourceCode = context.sourceCode; 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) && !isPropertyNameInDestructuring(node) && !isReferenceToGlobalVariable(node); } + /** * Reports an AST node as a rule violation. * @param {ASTNode} node The node to report. * @returns {void} * @private */ - - function report(node) { /* * We used the range instead of the node because it's possible @@ -73362,26 +67769,22 @@ module.exports = { reportedNodes.add(node.range.toString()); } } - return { - Program() { - globalScope = context.getScope(); + Program(node) { + globalScope = sourceCode.getScope(node); }, - [["Identifier", "PrivateIdentifier"]](node) { if (isRestricted(node.name) && shouldCheck(node)) { report(node); } } - }; } - }; /***/ }), -/* 671 */ -/***/ ((module) => { +/* 697 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /** @@ -73389,19 +67792,28 @@ module.exports = { * than the values provided in configuration. * @author Burak Yigit Kaya aka BYK */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ +const { + getGraphemeCount +} = __webpack_require__(663); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce minimum and maximum identifier lengths", recommended: false, - url: "https://eslint.org/docs/rules/id-length" + url: "https://eslint.org/docs/latest/rules/id-length" }, schema: [{ type: "object", @@ -73440,7 +67852,6 @@ module.exports = { tooLongPrivate: "Identifier name #'{{name}}' is too long (> {{max}})." } }, - create(context) { const options = context.options[0] || {}; const minLength = typeof options.min !== "undefined" ? options.min : 2; @@ -73449,41 +67860,37 @@ module.exports = { const exceptions = new Set(options.exceptions); const exceptionPatterns = (options.exceptionPatterns || []).map(pattern => new RegExp(pattern, "u")); const reportedNodes = 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 + 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") { const isKeyAndValueSame = parent.value.name === parent.key.name; return !isKeyAndValueSame && parent.value === node || isKeyAndValueSame && parent.key === node && properties; } - return properties && !parent.computed && parent.key.name === node.name; }, - ImportDefaultSpecifier: true, RestElement: true, FunctionExpression: true, @@ -73499,14 +67906,15 @@ module.exports = { [["Identifier", "PrivateIdentifier"]](node) { const name = node.name; const parent = node.parent; - const isShort = name.length < minLength; - const isLong = name.length > maxLength; - + const nameLength = getGraphemeCount(name); + const isShort = nameLength < minLength; + const isLong = nameLength > maxLength; if (!(isShort || isLong) || exceptions.has(name) || matchesExceptionPattern(name)) { return; // Nothing to report } const isValidExpression = SUPPORTED_EXPRESSIONS[parent.type]; + /* * We used the range instead of the node because it's possible * for the same identifier to be represented by two different @@ -73516,15 +67924,12 @@ module.exports = { * and one for the value. The only way to know they are the same * is to look at the range. */ - if (isValidExpression && !reportedNodes.has(node.range.toString()) && (isValidExpression === true || isValidExpression(parent, node))) { reportedNodes.add(node.range.toString()); let messageId = isShort ? "tooShort" : "tooLong"; - if (node.type === "PrivateIdentifier") { messageId += "Private"; } - context.report({ node, messageId, @@ -73536,14 +67941,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 672 */ +/* 698 */ /***/ ((module) => { "use strict"; @@ -73551,19 +67954,21 @@ module.exports = { * @fileoverview Rule to flag non-matching identifiers * @author Matthieu Larcher */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Require identifiers to match a specified regular expression", recommended: false, - url: "https://eslint.org/docs/rules/id-match" + url: "https://eslint.org/docs/latest/rules/id-match" }, schema: [{ type: "string" @@ -73594,72 +67999,70 @@ module.exports = { notMatchPrivate: "Identifier '#{{name}}' does not match the pattern '{{pattern}}'." } }, - create(context) { //-------------------------------------------------------------------------- // Options //-------------------------------------------------------------------------- const pattern = context.options[0] || "^.+$", - regexp = new RegExp(pattern, "u"); + regexp = new RegExp(pattern, "u"); const options = context.options[1] || {}, - checkProperties = !!options.properties, - checkClassFields = !!options.classFields, - onlyDeclarations = !!options.onlyDeclarations, - ignoreDestructuring = !!options.ignoreDestructuring; - let globalScope; //-------------------------------------------------------------------------- + checkProperties = !!options.properties, + checkClassFields = !!options.classFields, + onlyDeclarations = !!options.onlyDeclarations, + ignoreDestructuring = !!options.ignoreDestructuring; + const sourceCode = context.sourceCode; + let globalScope; + + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- - // contains reported nodes to avoid reporting twice on destructuring with shorthand notation + // contains reported nodes to avoid reporting twice on destructuring with shorthand notation const reportedNodes = new Set(); const ALLOWED_PARENT_TYPES = new Set(["CallExpression", "NewExpression"]); const DECLARATION_TYPES = new Set(["FunctionDeclaration", "VariableDeclarator"]); const IMPORT_TYPES = new Set(["ImportSpecifier", "ImportNamespaceSpecifier", "ImportDefaultSpecifier"]); + /** * 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 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. @@ -73667,19 +68070,16 @@ module.exports = { * @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) { /* * We used the range instead of the node because it's possible @@ -73703,82 +68103,82 @@ module.exports = { reportedNodes.add(node.range.toString()); } } - return { - Program() { - globalScope = context.getScope(); + Program(node) { + globalScope = sourceCode.getScope(node); }, - Identifier(node) { const name = node.name, - parent = node.parent, - effectiveParent = parent.type === "MemberExpression" ? parent.parent : parent; - + parent = node.parent, + effectiveParent = parent.type === "MemberExpression" ? parent.parent : parent; if (isReferenceToGlobalVariable(node)) { return; } - if (parent.type === "MemberExpression") { if (!checkProperties) { return; - } // Always check object names - + } + // 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 + } + // 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 + } + // 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); } - } // For https://github.com/eslint/eslint/issues/15123 + } + // For https://github.com/eslint/eslint/issues/15123 } else if (parent.type === "Property" && parent.parent.type === "ObjectExpression" && parent.key === node && !parent.computed) { if (checkProperties && 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 (!ignoreDestructuring && parent.shorthand && parent.value.left && isInvalid(name)) { report(node); } + const assignmentKeyEqualsValue = parent.key.name === parent.value.name; - const assignmentKeyEqualsValue = parent.key.name === parent.value.name; // prevent checking righthand side of destructured object - + // prevent checking righthand side of destructured object if (!assignmentKeyEqualsValue && parent.key === node) { return; } + const valueIsInvalid = parent.value.name && isInvalid(name); - const valueIsInvalid = parent.value.name && isInvalid(name); // ignore destructuring if the option is set, unless a new identifier is created - + // 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 - + } + // never check properties or always ignore destructuring if (!checkProperties && !parent.computed || ignoreDestructuring && isInsideObjectPattern(node)) { return; - } // don't check right hand side of AssignmentExpression to prevent duplicate warnings - + } + // 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 + } + // 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)) { @@ -73787,32 +68187,28 @@ module.exports = { } else if (parent.type === "PropertyDefinition") { if (checkClassFields && isInvalid(name)) { report(node); - } // Report anything that is invalid that isn't a CallExpression + } + // Report anything that is invalid that isn't a CallExpression } else if (shouldReport(effectiveParent, name)) { report(node); } }, - "PrivateIdentifier"(node) { const isClassField = node.parent.type === "PropertyDefinition"; - if (isClassField && !checkClassFields) { return; } - if (isInvalid(node.name)) { report(node); } } - }; } - }; /***/ }), -/* 673 */ +/* 699 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -73825,20 +68221,19 @@ module.exports = { const { isCommentToken, isNotOpeningParenToken -} = __webpack_require__(618); //------------------------------------------------------------------------------ +} = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ - /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce the location of arrow function bodies", recommended: false, - url: "https://eslint.org/docs/rules/implicit-arrow-linebreak" + url: "https://eslint.org/docs/latest/rules/implicit-arrow-linebreak" }, fixable: "whitespace", schema: [{ @@ -73849,24 +68244,21 @@ module.exports = { unexpected: "Expected no linebreak before this expression." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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, @@ -73877,7 +68269,6 @@ module.exports = { context.report({ node: firstTokenOfBody, messageId: "unexpected", - fix(fixer) { if (sourceCode.getFirstTokenBetween(arrowToken, firstTokenOfBody, { includeComments: true, @@ -73885,26 +68276,23 @@ module.exports = { })) { return null; } - return fixer.replaceTextRange([arrowToken.range[1], firstTokenOfBody.range[0]], " "); } - }); } - } //---------------------------------------------------------------------- + } + + //---------------------------------------------------------------------- // Public //---------------------------------------------------------------------- - - return { ArrowFunctionExpression: node => validateExpression(node) }; } - }; /***/ }), -/* 674 */ +/* 700 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -73915,20 +68303,20 @@ module.exports = { * @author Vitaly Puzrin * @author Gyandeep Singh */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const { - OrderedMap -} = __webpack_require__(675); - -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // 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", "PrivateIdentifier", "Program", "Property", "PropertyDefinition", "RestElement", "ReturnStatement", "SequenceExpression", "SpreadElement", "StaticBlock", "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 @@ -73943,86 +68331,60 @@ const KNOWN_NODES = new Set(["AssignmentExpression", "AssignmentPattern", "Array */ /** - * 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 + * A mutable map that stores (key, value) pairs. The keys are numeric indices, and must be unique. + * This is intended to be a generic wrapper around a map with non-negative integer keys, so that the underlying implementation * can easily be swapped out. */ - -class BinarySearchTree { +class IndexMap { /** - * Creates an empty tree + * Creates an empty map + * @param {number} maxKey The maximum key */ - constructor() { - this._orderedMap = new OrderedMap(); - this._orderedMapEnd = this._orderedMap.end(); + constructor(maxKey) { + // Initializing the array with the maximum expected size avoids dynamic reallocations that could degrade performance. + this._values = Array(maxKey + 1); } + /** - * Inserts an entry into the tree. + * Inserts an entry into the map. * @param {number} key The entry's key * @param {any} value The entry's value * @returns {void} */ - - insert(key, value) { - this._orderedMap.setElement(key, value); + this._values[key] = value; } + /** - * Finds the entry with the largest key less than or equal to the provided key + * Finds the value of 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. + * @returns {*|undefined} The value of the found entry, or undefined if no such entry exists. */ - - - findLe(key) { - const iterator = this._orderedMap.reverseLowerBound(key); - - if (iterator.equals(this._orderedMapEnd)) { - return {}; + findLastNotAfter(key) { + const values = this._values; + for (let index = key; index >= 0; index--) { + const value = values[index]; + if (value) { + return value; + } } - - return { - key: iterator.pointer[0], - value: iterator.pointer[1] - }; + return void 0; } + /** * 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._orderedMap.lowerBound(start); - - if (iterator.equals(this._orderedMapEnd)) { - return; - } - - if (end > this._orderedMap.back()[0]) { - while (!iterator.equals(this._orderedMapEnd)) { - this._orderedMap.eraseElementByIterator(iterator); - } - } else { - while (iterator.pointer[0] < end) { - this._orderedMap.eraseElementByIterator(iterator); - } - } + this._values.fill(void 0, start, end); } - } + /** * A helper class to get token-based info related to indentation */ - - class TokenInfo { /** * @param {SourceCode} sourceCode A SourceCode object @@ -74033,77 +68395,69 @@ class TokenInfo { 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 { /** * @param {TokenInfo} tokenInfo a TokenInfo instance * @param {number} indentSize The desired size of each indentation level * @param {string} indentType The indentation character + * @param {number} maxIndex The maximum end index of any token */ - constructor(tokenInfo, indentSize, indentType) { + constructor(tokenInfo, indentSize, indentType, maxIndex) { this._tokenInfo = tokenInfo; this._indentSize = indentSize; this._indentType = indentType; - this._tree = new BinarySearchTree(); - - this._tree.insert(0, { + this._indexMap = new IndexMap(maxIndex); + this._indexMap.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; + return this._indexMap.findLastNotAfter(token.range[0]); } + /** * 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 @@ -74112,8 +68466,6 @@ class OffsetStorage { * @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 @@ -74124,6 +68476,7 @@ class OffsetStorage { */ this._lockedFirstTokens.set(offsetToken, baseToken); } + /** * Sets the desired offset of a token. * @@ -74180,11 +68533,10 @@ class OffsetStorage { * @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. @@ -74210,8 +68562,6 @@ class OffsetStorage { * @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 @@ -74224,52 +68574,45 @@ class OffsetStorage { * * 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. + * which is <= token.start. To make this operation fast, the nodes are stored in a map indexed by key. */ + const descriptorToInsert = { offset, from: fromToken, force }; - - const descriptorAfterRange = this._tree.findLe(range[1]).value; - + const descriptorAfterRange = this._indexMap.findLastNotAfter(range[1]); const fromTokenIsInRange = fromToken && fromToken.range[0] >= range[0] && fromToken.range[1] <= range[1]; + const fromTokenDescriptor = fromTokenIsInRange && this._getOffsetDescriptor(fromToken); - const fromTokenDescriptor = fromTokenIsInRange && this._getOffsetDescriptor(fromToken); // First, remove any existing nodes in the range from the tree. + // First, remove any existing nodes in the range from the map. + this._indexMap.deleteRange(range[0] + 1, range[1]); + // Insert a new node into the map for this range + this._indexMap.insert(range[0], descriptorToInsert); - 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); + this._indexMap.insert(fromToken.range[0], fromTokenDescriptor); + this._indexMap.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); + this._indexMap.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)) { @@ -74280,46 +68623,40 @@ class OffsetStorage { 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._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", @@ -74328,15 +68665,15 @@ const ELEMENT_LIST_SCHEMA = { enum: ["first", "off"] }] }; -/** @type {import('../shared/types').Rule} */ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent indentation", recommended: false, - url: "https://eslint.org/docs/rules/indent" + url: "https://eslint.org/docs/latest/rules/indent" }, fixable: "whitespace", schema: [{ @@ -74451,7 +68788,6 @@ module.exports = { wrongIndentation: "Expected indentation of {{expected}} but found {{actual}}." } }, - create(context) { const DEFAULT_VARIABLE_INDENT = 1; const DEFAULT_PARAMETER_INDENT = 1; @@ -74488,7 +68824,6 @@ module.exports = { ignoredNodes: [], ignoreComments: false }; - if (context.options.length) { if (context.options[0] === "tab") { indentSize = 1; @@ -74497,10 +68832,8 @@ module.exports = { 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, @@ -74510,11 +68843,11 @@ module.exports = { } } } - - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const tokenInfo = new TokenInfo(sourceCode); - const offsets = new OffsetStorage(tokenInfo, indentSize, indentType === "space" ? " " : "\t"); + const offsets = new OffsetStorage(tokenInfo, indentSize, indentType === "space" ? " " : "\t", sourceCode.text.length); 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 @@ -74522,16 +68855,11 @@ module.exports = { * @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. @@ -74543,20 +68871,18 @@ module.exports = { } 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; @@ -74575,35 +68901,32 @@ module.exports = { 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. + 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 @@ -74611,34 +68934,31 @@ module.exports = { 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" && ["!", "~", "+", "-"].includes(statement.operator) || 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 @@ -74647,8 +68967,6 @@ module.exports = { * @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. @@ -74657,97 +68975,86 @@ module.exports = { */ 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) - + } + // 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. + 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 - + } + // 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); } } + /** * 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, { @@ -74760,19 +69067,17 @@ module.exports = { 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 = []; @@ -74789,8 +69094,9 @@ module.exports = { }); 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. + 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 => { @@ -74799,18 +69105,16 @@ module.exports = { } }); } - 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 @@ -74818,7 +69122,6 @@ module.exports = { unknownNodeTokens.forEach(token => { if (!unknownNodeTokens.has(offsets.getFirstDependency(token))) { const firstTokenOfLine = tokenInfo.getFirstTokenOfLine(token); - if (token === firstTokenOfLine) { offsets.ignoreToken(token); } else { @@ -74827,24 +69130,22 @@ module.exports = { } }); } + /** * 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. @@ -74853,25 +69154,19 @@ module.exports = { * @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) { @@ -74879,18 +69174,15 @@ module.exports = { const closingBracket = sourceCode.getTokenAfter([...node.elements].reverse().find(_ => _) || 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); @@ -74898,19 +69190,17 @@ module.exports = { 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 && @@ -74922,10 +69212,8 @@ module.exports = { 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")) { @@ -74935,34 +69223,30 @@ module.exports = { } 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: + 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 === ":"); @@ -74972,6 +69256,7 @@ module.exports = { offsets.setDesiredOffset(questionMarkToken, firstToken, 1); offsets.setDesiredOffset(colonToken, firstToken, 1); offsets.setDesiredOffset(firstConsequentToken, firstToken, firstConsequentToken.type === "Punctuator" && 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. @@ -74982,7 +69267,6 @@ module.exports = { * 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 { @@ -74999,42 +69283,34 @@ module.exports = { } } }, - "DoWhileStatement, WhileStatement, ForInStatement, ForOfStatement, WithStatement": 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}` + 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); @@ -75042,15 +69318,12 @@ module.exports = { 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); } }, - /* * For blockless nodes with semicolon-first style, don't indent the semicolon. * e.g. @@ -75062,48 +69335,41 @@ module.exports = { */ ":matches(DoWhileStatement, ForStatement, ForInStatement, ForOfStatement, IfStatement, WhileStatement, WithStatement):exit"(node) { let nodesToCheck; - if (node.type === "IfStatement") { nodesToCheck = [node.consequent]; - if (node.alternate) { nodesToCheck.push(node.alternate); } } else { nodesToCheck = [node.body]; } - for (const nodeToCheck of nodesToCheck) { const lastToken = sourceCode.getLastToken(nodeToCheck); - if (astUtils.isSemicolonToken(lastToken)) { const tokenBeforeLast = sourceCode.getTokenBefore(lastToken); - const tokenAfterLast = sourceCode.getTokenAfter(lastToken); // override indentation of `;` only if its line looks like a semicolon-first style line + const tokenAfterLast = sourceCode.getTokenAfter(lastToken); + // override indentation of `;` only if its line looks like a semicolon-first style line if (!astUtils.isTokenOnSameLine(tokenBeforeLast, lastToken) && tokenAfterLast && astUtils.isTokenOnSameLine(lastToken, tokenAfterLast)) { offsets.setDesiredOffset(lastToken, sourceCode.getFirstToken(node), 0); } } } }, - 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); @@ -75112,7 +69378,6 @@ module.exports = { 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); @@ -75125,12 +69390,12 @@ module.exports = { }) : 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. @@ -75140,74 +69405,66 @@ module.exports = { * .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.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)); } }, - PropertyDefinition(node) { const firstToken = sourceCode.getFirstToken(node); const maybeSemicolonToken = sourceCode.getLastToken(node); - let keyLastToken = null; // Indent key. + let keyLastToken = null; + // Indent key. if (node.computed) { const bracketTokenL = sourceCode.getTokenBefore(node.key, astUtils.isOpeningBracketToken); const bracketTokenR = keyLastToken = sourceCode.getTokenAfter(node.key, astUtils.isClosingBracketToken); const keyRange = [bracketTokenL.range[1], bracketTokenR.range[0]]; - if (bracketTokenL !== firstToken) { offsets.setDesiredOffset(bracketTokenL, firstToken, 0); } - offsets.setDesiredOffsets(keyRange, bracketTokenL, 1); offsets.setDesiredOffset(bracketTokenR, bracketTokenL, 0); } else { const idToken = keyLastToken = sourceCode.getFirstToken(node.key); - if (idToken !== firstToken) { offsets.setDesiredOffset(idToken, firstToken, 1); } - } // Indent initializer. - + } + // Indent initializer. if (node.value) { const eqToken = sourceCode.getTokenBefore(node.value, astUtils.isEqToken); const valueToken = sourceCode.getTokenAfter(eqToken); offsets.setDesiredOffset(eqToken, keyLastToken, 1); offsets.setDesiredOffset(valueToken, eqToken, 1); - if (astUtils.isSemicolonToken(maybeSemicolonToken)) { offsets.setDesiredOffset(maybeSemicolonToken, eqToken, 1); } @@ -75215,21 +69472,17 @@ module.exports = { offsets.setDesiredOffset(maybeSemicolonToken, keyLastToken, 1); } }, - StaticBlock(node) { const openingCurly = sourceCode.getFirstToken(node, { skip: 1 }); // skip the `static` token - const closingCurly = sourceCode.getLastToken(node); addElementListIndent(node.body, openingCurly, closingCurly, options.StaticBlock.body); }, - 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, @@ -75237,7 +69490,6 @@ module.exports = { }).forEach(token => offsets.ignoreToken(token)); } }, - SwitchCase(node) { if (!(node.consequent.length === 1 && node.consequent[0].type === "BlockStatement")) { const caseKeyword = sourceCode.getFirstToken(node); @@ -75245,7 +69497,6 @@ module.exports = { offsets.setDesiredOffsets([caseKeyword.range[1], tokenAfterCurrentCase.range[0]], caseKeyword, 1); } }, - TemplateLiteral(node) { node.expressions.forEach((expression, index) => { const previousQuasi = node.quasis[index]; @@ -75255,21 +69506,17 @@ module.exports = { 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); - + 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 @@ -75294,12 +69541,10 @@ module.exports = { } 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); @@ -75310,22 +69555,18 @@ module.exports = { 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 @@ -75334,29 +69575,24 @@ module.exports = { } 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, { @@ -75367,38 +69603,34 @@ module.exports = { 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. + 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 = {}; - for (const [selector, listener] of Object.entries(baseOffsetListeners)) { /* * Offset listener calls are deferred until traversal is finished, and are called as @@ -75420,24 +69652,24 @@ module.exports = { listener, node }); - } // For each ignored node selector, set up a listener to collect it into the `ignoredNodes` set. - + } + // 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. @@ -75446,7 +69678,6 @@ module.exports = { * 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. @@ -75454,23 +69685,23 @@ module.exports = { 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. + } + // 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)); - 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. - + // 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 @@ -75479,24 +69710,21 @@ module.exports = { }, 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. * @@ -75504,3409 +69732,31 @@ module.exports = { * // 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 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 the token matches the expected indentation, don't report it. if (validateTokenIndent(firstTokenOfLine, offsets.getDesiredIndent(firstTokenOfLine))) { return; - } // Otherwise, report the token/comment. - + } + // Otherwise, report the token/comment. report(firstTokenOfLine, offsets.getDesiredIndent(firstTokenOfLine)); }); } - }); } - }; /***/ }), -/* 675 */ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.HashContainer = exports.TreeContainer = exports.SequentialContainer = exports.ContainerIterator = exports.Container = exports.HashMap = exports.HashSet = exports.OrderedMapIterator = exports.OrderedMap = exports.OrderedSetIterator = exports.OrderedSet = exports.DequeIterator = exports.Deque = exports.LinkListIterator = exports.LinkList = exports.VectorIterator = exports.Vector = exports.PriorityQueue = exports.Queue = exports.Stack = void 0; - -var Stack_1 = __webpack_require__(676); - -Object.defineProperty(exports, "Stack", ({ - enumerable: true, - get: function () { - return __importDefault(Stack_1).default; - } -})); - -var Queue_1 = __webpack_require__(678); - -Object.defineProperty(exports, "Queue", ({ - enumerable: true, - get: function () { - return __importDefault(Queue_1).default; - } -})); - -var PriorityQueue_1 = __webpack_require__(683); - -Object.defineProperty(exports, "PriorityQueue", ({ - enumerable: true, - get: function () { - return __importDefault(PriorityQueue_1).default; - } -})); - -var Vector_1 = __webpack_require__(684); - -Object.defineProperty(exports, "Vector", ({ - enumerable: true, - get: function () { - return __importDefault(Vector_1).default; - } -})); -Object.defineProperty(exports, "VectorIterator", ({ - enumerable: true, - get: function () { - return Vector_1.VectorIterator; - } -})); - -var LinkList_1 = __webpack_require__(685); - -Object.defineProperty(exports, "LinkList", ({ - enumerable: true, - get: function () { - return __importDefault(LinkList_1).default; - } -})); -Object.defineProperty(exports, "LinkListIterator", ({ - enumerable: true, - get: function () { - return LinkList_1.LinkListIterator; - } -})); - -var Deque_1 = __webpack_require__(679); - -Object.defineProperty(exports, "Deque", ({ - enumerable: true, - get: function () { - return __importDefault(Deque_1).default; - } -})); -Object.defineProperty(exports, "DequeIterator", ({ - enumerable: true, - get: function () { - return Deque_1.DequeIterator; - } -})); - -var OrderedSet_1 = __webpack_require__(686); - -Object.defineProperty(exports, "OrderedSet", ({ - enumerable: true, - get: function () { - return __importDefault(OrderedSet_1).default; - } -})); -Object.defineProperty(exports, "OrderedSetIterator", ({ - enumerable: true, - get: function () { - return OrderedSet_1.OrderedSetIterator; - } -})); - -var OrderedMap_1 = __webpack_require__(690); - -Object.defineProperty(exports, "OrderedMap", ({ - enumerable: true, - get: function () { - return __importDefault(OrderedMap_1).default; - } -})); -Object.defineProperty(exports, "OrderedMapIterator", ({ - enumerable: true, - get: function () { - return OrderedMap_1.OrderedMapIterator; - } -})); - -var HashSet_1 = __webpack_require__(691); - -Object.defineProperty(exports, "HashSet", ({ - enumerable: true, - get: function () { - return __importDefault(HashSet_1).default; - } -})); - -var HashMap_1 = __webpack_require__(693); - -Object.defineProperty(exports, "HashMap", ({ - enumerable: true, - get: function () { - return __importDefault(HashMap_1).default; - } -})); - -var index_1 = __webpack_require__(677); - -Object.defineProperty(exports, "Container", ({ - enumerable: true, - get: function () { - return index_1.Container; - } -})); -Object.defineProperty(exports, "ContainerIterator", ({ - enumerable: true, - get: function () { - return index_1.ContainerIterator; - } -})); - -var index_2 = __webpack_require__(680); - -Object.defineProperty(exports, "SequentialContainer", ({ - enumerable: true, - get: function () { - return __importDefault(index_2).default; - } -})); - -var index_3 = __webpack_require__(687); - -Object.defineProperty(exports, "TreeContainer", ({ - enumerable: true, - get: function () { - return __importDefault(index_3).default; - } -})); - -var index_4 = __webpack_require__(692); - -Object.defineProperty(exports, "HashContainer", ({ - enumerable: true, - get: function () { - return __importDefault(index_4).default; - } -})); - -/***/ }), -/* 676 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const index_1 = __webpack_require__(677); - -class Stack extends index_1.Base { - constructor() { - let container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - super(); - this.stack = []; - container.forEach(element => this.push(element)); - } - - clear() { - this.length = 0; - this.stack.length = 0; - } - /** - * @description Insert element to stack's end. - */ - - - push(element) { - this.stack.push(element); - this.length += 1; - } - /** - * @description Removes the end element. - */ - - - pop() { - this.stack.pop(); - if (this.length > 0) this.length -= 1; - } - /** - * @description Accesses the end element. - */ - - - top() { - return this.stack[this.length - 1]; - } - -} - -exports["default"] = Stack; - -/***/ }), -/* 677 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.Container = exports.Base = exports.ContainerIterator = void 0; - -class ContainerIterator { - constructor() { - let iteratorType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ContainerIterator.NORMAL; - this.iteratorType = iteratorType; - } - -} - -exports.ContainerIterator = ContainerIterator; -ContainerIterator.NORMAL = false; -ContainerIterator.REVERSE = true; - -class Base { - constructor() { - /** - * @description Container's size. - * @protected - */ - this.length = 0; - } - /** - * @return The size of the container. - */ - - - size() { - return this.length; - } - /** - * @return Boolean about if the container is empty. - */ - - - empty() { - return this.length === 0; - } - -} - -exports.Base = Base; - -class Container extends Base {} - -exports.Container = Container; - -/***/ }), -/* 678 */ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const Deque_1 = __importDefault(__webpack_require__(679)); - -const index_1 = __webpack_require__(677); - -class Queue extends index_1.Base { - constructor() { - let container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - super(); - this.queue = new Deque_1.default(container); - this.length = this.queue.size(); - } - - clear() { - this.queue.clear(); - this.length = 0; - } - /** - * @description Inserts element to queue's end. - */ - - - push(element) { - this.queue.pushBack(element); - this.length += 1; - } - /** - * @description Removes the first element. - */ - - - pop() { - this.queue.popFront(); - if (this.length) this.length -= 1; - } - /** - * @description Access the first element. - */ - - - front() { - return this.queue.front(); - } - -} - -exports["default"] = Queue; - -/***/ }), -/* 679 */ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.DequeIterator = void 0; - -const index_1 = __importDefault(__webpack_require__(680)); - -const checkParams_1 = __webpack_require__(681); - -const index_2 = __webpack_require__(677); - -const RandomIterator_1 = __webpack_require__(682); - -class DequeIterator extends RandomIterator_1.RandomIterator { - copy() { - return new DequeIterator(this.node, this.size, this.getElementByPos, this.setElementByPos, this.iteratorType); - } - -} - -exports.DequeIterator = DequeIterator; - -class Deque extends index_1.default { - constructor() { - let container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - let bucketSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1 << 12; - super(); - this.first = 0; - this.curFirst = 0; - this.last = 0; - this.curLast = 0; - this.bucketNum = 0; - this.map = []; - - let _length; - - if ('size' in container) { - if (typeof container.size === 'number') { - _length = container.size; - } else { - _length = container.size(); - } - } else if ('length' in container) { - _length = container.length; - } else { - throw new RangeError('Can\'t get container\'s size!'); - } - - this.bucketSize = bucketSize; - this.bucketNum = Math.max(Math.ceil(_length / this.bucketSize), 1); - - for (let i = 0; i < this.bucketNum; ++i) { - this.map.push(new Array(this.bucketSize)); - } - - const needBucketNum = Math.ceil(_length / this.bucketSize); - this.first = this.last = (this.bucketNum >> 1) - (needBucketNum >> 1); - this.curFirst = this.curLast = this.bucketSize - _length % this.bucketSize >> 1; - container.forEach(element => this.pushBack(element)); - this.size = this.size.bind(this); - this.getElementByPos = this.getElementByPos.bind(this); - this.setElementByPos = this.setElementByPos.bind(this); - } - /** - * @description Growth the Deque. - * @private - */ - - - reAllocate() { - const newMap = []; - const addBucketNum = Math.max(this.bucketNum >> 1, 1); - - for (let i = 0; i < addBucketNum; ++i) { - newMap[i] = new Array(this.bucketSize); - } - - for (let i = this.first; i < this.bucketNum; ++i) { - newMap[newMap.length] = this.map[i]; - } - - for (let i = 0; i < this.last; ++i) { - newMap[newMap.length] = this.map[i]; - } - - newMap[newMap.length] = [...this.map[this.last]]; - this.first = addBucketNum; - this.last = newMap.length - 1; - - for (let i = 0; i < addBucketNum; ++i) { - newMap[newMap.length] = new Array(this.bucketSize); - } - - this.map = newMap; - this.bucketNum = newMap.length; - } - /** - * @description Get the bucket position of the element and the pointer position by index. - * @param pos The element's index. - * @private - */ - - - getElementIndex(pos) { - const offset = this.curFirst + pos + 1; - const offsetRemainder = offset % this.bucketSize; - let curNodePointerIndex = offsetRemainder - 1; - let curNodeBucketIndex = this.first + (offset - offsetRemainder) / this.bucketSize; - if (offsetRemainder === 0) curNodeBucketIndex -= 1; - curNodeBucketIndex %= this.bucketNum; - if (curNodePointerIndex < 0) curNodePointerIndex += this.bucketSize; - return { - curNodeBucketIndex, - curNodePointerIndex - }; - } - - clear() { - this.map = [[]]; - this.bucketNum = 1; - this.first = this.last = this.length = 0; - this.curFirst = this.curLast = this.bucketSize >> 1; - } - - front() { - return this.map[this.first][this.curFirst]; - } - - back() { - return this.map[this.last][this.curLast]; - } - - begin() { - return new DequeIterator(0, this.size, this.getElementByPos, this.setElementByPos); - } - - end() { - return new DequeIterator(this.length, this.size, this.getElementByPos, this.setElementByPos); - } - - rBegin() { - return new DequeIterator(this.length - 1, this.size, this.getElementByPos, this.setElementByPos, index_2.ContainerIterator.REVERSE); - } - - rEnd() { - return new DequeIterator(-1, this.size, this.getElementByPos, this.setElementByPos, index_2.ContainerIterator.REVERSE); - } - - pushBack(element) { - if (this.length) { - if (this.curLast < this.bucketSize - 1) { - this.curLast += 1; - } else if (this.last < this.bucketNum - 1) { - this.last += 1; - this.curLast = 0; - } else { - this.last = 0; - this.curLast = 0; - } - - if (this.last === this.first && this.curLast === this.curFirst) this.reAllocate(); - } - - this.length += 1; - this.map[this.last][this.curLast] = element; - } - - popBack() { - if (!this.length) return; - this.map[this.last][this.curLast] = undefined; - - if (this.length !== 1) { - if (this.curLast > 0) { - this.curLast -= 1; - } else if (this.last > 0) { - this.last -= 1; - this.curLast = this.bucketSize - 1; - } else { - this.last = this.bucketNum - 1; - this.curLast = this.bucketSize - 1; - } - } - - this.length -= 1; - } - /** - * @description Push the element to the front. - * @param element The element you want to push. - */ - - - pushFront(element) { - if (this.length) { - if (this.curFirst > 0) { - this.curFirst -= 1; - } else if (this.first > 0) { - this.first -= 1; - this.curFirst = this.bucketSize - 1; - } else { - this.first = this.bucketNum - 1; - this.curFirst = this.bucketSize - 1; - } - - if (this.first === this.last && this.curFirst === this.curLast) this.reAllocate(); - } - - this.length += 1; - this.map[this.first][this.curFirst] = element; - } - /** - * @description Remove the first element. - */ - - - popFront() { - if (!this.length) return; - this.map[this.first][this.curFirst] = undefined; - - if (this.length !== 1) { - if (this.curFirst < this.bucketSize - 1) { - this.curFirst += 1; - } else if (this.first < this.bucketNum - 1) { - this.first += 1; - this.curFirst = 0; - } else { - this.first = 0; - this.curFirst = 0; - } - } - - this.length -= 1; - } - - forEach(callback) { - for (let i = 0; i < this.length; ++i) { - callback(this.getElementByPos(i), i); - } - } - - getElementByPos(pos) { - (0, checkParams_1.checkWithinAccessParams)(pos, 0, this.length - 1); - const { - curNodeBucketIndex, - curNodePointerIndex - } = this.getElementIndex(pos); - return this.map[curNodeBucketIndex][curNodePointerIndex]; - } - - setElementByPos(pos, element) { - (0, checkParams_1.checkWithinAccessParams)(pos, 0, this.length - 1); - const { - curNodeBucketIndex, - curNodePointerIndex - } = this.getElementIndex(pos); - this.map[curNodeBucketIndex][curNodePointerIndex] = element; - } - - insert(pos, element) { - let num = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; - (0, checkParams_1.checkWithinAccessParams)(pos, 0, this.length); - - if (pos === 0) { - while (num--) this.pushFront(element); - } else if (pos === this.length) { - while (num--) this.pushBack(element); - } else { - const arr = []; - - for (let i = pos; i < this.length; ++i) { - arr.push(this.getElementByPos(i)); - } - - this.cut(pos - 1); - - for (let i = 0; i < num; ++i) this.pushBack(element); - - for (let i = 0; i < arr.length; ++i) this.pushBack(arr[i]); - } - } - /** - * @description Remove all elements after the specified position (excluding the specified position). - * @param pos The previous position of the first removed element. - * @example deque.cut(1); // Then deque's size will be 2. deque -> [0, 1] - */ - - - cut(pos) { - if (pos < 0) { - this.clear(); - return; - } - - const { - curNodeBucketIndex, - curNodePointerIndex - } = this.getElementIndex(pos); - this.last = curNodeBucketIndex; - this.curLast = curNodePointerIndex; - this.length = pos + 1; - } - - eraseElementByPos(pos) { - (0, checkParams_1.checkWithinAccessParams)(pos, 0, this.length - 1); - if (pos === 0) this.popFront();else if (pos === this.length - 1) this.popBack();else { - const arr = []; - - for (let i = pos + 1; i < this.length; ++i) { - arr.push(this.getElementByPos(i)); - } - - this.cut(pos); - this.popBack(); - arr.forEach(element => this.pushBack(element)); - } - } - - eraseElementByValue(value) { - if (!this.length) return; - const arr = []; - - for (let i = 0; i < this.length; ++i) { - const element = this.getElementByPos(i); - if (element !== value) arr.push(element); - } - - const _length = arr.length; - - for (let i = 0; i < _length; ++i) this.setElementByPos(i, arr[i]); - - this.cut(_length - 1); - } - - eraseElementByIterator(iter) { - // @ts-ignore - const node = iter.node; - this.eraseElementByPos(node); - iter = iter.next(); - return iter; - } - - find(element) { - for (let i = 0; i < this.length; ++i) { - if (this.getElementByPos(i) === element) { - return new DequeIterator(i, this.size, this.getElementByPos, this.setElementByPos); - } - } - - return this.end(); - } - - reverse() { - let l = 0; - let r = this.length - 1; - - while (l < r) { - const tmp = this.getElementByPos(l); - this.setElementByPos(l, this.getElementByPos(r)); - this.setElementByPos(r, tmp); - l += 1; - r -= 1; - } - } - - unique() { - if (this.length <= 1) return; - let index = 1; - let pre = this.getElementByPos(0); - - for (let i = 1; i < this.length; ++i) { - const cur = this.getElementByPos(i); - - if (cur !== pre) { - pre = cur; - this.setElementByPos(index++, cur); - } - } - - while (this.length > index) this.popBack(); - } - - sort(cmp) { - const arr = []; - - for (let i = 0; i < this.length; ++i) { - arr.push(this.getElementByPos(i)); - } - - arr.sort(cmp); - - for (let i = 0; i < this.length; ++i) this.setElementByPos(i, arr[i]); - } - /** - * @description Remove as much useless space as possible. - */ - - - shrinkToFit() { - if (!this.length) return; - const arr = []; - this.forEach(element => arr.push(element)); - this.bucketNum = Math.max(Math.ceil(this.length / this.bucketSize), 1); - this.length = this.first = this.last = this.curFirst = this.curLast = 0; - this.map = []; - - for (let i = 0; i < this.bucketNum; ++i) { - this.map.push(new Array(this.bucketSize)); - } - - for (let i = 0; i < arr.length; ++i) this.pushBack(arr[i]); - } - - [Symbol.iterator]() { - return function* () { - for (let i = 0; i < this.length; ++i) { - yield this.getElementByPos(i); - } - }.bind(this)(); - } - -} - -exports["default"] = Deque; - -/***/ }), -/* 680 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const index_1 = __webpack_require__(677); - -class SequentialContainer extends index_1.Container {} - -exports["default"] = SequentialContainer; - -/***/ }), -/* 681 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.checkWithinAccessParams = void 0; -/** - * @description Check if access is out of bounds. - * @param pos The position want to access. - * @param lower The lower bound. - * @param upper The upper bound. - * @return Boolean about if access is out of bounds. - */ - -function checkWithinAccessParams(pos, lower, upper) { - if (pos < lower || pos > upper) { - throw new RangeError(); - } -} - -exports.checkWithinAccessParams = checkWithinAccessParams; - -/***/ }), -/* 682 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.RandomIterator = void 0; - -const checkParams_1 = __webpack_require__(681); - -const index_1 = __webpack_require__(677); - -class RandomIterator extends index_1.ContainerIterator { - constructor(index, size, getElementByPos, setElementByPos, iteratorType) { - super(iteratorType); - this.node = index; - this.size = size; - this.getElementByPos = getElementByPos; - this.setElementByPos = setElementByPos; - - if (this.iteratorType === index_1.ContainerIterator.NORMAL) { - this.pre = function () { - if (this.node === 0) { - throw new RangeError('Deque iterator access denied!'); - } - - this.node -= 1; - return this; - }; - - this.next = function () { - if (this.node === this.size()) { - throw new RangeError('Deque Iterator access denied!'); - } - - this.node += 1; - return this; - }; - } else { - this.pre = function () { - if (this.node === this.size() - 1) { - throw new RangeError('Deque iterator access denied!'); - } - - this.node += 1; - return this; - }; - - this.next = function () { - if (this.node === -1) { - throw new RangeError('Deque iterator access denied!'); - } - - this.node -= 1; - return this; - }; - } - } - - get pointer() { - (0, checkParams_1.checkWithinAccessParams)(this.node, 0, this.size() - 1); - return this.getElementByPos(this.node); - } - - set pointer(newValue) { - (0, checkParams_1.checkWithinAccessParams)(this.node, 0, this.size() - 1); - this.setElementByPos(this.node, newValue); - } - - equals(obj) { - return this.node === obj.node; - } - -} - -exports.RandomIterator = RandomIterator; - -/***/ }), -/* 683 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const index_1 = __webpack_require__(677); - -class PriorityQueue extends index_1.Base { - /** - * @description PriorityQueue's constructor. - * @param container Initialize container, must have a forEach function. - * @param cmp Compare function. - * @param copy When the container is an array, you can choose to directly operate on the original object of - * the array or perform a shallow copy. The default is shallow copy. - */ - constructor() { - let container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - let cmp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (x, y) => { - if (x > y) return -1; - if (x < y) return 1; - return 0; - }; - let copy = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; - super(); - this.cmp = cmp; - - if (Array.isArray(container)) { - this.priorityQueue = copy ? [...container] : container; - } else { - this.priorityQueue = []; - container.forEach(element => this.priorityQueue.push(element)); - } - - this.length = this.priorityQueue.length; - - for (let parent = this.length - 1 >> 1; parent >= 0; --parent) { - let curParent = parent; - let curChild = curParent << 1 | 1; - - while (curChild < this.length) { - const left = curChild; - const right = left + 1; - let minChild = left; - - if (right < this.length && this.cmp(this.priorityQueue[left], this.priorityQueue[right]) > 0) { - minChild = right; - } - - if (this.cmp(this.priorityQueue[curParent], this.priorityQueue[minChild]) <= 0) break; - [this.priorityQueue[curParent], this.priorityQueue[minChild]] = [this.priorityQueue[minChild], this.priorityQueue[curParent]]; - curParent = minChild; - curChild = curParent << 1 | 1; - } - } - } - /** - * @description Adjusting parent's children to suit the nature of the heap. - * @param parent Parent's index. - * @private - */ - - - adjust(parent) { - const left = parent << 1 | 1; - const right = (parent << 1) + 2; - - if (left < this.length && this.cmp(this.priorityQueue[parent], this.priorityQueue[left]) > 0) { - [this.priorityQueue[parent], this.priorityQueue[left]] = [this.priorityQueue[left], this.priorityQueue[parent]]; - } - - if (right < this.length && this.cmp(this.priorityQueue[parent], this.priorityQueue[right]) > 0) { - [this.priorityQueue[parent], this.priorityQueue[right]] = [this.priorityQueue[right], this.priorityQueue[parent]]; - } - } - - clear() { - this.length = 0; - this.priorityQueue.length = 0; - } - /** - * @description Push element into a container in order. - * @param element The element you want to push. - */ - - - push(element) { - this.priorityQueue.push(element); - this.length += 1; - if (this.length === 1) return; - let curNode = this.length - 1; - - while (curNode > 0) { - const parent = curNode - 1 >> 1; - if (this.cmp(this.priorityQueue[parent], element) <= 0) break; - this.adjust(parent); - curNode = parent; - } - } - /** - * @description Removes the top element. - */ - - - pop() { - if (!this.length) return; - const last = this.priorityQueue[this.length - 1]; - this.length -= 1; - let parent = 0; - - while (parent < this.length) { - const left = parent << 1 | 1; - const right = (parent << 1) + 2; - if (left >= this.length) break; - let minChild = left; - - if (right < this.length && this.cmp(this.priorityQueue[left], this.priorityQueue[right]) > 0) { - minChild = right; - } - - if (this.cmp(this.priorityQueue[minChild], last) >= 0) break; - this.priorityQueue[parent] = this.priorityQueue[minChild]; - parent = minChild; - } - - this.priorityQueue[parent] = last; - this.priorityQueue.pop(); - } - /** - * @description Accesses the top element. - */ - - - top() { - return this.priorityQueue[0]; - } - -} - -exports["default"] = PriorityQueue; - -/***/ }), -/* 684 */ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.VectorIterator = void 0; - -const index_1 = __importDefault(__webpack_require__(680)); - -const checkParams_1 = __webpack_require__(681); - -const index_2 = __webpack_require__(677); - -const RandomIterator_1 = __webpack_require__(682); - -class VectorIterator extends RandomIterator_1.RandomIterator { - copy() { - return new VectorIterator(this.node, this.size, this.getElementByPos, this.setElementByPos, this.iteratorType); - } - -} - -exports.VectorIterator = VectorIterator; - -class Vector extends index_1.default { - /** - * @description Vector's constructor. - * @param container Initialize container, must have a forEach function. - * @param copy When the container is an array, you can choose to directly operate on the original object of - * the array or perform a shallow copy. The default is shallow copy. - */ - constructor() { - let container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - let copy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - super(); - - if (Array.isArray(container)) { - this.vector = copy ? [...container] : container; - this.length = container.length; - } else { - this.vector = []; - container.forEach(element => this.pushBack(element)); - } - - this.size = this.size.bind(this); - this.getElementByPos = this.getElementByPos.bind(this); - this.setElementByPos = this.setElementByPos.bind(this); - } - - clear() { - this.length = 0; - this.vector.length = 0; - } - - begin() { - return new VectorIterator(0, this.size, this.getElementByPos, this.setElementByPos); - } - - end() { - return new VectorIterator(this.length, this.size, this.getElementByPos, this.setElementByPos); - } - - rBegin() { - return new VectorIterator(this.length - 1, this.size, this.getElementByPos, this.setElementByPos, index_2.ContainerIterator.REVERSE); - } - - rEnd() { - return new VectorIterator(-1, this.size, this.getElementByPos, this.setElementByPos, index_2.ContainerIterator.REVERSE); - } - - front() { - return this.vector[0]; - } - - back() { - return this.vector[this.length - 1]; - } - - forEach(callback) { - for (let i = 0; i < this.length; ++i) { - callback(this.vector[i], i); - } - } - - getElementByPos(pos) { - (0, checkParams_1.checkWithinAccessParams)(pos, 0, this.length - 1); - return this.vector[pos]; - } - - eraseElementByPos(pos) { - (0, checkParams_1.checkWithinAccessParams)(pos, 0, this.length - 1); - this.vector.splice(pos, 1); - this.length -= 1; - } - - eraseElementByValue(value) { - let index = 0; - - for (let i = 0; i < this.length; ++i) { - if (this.vector[i] !== value) { - this.vector[index++] = this.vector[i]; - } - } - - this.length = this.vector.length = index; - } - - eraseElementByIterator(iter) { - // @ts-ignore - const node = iter.node; - iter = iter.next(); - this.eraseElementByPos(node); - return iter; - } - - pushBack(element) { - this.vector.push(element); - this.length += 1; - } - - popBack() { - if (!this.length) return; - this.vector.pop(); - this.length -= 1; - } - - setElementByPos(pos, element) { - (0, checkParams_1.checkWithinAccessParams)(pos, 0, this.length - 1); - this.vector[pos] = element; - } - - insert(pos, element) { - let num = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; - (0, checkParams_1.checkWithinAccessParams)(pos, 0, this.length); - this.vector.splice(pos, 0, ...new Array(num).fill(element)); - this.length += num; - } - - find(element) { - for (let i = 0; i < this.length; ++i) { - if (this.vector[i] === element) { - return new VectorIterator(i, this.size, this.getElementByPos, this.getElementByPos); - } - } - - return this.end(); - } - - reverse() { - this.vector.reverse(); - } - - unique() { - let index = 1; - - for (let i = 1; i < this.length; ++i) { - if (this.vector[i] !== this.vector[i - 1]) { - this.vector[index++] = this.vector[i]; - } - } - - this.length = this.vector.length = index; - } - - sort(cmp) { - this.vector.sort(cmp); - } - - [Symbol.iterator]() { - return function* () { - return yield* this.vector; - }.bind(this)(); - } - -} - -exports["default"] = Vector; - -/***/ }), -/* 685 */ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.LinkListIterator = exports.LinkNode = void 0; - -const index_1 = __importDefault(__webpack_require__(680)); - -const checkParams_1 = __webpack_require__(681); - -const index_2 = __webpack_require__(677); - -class LinkNode { - constructor(element) { - this.value = undefined; - this.pre = undefined; - this.next = undefined; - this.value = element; - } - -} - -exports.LinkNode = LinkNode; - -class LinkListIterator extends index_2.ContainerIterator { - constructor(node, header, iteratorType) { - super(iteratorType); - this.node = node; - this.header = header; - - if (this.iteratorType === index_2.ContainerIterator.NORMAL) { - this.pre = function () { - if (this.node.pre === this.header) { - throw new RangeError('LinkList iterator access denied!'); - } - - this.node = this.node.pre; - return this; - }; - - this.next = function () { - if (this.node === this.header) { - throw new RangeError('LinkList iterator access denied!'); - } - - this.node = this.node.next; - return this; - }; - } else { - this.pre = function () { - if (this.node.next === this.header) { - throw new RangeError('LinkList iterator access denied!'); - } - - this.node = this.node.next; - return this; - }; - - this.next = function () { - if (this.node === this.header) { - throw new RangeError('LinkList iterator access denied!'); - } - - this.node = this.node.pre; - return this; - }; - } - } - - get pointer() { - if (this.node === this.header) { - throw new RangeError('LinkList iterator access denied!'); - } - - return this.node.value; - } - - set pointer(newValue) { - if (this.node === this.header) { - throw new RangeError('LinkList iterator access denied!'); - } - - this.node.value = newValue; - } - - equals(obj) { - return this.node === obj.node; - } - - copy() { - return new LinkListIterator(this.node, this.header, this.iteratorType); - } - -} - -exports.LinkListIterator = LinkListIterator; - -class LinkList extends index_1.default { - constructor() { - let container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - super(); - this.header = new LinkNode(); - this.head = undefined; - this.tail = undefined; - container.forEach(element => this.pushBack(element)); - } - - clear() { - this.length = 0; - this.head = this.tail = undefined; - this.header.pre = this.header.next = undefined; - } - - begin() { - return new LinkListIterator(this.head || this.header, this.header); - } - - end() { - return new LinkListIterator(this.header, this.header); - } - - rBegin() { - return new LinkListIterator(this.tail || this.header, this.header, index_2.ContainerIterator.REVERSE); - } - - rEnd() { - return new LinkListIterator(this.header, this.header, index_2.ContainerIterator.REVERSE); - } - - front() { - return this.head ? this.head.value : undefined; - } - - back() { - return this.tail ? this.tail.value : undefined; - } - - forEach(callback) { - if (!this.length) return; - let curNode = this.head; - let index = 0; - - while (curNode !== this.header) { - callback(curNode.value, index++); - curNode = curNode.next; - } - } - - getElementByPos(pos) { - (0, checkParams_1.checkWithinAccessParams)(pos, 0, this.length - 1); - let curNode = this.head; - - while (pos--) { - curNode = curNode.next; - } - - return curNode.value; - } - - eraseElementByPos(pos) { - (0, checkParams_1.checkWithinAccessParams)(pos, 0, this.length - 1); - if (pos === 0) this.popFront();else if (pos === this.length - 1) this.popBack();else { - let curNode = this.head; - - while (pos--) { - curNode = curNode.next; - } - - curNode = curNode; - const pre = curNode.pre; - const next = curNode.next; - next.pre = pre; - pre.next = next; - this.length -= 1; - } - } - - eraseElementByValue(value) { - while (this.head && this.head.value === value) this.popFront(); - - while (this.tail && this.tail.value === value) this.popBack(); - - if (!this.head) return; - let curNode = this.head; - - while (curNode !== this.header) { - if (curNode.value === value) { - const pre = curNode.pre; - const next = curNode.next; - if (next) next.pre = pre; - if (pre) pre.next = next; - this.length -= 1; - } - - curNode = curNode.next; - } - } - - eraseElementByIterator(iter) { - // @ts-ignore - const node = iter.node; - - if (node === this.header) { - throw new RangeError('Invalid iterator'); - } - - iter = iter.next(); - if (this.head === node) this.popFront();else if (this.tail === node) this.popBack();else { - const pre = node.pre; - const next = node.next; - if (next) next.pre = pre; - if (pre) pre.next = next; - this.length -= 1; - } - return iter; - } - - pushBack(element) { - this.length += 1; - const newTail = new LinkNode(element); - - if (!this.tail) { - this.head = this.tail = newTail; - this.header.next = this.head; - this.head.pre = this.header; - } else { - this.tail.next = newTail; - newTail.pre = this.tail; - this.tail = newTail; - } - - this.tail.next = this.header; - this.header.pre = this.tail; - } - - popBack() { - if (!this.tail) return; - this.length -= 1; - - if (this.head === this.tail) { - this.head = this.tail = undefined; - this.header.next = undefined; - } else { - this.tail = this.tail.pre; - if (this.tail) this.tail.next = undefined; - } - - this.header.pre = this.tail; - if (this.tail) this.tail.next = this.header; - } - - setElementByPos(pos, element) { - (0, checkParams_1.checkWithinAccessParams)(pos, 0, this.length - 1); - let curNode = this.head; - - while (pos--) { - curNode = curNode.next; - } - - curNode.value = element; - } - - insert(pos, element) { - let num = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; - (0, checkParams_1.checkWithinAccessParams)(pos, 0, this.length); - if (num <= 0) return; - - if (pos === 0) { - while (num--) this.pushFront(element); - } else if (pos === this.length) { - while (num--) this.pushBack(element); - } else { - let curNode = this.head; - - for (let i = 1; i < pos; ++i) { - curNode = curNode.next; - } - - const next = curNode.next; - this.length += num; - - while (num--) { - curNode.next = new LinkNode(element); - curNode.next.pre = curNode; - curNode = curNode.next; - } - - curNode.next = next; - if (next) next.pre = curNode; - } - } - - find(element) { - if (!this.head) return this.end(); - let curNode = this.head; - - while (curNode !== this.header) { - if (curNode.value === element) { - return new LinkListIterator(curNode, this.header); - } - - curNode = curNode.next; - } - - return this.end(); - } - - reverse() { - if (this.length <= 1) return; - let pHead = this.head; - let pTail = this.tail; - let cnt = 0; - - while (cnt << 1 < this.length) { - const tmp = pHead.value; - pHead.value = pTail.value; - pTail.value = tmp; - pHead = pHead.next; - pTail = pTail.pre; - cnt += 1; - } - } - - unique() { - if (this.length <= 1) return; - let curNode = this.head; - - while (curNode !== this.header) { - let tmpNode = curNode; - - while (tmpNode.next && tmpNode.value === tmpNode.next.value) { - tmpNode = tmpNode.next; - this.length -= 1; - } - - curNode.next = tmpNode.next; - if (curNode.next) curNode.next.pre = curNode; - curNode = curNode.next; - } - } - - sort(cmp) { - if (this.length <= 1) return; - const arr = []; - this.forEach(element => arr.push(element)); - arr.sort(cmp); - let curNode = this.head; - arr.forEach(element => { - curNode.value = element; - curNode = curNode.next; - }); - } - /** - * @description Push an element to the front. - * @param element The element you want to push. - */ - - - pushFront(element) { - this.length += 1; - const newHead = new LinkNode(element); - - if (!this.head) { - this.head = this.tail = newHead; - this.tail.next = this.header; - this.header.pre = this.tail; - } else { - newHead.next = this.head; - this.head.pre = newHead; - this.head = newHead; - } - - this.header.next = this.head; - this.head.pre = this.header; - } - /** - * @description Removes the first element. - */ - - - popFront() { - if (!this.head) return; - this.length -= 1; - - if (this.head === this.tail) { - this.head = this.tail = undefined; - this.header.pre = this.tail; - } else { - this.head = this.head.next; - if (this.head) this.head.pre = this.header; - } - - this.header.next = this.head; - } - /** - * @description Merges two sorted lists. - * @param list The other list you want to merge (must be sorted). - */ - - - merge(list) { - if (!this.head) { - list.forEach(element => this.pushBack(element)); - return; - } - - let curNode = this.head; - list.forEach(element => { - while (curNode && curNode !== this.header && curNode.value <= element) { - curNode = curNode.next; - } - - if (curNode === this.header) { - this.pushBack(element); - curNode = this.tail; - } else if (curNode === this.head) { - this.pushFront(element); - curNode = this.head; - } else { - this.length += 1; - const pre = curNode.pre; - pre.next = new LinkNode(element); - pre.next.pre = pre; - pre.next.next = curNode; - curNode.pre = pre.next; - } - }); - } - - [Symbol.iterator]() { - return function* () { - if (!this.head) return; - let curNode = this.head; - - while (curNode !== this.header) { - yield curNode.value; - curNode = curNode.next; - } - }.bind(this)(); - } - -} - -exports["default"] = LinkList; - -/***/ }), -/* 686 */ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.OrderedSetIterator = void 0; - -const index_1 = __importDefault(__webpack_require__(687)); - -const index_2 = __webpack_require__(677); - -const checkParams_1 = __webpack_require__(681); - -const TreeIterator_1 = __importDefault(__webpack_require__(689)); - -class OrderedSetIterator extends TreeIterator_1.default { - get pointer() { - if (this.node === this.header) { - throw new RangeError('OrderedSet iterator access denied!'); - } - - return this.node.key; - } - - copy() { - return new OrderedSetIterator(this.node, this.header, this.iteratorType); - } - -} - -exports.OrderedSetIterator = OrderedSetIterator; - -class OrderedSet extends index_1.default { - constructor() { - let container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - let cmp = arguments.length > 1 ? arguments[1] : undefined; - super(cmp); - - this.iterationFunc = function* (curNode) { - if (curNode === undefined) return; - yield* this.iterationFunc(curNode.left); - yield curNode.key; - yield* this.iterationFunc(curNode.right); - }; - - container.forEach(element => this.insert(element)); - this.iterationFunc = this.iterationFunc.bind(this); - } - - begin() { - return new OrderedSetIterator(this.header.left || this.header, this.header); - } - - end() { - return new OrderedSetIterator(this.header, this.header); - } - - rBegin() { - return new OrderedSetIterator(this.header.right || this.header, this.header, index_2.ContainerIterator.REVERSE); - } - - rEnd() { - return new OrderedSetIterator(this.header, this.header, index_2.ContainerIterator.REVERSE); - } - - front() { - return this.header.left ? this.header.left.key : undefined; - } - - back() { - return this.header.right ? this.header.right.key : undefined; - } - - forEach(callback) { - let index = 0; - - for (const element of this) callback(element, index++); - } - - getElementByPos(pos) { - (0, checkParams_1.checkWithinAccessParams)(pos, 0, this.length - 1); - let res; - let index = 0; - - for (const element of this) { - if (index === pos) { - res = element; - } - - index += 1; - } - - return res; - } - /** - * @description Insert element to set. - * @param key The key want to insert. - * @param hint You can give an iterator hint to improve insertion efficiency. - */ - - - insert(key, hint) { - this.set(key, undefined, hint); - } - - find(element) { - const curNode = this.findElementNode(this.root, element); - - if (curNode !== undefined) { - return new OrderedSetIterator(curNode, this.header); - } - - return this.end(); - } - - lowerBound(key) { - const resNode = this._lowerBound(this.root, key); - - return new OrderedSetIterator(resNode, this.header); - } - - upperBound(key) { - const resNode = this._upperBound(this.root, key); - - return new OrderedSetIterator(resNode, this.header); - } - - reverseLowerBound(key) { - const resNode = this._reverseLowerBound(this.root, key); - - return new OrderedSetIterator(resNode, this.header); - } - - reverseUpperBound(key) { - const resNode = this._reverseUpperBound(this.root, key); - - return new OrderedSetIterator(resNode, this.header); - } - - union(other) { - other.forEach(element => this.insert(element)); - } - - [Symbol.iterator]() { - return this.iterationFunc(this.root); - } - -} - -exports["default"] = OrderedSet; - -/***/ }), -/* 687 */ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const TreeNode_1 = __importDefault(__webpack_require__(688)); - -const index_1 = __webpack_require__(677); - -const checkParams_1 = __webpack_require__(681); - -class TreeContainer extends index_1.Container { - constructor() { - let cmp = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (x, y) => { - if (x < y) return -1; - if (x > y) return 1; - return 0; - }; - super(); - this.root = undefined; - this.header = new TreeNode_1.default(); - /** - * @description InOrder traversal the tree. - * @protected - */ - - this.inOrderTraversal = (curNode, callback) => { - if (curNode === undefined) return false; - const ifReturn = this.inOrderTraversal(curNode.left, callback); - if (ifReturn) return true; - if (callback(curNode)) return true; - return this.inOrderTraversal(curNode.right, callback); - }; - - this.cmp = cmp; - } - /** - * @param curNode The starting node of the search. - * @param key The key you want to search. - * @return TreeNode which key is greater than or equals to the given key. - * @protected - */ - - - _lowerBound(curNode, key) { - let resNode; - - while (curNode) { - const cmpResult = this.cmp(curNode.key, key); - - if (cmpResult < 0) { - curNode = curNode.right; - } else if (cmpResult > 0) { - resNode = curNode; - curNode = curNode.left; - } else return curNode; - } - - return resNode === undefined ? this.header : resNode; - } - /** - * @param curNode The starting node of the search. - * @param key The key you want to search. - * @return TreeNode which key is greater than the given key. - * @protected - */ - - - _upperBound(curNode, key) { - let resNode; - - while (curNode) { - const cmpResult = this.cmp(curNode.key, key); - - if (cmpResult <= 0) { - curNode = curNode.right; - } else if (cmpResult > 0) { - resNode = curNode; - curNode = curNode.left; - } - } - - return resNode === undefined ? this.header : resNode; - } - /** - * @param curNode The starting node of the search. - * @param key The key you want to search. - * @return TreeNode which key is less than or equals to the given key. - * @protected - */ - - - _reverseLowerBound(curNode, key) { - let resNode; - - while (curNode) { - const cmpResult = this.cmp(curNode.key, key); - - if (cmpResult < 0) { - resNode = curNode; - curNode = curNode.right; - } else if (cmpResult > 0) { - curNode = curNode.left; - } else return curNode; - } - - return resNode === undefined ? this.header : resNode; - } - /** - * @param curNode The starting node of the search. - * @param key The key you want to search. - * @return TreeNode which key is less than the given key. - * @protected - */ - - - _reverseUpperBound(curNode, key) { - let resNode; - - while (curNode) { - const cmpResult = this.cmp(curNode.key, key); - - if (cmpResult < 0) { - resNode = curNode; - curNode = curNode.right; - } else if (cmpResult >= 0) { - curNode = curNode.left; - } - } - - return resNode === undefined ? this.header : resNode; - } - /** - * @description Make self balance after erase a node. - * @param curNode The node want to remove. - * @protected - */ - - - eraseNodeSelfBalance(curNode) { - while (true) { - const parentNode = curNode.parent; - if (parentNode === this.header) return; - - if (curNode.color === TreeNode_1.default.RED) { - curNode.color = TreeNode_1.default.BLACK; - return; - } - - if (curNode === parentNode.left) { - const brother = parentNode.right; - - if (brother.color === TreeNode_1.default.RED) { - brother.color = TreeNode_1.default.BLACK; - parentNode.color = TreeNode_1.default.RED; - - if (parentNode === this.root) { - this.root = parentNode.rotateLeft(); - } else parentNode.rotateLeft(); - } else if (brother.color === TreeNode_1.default.BLACK) { - if (brother.right && brother.right.color === TreeNode_1.default.RED) { - brother.color = parentNode.color; - parentNode.color = TreeNode_1.default.BLACK; - brother.right.color = TreeNode_1.default.BLACK; - - if (parentNode === this.root) { - this.root = parentNode.rotateLeft(); - } else parentNode.rotateLeft(); - - return; - } else if (brother.left && brother.left.color === TreeNode_1.default.RED) { - brother.color = TreeNode_1.default.RED; - brother.left.color = TreeNode_1.default.BLACK; - brother.rotateRight(); - } else { - brother.color = TreeNode_1.default.RED; - curNode = parentNode; - } - } - } else { - const brother = parentNode.left; - - if (brother.color === TreeNode_1.default.RED) { - brother.color = TreeNode_1.default.BLACK; - parentNode.color = TreeNode_1.default.RED; - - if (parentNode === this.root) { - this.root = parentNode.rotateRight(); - } else parentNode.rotateRight(); - } else { - if (brother.left && brother.left.color === TreeNode_1.default.RED) { - brother.color = parentNode.color; - parentNode.color = TreeNode_1.default.BLACK; - brother.left.color = TreeNode_1.default.BLACK; - - if (parentNode === this.root) { - this.root = parentNode.rotateRight(); - } else parentNode.rotateRight(); - - return; - } else if (brother.right && brother.right.color === TreeNode_1.default.RED) { - brother.color = TreeNode_1.default.RED; - brother.right.color = TreeNode_1.default.BLACK; - brother.rotateLeft(); - } else { - brother.color = TreeNode_1.default.RED; - curNode = parentNode; - } - } - } - } - } - /** - * @description Remove a node. - * @param curNode The node you want to remove. - * @protected - */ - - - eraseNode(curNode) { - if (this.length === 1) { - this.clear(); - return; - } - - let swapNode = curNode; - - while (swapNode.left || swapNode.right) { - if (swapNode.right) { - swapNode = swapNode.right; - - while (swapNode.left) swapNode = swapNode.left; - } else if (swapNode.left) { - swapNode = swapNode.left; - } - - [curNode.key, swapNode.key] = [swapNode.key, curNode.key]; - [curNode.value, swapNode.value] = [swapNode.value, curNode.value]; - curNode = swapNode; - } - - if (this.header.left === swapNode) { - this.header.left = swapNode.parent; - } else if (this.header.right === swapNode) { - this.header.right = swapNode.parent; - } - - this.eraseNodeSelfBalance(swapNode); - swapNode.remove(); - this.length -= 1; - this.root.color = TreeNode_1.default.BLACK; - } - /** - * @description Make self balance after insert a node. - * @param curNode The node want to insert. - * @protected - */ - - - insertNodeSelfBalance(curNode) { - while (true) { - const parentNode = curNode.parent; - if (parentNode.color === TreeNode_1.default.BLACK) return; - const grandParent = parentNode.parent; - - if (parentNode === grandParent.left) { - const uncle = grandParent.right; - - if (uncle && uncle.color === TreeNode_1.default.RED) { - uncle.color = parentNode.color = TreeNode_1.default.BLACK; - if (grandParent === this.root) return; - grandParent.color = TreeNode_1.default.RED; - curNode = grandParent; - continue; - } else if (curNode === parentNode.right) { - curNode.color = TreeNode_1.default.BLACK; - if (curNode.left) curNode.left.parent = parentNode; - if (curNode.right) curNode.right.parent = grandParent; - parentNode.right = curNode.left; - grandParent.left = curNode.right; - curNode.left = parentNode; - curNode.right = grandParent; - - if (grandParent === this.root) { - this.root = curNode; - this.header.parent = curNode; - } else { - const GP = grandParent.parent; - - if (GP.left === grandParent) { - GP.left = curNode; - } else GP.right = curNode; - } - - curNode.parent = grandParent.parent; - parentNode.parent = curNode; - grandParent.parent = curNode; - } else { - parentNode.color = TreeNode_1.default.BLACK; - - if (grandParent === this.root) { - this.root = grandParent.rotateRight(); - } else grandParent.rotateRight(); - } - - grandParent.color = TreeNode_1.default.RED; - } else { - const uncle = grandParent.left; - - if (uncle && uncle.color === TreeNode_1.default.RED) { - uncle.color = parentNode.color = TreeNode_1.default.BLACK; - if (grandParent === this.root) return; - grandParent.color = TreeNode_1.default.RED; - curNode = grandParent; - continue; - } else if (curNode === parentNode.left) { - curNode.color = TreeNode_1.default.BLACK; - if (curNode.left) curNode.left.parent = grandParent; - if (curNode.right) curNode.right.parent = parentNode; - grandParent.right = curNode.left; - parentNode.left = curNode.right; - curNode.left = grandParent; - curNode.right = parentNode; - - if (grandParent === this.root) { - this.root = curNode; - this.header.parent = curNode; - } else { - const GP = grandParent.parent; - - if (GP.left === grandParent) { - GP.left = curNode; - } else GP.right = curNode; - } - - curNode.parent = grandParent.parent; - parentNode.parent = curNode; - grandParent.parent = curNode; - } else { - parentNode.color = TreeNode_1.default.BLACK; - - if (grandParent === this.root) { - this.root = grandParent.rotateLeft(); - } else grandParent.rotateLeft(); - } - - grandParent.color = TreeNode_1.default.RED; - } - - return; - } - } - /** - * @description Find node which key is equals to the given key. - * @param curNode The starting node of the search. - * @param key The key you want to search. - * @protected - */ - - - findElementNode(curNode, key) { - while (curNode) { - const cmpResult = this.cmp(curNode.key, key); - - if (cmpResult < 0) { - curNode = curNode.right; - } else if (cmpResult > 0) { - curNode = curNode.left; - } else return curNode; - } - - return curNode; - } - /** - * @description Insert a key-value pair or set value by the given key. - * @param key The key want to insert. - * @param value The value want to set. - * @param hint You can give an iterator hint to improve insertion efficiency. - * @protected - */ - - - set(key, value, hint) { - if (this.root === undefined) { - this.length += 1; - this.root = new TreeNode_1.default(key, value); - this.root.color = TreeNode_1.default.BLACK; - this.root.parent = this.header; - this.header.parent = this.root; - this.header.left = this.root; - this.header.right = this.root; - return; - } - - let curNode; - const minNode = this.header.left; - const compareToMin = this.cmp(minNode.key, key); - - if (compareToMin === 0) { - minNode.value = value; - return; - } else if (compareToMin > 0) { - minNode.left = new TreeNode_1.default(key, value); - minNode.left.parent = minNode; - curNode = minNode.left; - this.header.left = curNode; - } else { - const maxNode = this.header.right; - const compareToMax = this.cmp(maxNode.key, key); - - if (compareToMax === 0) { - maxNode.value = value; - return; - } else if (compareToMax < 0) { - maxNode.right = new TreeNode_1.default(key, value); - maxNode.right.parent = maxNode; - curNode = maxNode.right; - this.header.right = curNode; - } else { - if (hint !== undefined) { - // @ts-ignore - const iterNode = hint.node; - - if (iterNode !== this.header) { - const iterCmpRes = this.cmp(iterNode.key, key); - - if (iterCmpRes === 0) { - iterNode.value = value; - return; - } else if (iterCmpRes > 0) { - const preNode = iterNode.pre(); - const preCmpRes = this.cmp(preNode.key, key); - - if (preCmpRes === 0) { - preNode.value = value; - return; - } else if (preCmpRes < 0) { - curNode = new TreeNode_1.default(key, value); - - if (preNode.right === undefined) { - preNode.right = curNode; - curNode.parent = preNode; - } else { - iterNode.left = curNode; - curNode.parent = iterNode; - } - } - } - } - } - - if (curNode === undefined) { - curNode = this.root; - - while (true) { - const cmpResult = this.cmp(curNode.key, key); - - if (cmpResult > 0) { - if (curNode.left === undefined) { - curNode.left = new TreeNode_1.default(key, value); - curNode.left.parent = curNode; - curNode = curNode.left; - break; - } - - curNode = curNode.left; - } else if (cmpResult < 0) { - if (curNode.right === undefined) { - curNode.right = new TreeNode_1.default(key, value); - curNode.right.parent = curNode; - curNode = curNode.right; - break; - } - - curNode = curNode.right; - } else { - curNode.value = value; - return; - } - } - } - } - } - - this.length += 1; - this.insertNodeSelfBalance(curNode); - } - - clear() { - this.length = 0; - this.root = undefined; - this.header.parent = undefined; - this.header.left = this.header.right = undefined; - } - /** - * @description Update node's key by iterator. - * @param iter The iterator you want to change. - * @param key The key you want to update. - * @return Boolean about if the modification is successful. - */ - - - updateKeyByIterator(iter, key) { - // @ts-ignore - const node = iter.node; - - if (node === this.header) { - throw new TypeError('Invalid iterator!'); - } - - if (this.length === 1) { - node.key = key; - return true; - } - - if (node === this.header.left) { - if (this.cmp(node.next().key, key) > 0) { - node.key = key; - return true; - } - - return false; - } - - if (node === this.header.right) { - if (this.cmp(node.pre().key, key) < 0) { - node.key = key; - return true; - } - - return false; - } - - const preKey = node.pre().key; - if (this.cmp(preKey, key) >= 0) return false; - const nextKey = node.next().key; - if (this.cmp(nextKey, key) <= 0) return false; - node.key = key; - return true; - } - - eraseElementByPos(pos) { - (0, checkParams_1.checkWithinAccessParams)(pos, 0, this.length - 1); - let index = 0; - this.inOrderTraversal(this.root, curNode => { - if (pos === index) { - this.eraseNode(curNode); - return true; - } - - index += 1; - return false; - }); - } - /** - * @description Remove the element of the specified key. - * @param key The key you want to remove. - */ - - - eraseElementByKey(key) { - if (!this.length) return; - const curNode = this.findElementNode(this.root, key); - if (curNode === undefined) return; - this.eraseNode(curNode); - } - - eraseElementByIterator(iter) { - // @ts-ignore - const node = iter.node; - - if (node === this.header) { - throw new RangeError('Invalid iterator'); - } - - if (node.right === undefined) { - iter = iter.next(); - } - - this.eraseNode(node); - return iter; - } - /** - * @description Get the height of the tree. - * @return Number about the height of the RB-tree. - */ - - - getHeight() { - if (!this.length) return 0; - - const traversal = curNode => { - if (!curNode) return 0; - return Math.max(traversal(curNode.left), traversal(curNode.right)) + 1; - }; - - return traversal(this.root); - } - -} - -exports["default"] = TreeContainer; - -/***/ }), -/* 688 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -class TreeNode { - constructor(key, value) { - this.color = true; - this.key = undefined; - this.value = undefined; - this.left = undefined; - this.right = undefined; - this.parent = undefined; - this.key = key; - this.value = value; - } - /** - * @description Get the pre node. - * @return TreeNode about the pre node. - */ - - - pre() { - let preNode = this; - - if (preNode.color === TreeNode.RED && preNode.parent.parent === preNode) { - preNode = preNode.right; - } else if (preNode.left) { - preNode = preNode.left; - - while (preNode.right) { - preNode = preNode.right; - } - } else { - let pre = preNode.parent; - - while (pre.left === preNode) { - preNode = pre; - pre = preNode.parent; - } - - preNode = pre; - } - - return preNode; - } - /** - * @description Get the next node. - * @return TreeNode about the next node. - */ - - - next() { - let nextNode = this; - - if (nextNode.right) { - nextNode = nextNode.right; - - while (nextNode.left) { - nextNode = nextNode.left; - } - } else { - let pre = nextNode.parent; - - while (pre.right === nextNode) { - nextNode = pre; - pre = nextNode.parent; - } - - if (nextNode.right !== pre) { - nextNode = pre; - } - } - - return nextNode; - } - /** - * @description Rotate left. - * @return TreeNode about moved to original position after rotation. - */ - - - rotateLeft() { - const PP = this.parent; - const V = this.right; - const R = V.left; - if (PP.parent === this) PP.parent = V;else if (PP.left === this) PP.left = V;else PP.right = V; - V.parent = PP; - V.left = this; - this.parent = V; - this.right = R; - if (R) R.parent = this; - return V; - } - /** - * @description Rotate left. - * @return TreeNode about moved to original position after rotation. - */ - - - rotateRight() { - const PP = this.parent; - const F = this.left; - const K = F.right; - if (PP.parent === this) PP.parent = F;else if (PP.left === this) PP.left = F;else PP.right = F; - F.parent = PP; - F.right = this; - this.parent = F; - this.left = K; - if (K) K.parent = this; - return F; - } - /** - * @description Remove this. - */ - - - remove() { - const parent = this.parent; - - if (this === parent.left) { - parent.left = undefined; - } else parent.right = undefined; - } - -} - -TreeNode.RED = true; -TreeNode.BLACK = false; -exports["default"] = TreeNode; - -/***/ }), -/* 689 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const index_1 = __webpack_require__(677); - -class TreeIterator extends index_1.ContainerIterator { - constructor(node, header, iteratorType) { - super(iteratorType); - this.node = node; - this.header = header; - - if (this.iteratorType === index_1.ContainerIterator.NORMAL) { - this.pre = function () { - if (this.node === this.header.left) { - throw new RangeError('LinkList iterator access denied!'); - } - - this.node = this.node.pre(); - return this; - }; - - this.next = function () { - if (this.node === this.header) { - throw new RangeError('LinkList iterator access denied!'); - } - - this.node = this.node.next(); - return this; - }; - } else { - this.pre = function () { - if (this.node === this.header.right) { - throw new RangeError('LinkList iterator access denied!'); - } - - this.node = this.node.next(); - return this; - }; - - this.next = function () { - if (this.node === this.header) { - throw new RangeError('LinkList iterator access denied!'); - } - - this.node = this.node.pre(); - return this; - }; - } - } - - equals(obj) { - return this.node === obj.node; - } - -} - -exports["default"] = TreeIterator; - -/***/ }), -/* 690 */ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.OrderedMapIterator = void 0; - -const index_1 = __webpack_require__(677); - -const checkParams_1 = __webpack_require__(681); - -const index_2 = __importDefault(__webpack_require__(687)); - -const TreeIterator_1 = __importDefault(__webpack_require__(689)); - -class OrderedMapIterator extends TreeIterator_1.default { - get pointer() { - if (this.node === this.header) { - throw new RangeError('OrderedMap iterator access denied'); - } - - return new Proxy([], { - get: (_, props) => { - if (props === '0') return this.node.key;else if (props === '1') return this.node.value; - }, - set: (_, props, newValue) => { - if (props !== '1') { - throw new TypeError('props must be 1'); - } - - this.node.value = newValue; - return true; - } - }); - } - - copy() { - return new OrderedMapIterator(this.node, this.header, this.iteratorType); - } - -} - -exports.OrderedMapIterator = OrderedMapIterator; - -class OrderedMap extends index_2.default { - constructor() { - let container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - let cmp = arguments.length > 1 ? arguments[1] : undefined; - super(cmp); - - this.iterationFunc = function* (curNode) { - if (curNode === undefined) return; - yield* this.iterationFunc(curNode.left); - yield [curNode.key, curNode.value]; - yield* this.iterationFunc(curNode.right); - }; - - this.iterationFunc = this.iterationFunc.bind(this); - container.forEach(_ref => { - let [key, value] = _ref; - return this.setElement(key, value); - }); - } - - begin() { - return new OrderedMapIterator(this.header.left || this.header, this.header); - } - - end() { - return new OrderedMapIterator(this.header, this.header); - } - - rBegin() { - return new OrderedMapIterator(this.header.right || this.header, this.header, index_1.ContainerIterator.REVERSE); - } - - rEnd() { - return new OrderedMapIterator(this.header, this.header, index_1.ContainerIterator.REVERSE); - } - - front() { - if (!this.length) return undefined; - const minNode = this.header.left; - return [minNode.key, minNode.value]; - } - - back() { - if (!this.length) return undefined; - const maxNode = this.header.right; - return [maxNode.key, maxNode.value]; - } - - forEach(callback) { - let index = 0; - - for (const pair of this) callback(pair, index++); - } - - lowerBound(key) { - const resNode = this._lowerBound(this.root, key); - - return new OrderedMapIterator(resNode, this.header); - } - - upperBound(key) { - const resNode = this._upperBound(this.root, key); - - return new OrderedMapIterator(resNode, this.header); - } - - reverseLowerBound(key) { - const resNode = this._reverseLowerBound(this.root, key); - - return new OrderedMapIterator(resNode, this.header); - } - - reverseUpperBound(key) { - const resNode = this._reverseUpperBound(this.root, key); - - return new OrderedMapIterator(resNode, this.header); - } - /** - * @description Insert a key-value pair or set value by the given key. - * @param key The key want to insert. - * @param value The value want to set. - * @param hint You can give an iterator hint to improve insertion efficiency. - */ - - - setElement(key, value, hint) { - this.set(key, value, hint); - } - - find(key) { - const curNode = this.findElementNode(this.root, key); - - if (curNode !== undefined) { - return new OrderedMapIterator(curNode, this.header); - } - - return this.end(); - } - /** - * @description Get the value of the element of the specified key. - */ - - - getElementByKey(key) { - const curNode = this.findElementNode(this.root, key); - return curNode ? curNode.value : undefined; - } - - getElementByPos(pos) { - (0, checkParams_1.checkWithinAccessParams)(pos, 0, this.length - 1); - let res; - let index = 0; - - for (const pair of this) { - if (index === pos) { - res = pair; - break; - } - - index += 1; - } - - return res; - } - - union(other) { - other.forEach(_ref2 => { - let [key, value] = _ref2; - return this.setElement(key, value); - }); - } - - [Symbol.iterator]() { - return this.iterationFunc(this.root); - } - -} - -exports["default"] = OrderedMap; - -/***/ }), -/* 691 */ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const index_1 = __importDefault(__webpack_require__(692)); - -const Vector_1 = __importDefault(__webpack_require__(684)); - -const OrderedSet_1 = __importDefault(__webpack_require__(686)); - -class HashSet extends index_1.default { - constructor() { - let container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - let initBucketNum = arguments.length > 1 ? arguments[1] : undefined; - let hashFunc = arguments.length > 2 ? arguments[2] : undefined; - super(initBucketNum, hashFunc); - this.hashTable = []; - container.forEach(element => this.insert(element)); - } - - reAllocate() { - if (this.bucketNum >= index_1.default.maxBucketNum) return; - const newHashTable = []; - const originalBucketNum = this.bucketNum; - this.bucketNum <<= 1; - const keys = Object.keys(this.hashTable); - const keyNums = keys.length; - - for (let i = 0; i < keyNums; ++i) { - const index = parseInt(keys[i]); - const container = this.hashTable[index]; - const size = container.size(); - if (size === 0) continue; - - if (size === 1) { - const element = container.front(); - newHashTable[this.hashFunc(element) & this.bucketNum - 1] = new Vector_1.default([element], false); - continue; - } - - const lowList = []; - const highList = []; - container.forEach(element => { - const hashCode = this.hashFunc(element); - - if ((hashCode & originalBucketNum) === 0) { - lowList.push(element); - } else highList.push(element); - }); - - if (container instanceof OrderedSet_1.default) { - if (lowList.length > index_1.default.untreeifyThreshold) { - newHashTable[index] = new OrderedSet_1.default(lowList); - } else if (lowList.length) { - newHashTable[index] = new Vector_1.default(lowList, false); - } - - if (highList.length > index_1.default.untreeifyThreshold) { - newHashTable[index + originalBucketNum] = new OrderedSet_1.default(highList); - } else if (highList.length) { - newHashTable[index + originalBucketNum] = new Vector_1.default(highList, false); - } - } else { - if (lowList.length >= index_1.default.treeifyThreshold) { - newHashTable[index] = new OrderedSet_1.default(lowList); - } else if (lowList.length) { - newHashTable[index] = new Vector_1.default(lowList, false); - } - - if (highList.length >= index_1.default.treeifyThreshold) { - newHashTable[index + originalBucketNum] = new OrderedSet_1.default(highList); - } else if (highList.length) { - newHashTable[index + originalBucketNum] = new Vector_1.default(highList, false); - } - } - } - - this.hashTable = newHashTable; - } - - forEach(callback) { - const containers = Object.values(this.hashTable); - const containersNum = containers.length; - let index = 0; - - for (let i = 0; i < containersNum; ++i) { - containers[i].forEach(element => callback(element, index++)); - } - } - /** - * @description Insert element to hash set. - * @param element The element you want to insert. - */ - - - insert(element) { - const index = this.hashFunc(element) & this.bucketNum - 1; - const container = this.hashTable[index]; - - if (!container) { - this.hashTable[index] = new Vector_1.default([element], false); - this.length += 1; - } else { - const preSize = container.size(); - - if (container instanceof Vector_1.default) { - if (!container.find(element).equals(container.end())) return; - container.pushBack(element); - - if (preSize + 1 >= index_1.default.treeifyThreshold) { - if (this.bucketNum <= index_1.default.minTreeifySize) { - this.length += 1; - this.reAllocate(); - return; - } - - this.hashTable[index] = new OrderedSet_1.default(container); - } - - this.length += 1; - } else { - container.insert(element); - const curSize = container.size(); - this.length += curSize - preSize; - } - } - - if (this.length > this.bucketNum * index_1.default.sigma) { - this.reAllocate(); - } - } - - eraseElementByKey(key) { - const index = this.hashFunc(key) & this.bucketNum - 1; - const container = this.hashTable[index]; - if (!container) return; - const preSize = container.size(); - if (preSize === 0) return; - - if (container instanceof Vector_1.default) { - container.eraseElementByValue(key); - const curSize = container.size(); - this.length += curSize - preSize; - } else { - container.eraseElementByKey(key); - const curSize = container.size(); - this.length += curSize - preSize; - - if (curSize <= index_1.default.untreeifyThreshold) { - this.hashTable[index] = new Vector_1.default(container); - } - } - } - - find(element) { - const index = this.hashFunc(element) & this.bucketNum - 1; - const container = this.hashTable[index]; - if (!container) return false; - return !container.find(element).equals(container.end()); - } - - [Symbol.iterator]() { - return function* () { - const containers = Object.values(this.hashTable); - const containersNum = containers.length; - - for (let i = 0; i < containersNum; ++i) { - const container = containers[i]; - - for (const element of container) { - yield element; - } - } - }.bind(this)(); - } - -} - -exports["default"] = HashSet; - -/***/ }), -/* 692 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const index_1 = __webpack_require__(677); - -class HashContainer extends index_1.Base { - constructor() { - let initBucketNum = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 16; - let hashFunc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x => { - let str; - - if (typeof x !== 'string') { - str = JSON.stringify(x); - } else str = x; - - let hashCode = 0; - const strLength = str.length; - - for (let i = 0; i < strLength; i++) { - const ch = str.charCodeAt(i); - hashCode = (hashCode << 5) - hashCode + ch; - hashCode |= 0; - } - - return hashCode >>> 0; - }; - super(); - - if (initBucketNum < 16 || (initBucketNum & initBucketNum - 1) !== 0) { - throw new RangeError('InitBucketNum range error'); - } - - this.bucketNum = this.initBucketNum = initBucketNum; - this.hashFunc = hashFunc; - } - - clear() { - this.length = 0; - this.bucketNum = this.initBucketNum; - this.hashTable = []; - } - -} - -HashContainer.sigma = 0.75; -HashContainer.treeifyThreshold = 8; -HashContainer.untreeifyThreshold = 6; -HashContainer.minTreeifySize = 64; -HashContainer.maxBucketNum = 1 << 30; -exports["default"] = HashContainer; - -/***/ }), -/* 693 */ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - - -var __importDefault = this && this.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; -}; - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const index_1 = __importDefault(__webpack_require__(692)); - -const Vector_1 = __importDefault(__webpack_require__(684)); - -const OrderedMap_1 = __importDefault(__webpack_require__(690)); - -class HashMap extends index_1.default { - constructor() { - let container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - let initBucketNum = arguments.length > 1 ? arguments[1] : undefined; - let hashFunc = arguments.length > 2 ? arguments[2] : undefined; - super(initBucketNum, hashFunc); - this.hashTable = []; - container.forEach(element => this.setElement(element[0], element[1])); - } - - reAllocate() { - if (this.bucketNum >= index_1.default.maxBucketNum) return; - const newHashTable = []; - const originalBucketNum = this.bucketNum; - this.bucketNum <<= 1; - const keys = Object.keys(this.hashTable); - const keyNums = keys.length; - - for (let i = 0; i < keyNums; ++i) { - const index = parseInt(keys[i]); - const container = this.hashTable[index]; - const size = container.size(); - if (size === 0) continue; - - if (size === 1) { - const element = container.front(); - newHashTable[this.hashFunc(element[0]) & this.bucketNum - 1] = new Vector_1.default([element], false); - continue; - } - - const lowList = []; - const highList = []; - container.forEach(element => { - const hashCode = this.hashFunc(element[0]); - - if ((hashCode & originalBucketNum) === 0) { - lowList.push(element); - } else highList.push(element); - }); - - if (container instanceof OrderedMap_1.default) { - if (lowList.length > index_1.default.untreeifyThreshold) { - newHashTable[index] = new OrderedMap_1.default(lowList); - } else if (lowList.length) { - newHashTable[index] = new Vector_1.default(lowList, false); - } - - if (highList.length > index_1.default.untreeifyThreshold) { - newHashTable[index + originalBucketNum] = new OrderedMap_1.default(highList); - } else if (highList.length) { - newHashTable[index + originalBucketNum] = new Vector_1.default(highList, false); - } - } else { - if (lowList.length >= index_1.default.treeifyThreshold) { - newHashTable[index] = new OrderedMap_1.default(lowList); - } else if (lowList.length) { - newHashTable[index] = new Vector_1.default(lowList, false); - } - - if (highList.length >= index_1.default.treeifyThreshold) { - newHashTable[index + originalBucketNum] = new OrderedMap_1.default(highList); - } else if (highList.length) { - newHashTable[index + originalBucketNum] = new Vector_1.default(highList, false); - } - } - } - - this.hashTable = newHashTable; - } - - forEach(callback) { - const containers = Object.values(this.hashTable); - const containersNum = containers.length; - let index = 0; - - for (let i = 0; i < containersNum; ++i) { - containers[i].forEach(element => callback(element, index++)); - } - } - /** - * @description Insert a new key-value pair to hash map or set value by key. - * @param key The key you want to insert. - * @param value The value you want to insert. - * @example HashMap.setElement(1, 2); // insert a key-value pair [1, 2] - */ - - - setElement(key, value) { - const index = this.hashFunc(key) & this.bucketNum - 1; - const container = this.hashTable[index]; - - if (!container) { - this.length += 1; - this.hashTable[index] = new Vector_1.default([[key, value]], false); - } else { - const preSize = container.size(); - - if (container instanceof Vector_1.default) { - for (const pair of container) { - if (pair[0] === key) { - pair[1] = value; - return; - } - } - - container.pushBack([key, value]); - - if (preSize + 1 >= HashMap.treeifyThreshold) { - if (this.bucketNum <= HashMap.minTreeifySize) { - this.length += 1; - this.reAllocate(); - return; - } - - this.hashTable[index] = new OrderedMap_1.default(this.hashTable[index]); - } - - this.length += 1; - } else { - container.setElement(key, value); - const curSize = container.size(); - this.length += curSize - preSize; - } - } - - if (this.length > this.bucketNum * HashMap.sigma) { - this.reAllocate(); - } - } - /** - * @description Get the value of the element which has the specified key. - * @param key The key you want to get. - */ - - - getElementByKey(key) { - const index = this.hashFunc(key) & this.bucketNum - 1; - const container = this.hashTable[index]; - if (!container) return undefined; - - if (container instanceof OrderedMap_1.default) { - return container.getElementByKey(key); - } else { - for (const pair of container) { - if (pair[0] === key) return pair[1]; - } - - return undefined; - } - } - - eraseElementByKey(key) { - const index = this.hashFunc(key) & this.bucketNum - 1; - const container = this.hashTable[index]; - if (!container) return; - - if (container instanceof Vector_1.default) { - let pos = 0; - - for (const pair of container) { - if (pair[0] === key) { - container.eraseElementByPos(pos); - this.length -= 1; - return; - } - - pos += 1; - } - } else { - const preSize = container.size(); - container.eraseElementByKey(key); - const curSize = container.size(); - this.length += curSize - preSize; - - if (curSize <= index_1.default.untreeifyThreshold) { - this.hashTable[index] = new Vector_1.default(container); - } - } - } - - find(key) { - const index = this.hashFunc(key) & this.bucketNum - 1; - const container = this.hashTable[index]; - if (!container) return false; - - if (container instanceof OrderedMap_1.default) { - return !container.find(key).equals(container.end()); - } - - for (const pair of container) { - if (pair[0] === key) return true; - } - - return false; - } - - [Symbol.iterator]() { - return function* () { - const containers = Object.values(this.hashTable); - const containersNum = containers.length; - - for (let i = 0; i < containersNum; ++i) { - const container = containers[i]; - - for (const element of container) { - yield element; - } - } - }.bind(this)(); - } - -} - -exports["default"] = HashMap; - -/***/ }), -/* 694 */ +/* 701 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -78918,27 +69768,27 @@ exports["default"] = HashMap; * @author Gyandeep Singh * @deprecated in ESLint v4.0.0 */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ // this rule has known coverage issues, but it's deprecated and shouldn't be updated in the future anyway. - /* c8 ignore next */ - /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent indentation", recommended: false, - url: "https://eslint.org/docs/rules/indent-legacy" + url: "https://eslint.org/docs/latest/rules/indent-legacy" }, deprecated: true, replacedBy: ["indent"], @@ -79057,11 +69907,9 @@ module.exports = { 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; @@ -79087,26 +69935,20 @@ module.exports = { ArrayExpression: 1, ObjectExpression: 1 }; - const sourceCode = context.getSourceCode(); - + const sourceCode = context.sourceCode; if (context.options.length) { if (context.options[0] === "tab") { indentSize = 1; indentType = "tab"; - } else - /* c8 ignore start */ - if (typeof context.options[0] === "number") { + } else /* c8 ignore start */if (typeof context.options[0] === "number") { indentSize = context.options[0]; indentType = "space"; - } - /* c8 ignore stop */ - + } /* c8 ignore stop */ 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, @@ -79116,38 +69958,31 @@ module.exports = { } 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 @@ -79155,16 +69990,11 @@ module.exports = { * @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) { @@ -79178,12 +70008,12 @@ module.exports = { } else { foundStatement = "0"; } - return { expected: expectedStatement, actual: foundStatement }; } + /** * Reports a given indent violation * @param {ASTNode} node Node violating the indent rule @@ -79194,14 +70024,11 @@ module.exports = { * @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({ @@ -79212,6 +70039,7 @@ module.exports = { fix: fixer => fixer.replaceTextRange(textRange, desiredIndent) }); } + /** * Get the actual indent of node * @param {ASTNode|Token} node Node to examine @@ -79220,8 +70048,6 @@ module.exports = { * 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(""); @@ -79235,82 +70061,71 @@ module.exports = { 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; + 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, @@ -79318,6 +70133,7 @@ module.exports = { }, 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 ';' @@ -79325,8 +70141,6 @@ module.exports = { * @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 ')' @@ -79334,14 +70148,11 @@ module.exports = { */ 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, @@ -79349,17 +70160,15 @@ module.exports = { }, 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, @@ -79367,6 +70176,7 @@ module.exports = { }); } } + /** * Returns a parent node of given node based on a specified type * if not present then return null @@ -79375,29 +70185,25 @@ module.exports = { * @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 @@ -79405,63 +70211,54 @@ module.exports = { * @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. @@ -79477,9 +70274,7 @@ module.exports = { * 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; @@ -79487,10 +70282,8 @@ module.exports = { // 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; @@ -79501,14 +70294,12 @@ module.exports = { } } } + /* * 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") { @@ -79516,66 +70307,61 @@ module.exports = { } else if (calleeNode.type === "FunctionDeclaration") { functionOffset = options.FunctionDeclaration.body * indentSize; } + indent += functionOffset; - indent += functionOffset; // check if the node is inside a variable - + // 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; + 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; - 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 - + // 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 + 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. [{ @@ -79606,75 +70392,64 @@ module.exports = { } } } - 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.includes(node.parent.type) && isNodeBodyBlock(node)) { indent = getNodeIndent(node.parent).goodChar; } else if (node.parent && node.parent.type === "CatchClause") { @@ -79682,7 +70457,6 @@ module.exports = { } else { indent = getNodeIndent(node).goodChar; } - if (node.type === "IfStatement" && node.consequent.type !== "BlockStatement") { nodesToCheck = [node.consequent]; } else if (Array.isArray(node.body)) { @@ -79690,54 +70464,47 @@ module.exports = { } 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 + 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); @@ -79745,58 +70512,51 @@ module.exports = { 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 whether 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) { @@ -79804,7 +70564,6 @@ module.exports = { checkNodesIndent(node.body, getNodeIndent(node).goodChar); } }, - ClassBody: blockIndentationCheck, BlockStatement: blockIndentationCheck, WhileStatement: blockLessNodes, @@ -79812,62 +70571,50 @@ module.exports = { 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; @@ -79875,74 +70622,63 @@ module.exports = { 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; - const firstLineIndent = getNodeIndent(node).goodChar; // in case if return statement is wrapped in parenthesis - + // 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); } } - }; } - }; /***/ }), -/* 695 */ +/* 702 */ /***/ ((module) => { "use strict"; @@ -79950,7 +70686,10 @@ module.exports = { * @fileoverview A rule to control the style of variable initializations. * @author Colin Ihrig */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -79959,44 +70698,39 @@ module.exports = { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Require or disallow initialization in variable declarations", recommended: false, - url: "https://eslint.org/docs/rules/init-declarations" + url: "https://eslint.org/docs/latest/rules/init-declarations" }, schema: { anyOf: [{ @@ -80028,33 +70762,31 @@ module.exports = { notInitialized: "Variable '{{idName}}' should not be initialized on declaration." } }, - create(context) { const MODE_ALWAYS = "always", - MODE_NEVER = "never"; + MODE_NEVER = "never"; const mode = context.options[0] || MODE_ALWAYS; - const params = context.options[1] || {}; //-------------------------------------------------------------------------- + const params = context.options[1] || {}; + + //-------------------------------------------------------------------------- // Public API //-------------------------------------------------------------------------- return { "VariableDeclaration:exit"(node) { const kind = node.kind, - declarations = node.declarations; - + 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); + 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, @@ -80066,14 +70798,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 696 */ +/* 703 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -80081,47 +70811,47 @@ module.exports = { * @fileoverview A rule to ensure consistent quotes used in jsx syntax. * @author Mathias Schreck */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // 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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "layout", docs: { description: "Enforce the consistent use of either double or single quotes in JSX attributes", recommended: false, - url: "https://eslint.org/docs/rules/jsx-quotes" + url: "https://eslint.org/docs/latest/rules/jsx-quotes" }, fixable: "whitespace", schema: [{ @@ -80131,25 +70861,22 @@ module.exports = { unexpected: "Unexpected usage of {{description}}." } }, - create(context) { const quoteOption = context.options[0] || "prefer-double", - setting = QUOTE_SETTINGS[quoteOption]; + 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.includes(setting.quote) || astUtils.isSurroundedBy(node.raw, setting.quote); } - return { JSXAttribute(node) { const attributeValue = node.value; - if (attributeValue && astUtils.isStringLiteral(attributeValue) && !usesExpectedQuotes(attributeValue)) { context.report({ node: attributeValue, @@ -80157,22 +70884,18 @@ module.exports = { data: { description: setting.description }, - fix(fixer) { return fixer.replaceText(attributeValue, setting.convert(attributeValue.raw)); } - }); } } - }; } - }; /***/ }), -/* 697 */ +/* 704 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -80180,17 +70903,15 @@ module.exports = { * @fileoverview Rule to specify spacing of object literal keys and values * @author Brandon Mills */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - -const astUtils = __webpack_require__(618); - -const GraphemeSplitter = __webpack_require__(698); - -const splitter = new GraphemeSplitter(); //------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); +const { + getGraphemeCount +} = __webpack_require__(663); /** * Checks whether a string contains a line terminator as defined in @@ -80198,67 +70919,63 @@ const splitter = new GraphemeSplitter(); //------------------------------------- * @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); + 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 + 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 - + } + // Set value of afterColon if (typeof fromOptions.afterColon !== "undefined") { toOptions.afterColon = +fromOptions.afterColon; } else { toOptions.afterColon = 1; - } // Set align if exists - + } + // Set align if exists if (typeof fromOptions.align !== "undefined") { if (typeof fromOptions.align === "object") { toOptions.align = fromOptions.align; @@ -80272,17 +70989,15 @@ function initOptionProperty(toOptions, fromOptions) { }; } } - 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 @@ -80294,8 +71009,9 @@ function initOptions(toOptions, 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 + 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, @@ -80305,22 +71021,21 @@ function initOptions(toOptions, fromOptions) { }; } } - return toOptions; -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent spacing between keys and values in object literal properties", recommended: false, - url: "https://eslint.org/docs/rules/key-spacing" + url: "https://eslint.org/docs/latest/rules/key-spacing" }, fixable: "whitespace", schema: [{ @@ -80479,7 +71194,6 @@ module.exports = { missingValue: "Missing space before value for {{computed}}key '{{key}}'." } }, - create(context) { /** * OPTIONS @@ -80490,96 +71204,97 @@ module.exports = { * } */ const options = context.options[0] || {}, - ruleOptions = initOptions({}, options), - multiLineOptions = ruleOptions.multiLine, - singleLineOptions = ruleOptions.singleLine, - alignmentOptions = ruleOptions.align || null; - const sourceCode = context.getSourceCode(); + ruleOptions = initOptions({}, options), + multiLineOptions = ruleOptions.multiLine, + singleLineOptions = ruleOptions.singleLine, + alignmentOptions = ruleOptions.align || null; + const sourceCode = context.sourceCode; + + /** + * 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 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); + } + + /** + * Starting from the given 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 = getNextColon(node); + return sourceCode.getTokenBefore(colonToken); + } + + /** + * Starting from the given node (a property.key node here) looks forward + * until it finds the first token after a colon punctuator and returns it. + * @param {ASTNode} node The node to start looking from. + * @returns {ASTNode} The first token after a colon punctuator. + */ + function getFirstTokenAfterColon(node) { + const colonToken = getNextColon(node); + return sourceCode.getTokenAfter(colonToken); + } + /** * 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) { + candidateValueStartLine = (isKeyValueProperty(candidate) ? getFirstTokenAfterColon(candidate.key) : candidate).loc.start.line; + if (candidateValueStartLine - 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) { + if (leadingComments.length && leadingComments[0].loc.start.line - groupEndLine <= 1 && candidateValueStartLine - 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. @@ -80590,23 +71305,20 @@ module.exports = { * @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; - if ((diff && mode === "strict" || diff < 0 && mode === "minimum" || diff > 0 && !expected && mode === "minimum") && !(expected && containsLineTerminator(whitespace))) { const 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(" "); + 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; @@ -80615,16 +71327,15 @@ module.exports = { end: locEnd } : missingLoc; let fix; - if (isExtra) { - let range; // Remove whitespace + 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); }; @@ -80640,15 +71351,12 @@ module.exports = { }; } } - let messageId = ""; - if (isExtra) { messageId = side === "key" ? "extraKey" : "extraValue"; } else { messageId = side === "key" ? "missingKey" : "missingValue"; } - context.report({ node: property[side], loc, @@ -80661,81 +71369,70 @@ module.exports = { }); } } + /** * 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 splitter.countGraphemes(sourceCode.getText().slice(startToken.range[0], endToken.range[1])); + return getGraphemeCount(sourceCode.getText().slice(startToken.range[0], endToken.range[1])); } + /** * 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); - + 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" - + widths = properties.map(getKeyWidth), + // Width of keys, including quotes + align = alignmentOptions.on; // "value" or "colon" let targetWidth = Math.max(...widths), - beforeColon, - afterColon, - mode; - + beforeColon, + afterColon, + mode; if (alignmentOptions && length > 1) { // When aligning values within a group, use the alignment configuration. beforeColon = alignmentOptions.beforeColon; @@ -80745,19 +71442,16 @@ module.exports = { beforeColon = multiLineOptions.beforeColon; afterColon = multiLineOptions.afterColon; mode = alignmentOptions.mode; - } // Conditionally include one space before or after colon - + } + // 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); @@ -80769,62 +71463,58 @@ module.exports = { } } } + /** * 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)) { @@ -80833,1768 +71523,20 @@ module.exports = { verifyAlignment(node); } } - }; - } // Obey beforeColon and afterColon in each property as configured - + } + // Obey beforeColon and afterColon in each property as configured return { Property(node) { verifySpacing(node, isSingleLine(node.parent) ? singleLineOptions : multiLineOptions); } - }; } - }; /***/ }), -/* 698 */ -/***/ ((module) => { - -/* -Breaks a Javascript string into individual user-perceived "characters" -called extended grapheme clusters by implementing the Unicode UAX-29 standard, version 10.0.0 - -Usage: -var splitter = new GraphemeSplitter(); -//returns an array of strings, one string for each grapheme cluster -var graphemes = splitter.splitGraphemes(string); - -*/ -function GraphemeSplitter() { - var CR = 0, - LF = 1, - Control = 2, - Extend = 3, - Regional_Indicator = 4, - SpacingMark = 5, - L = 6, - V = 7, - T = 8, - LV = 9, - LVT = 10, - Other = 11, - Prepend = 12, - E_Base = 13, - E_Modifier = 14, - ZWJ = 15, - Glue_After_Zwj = 16, - E_Base_GAZ = 17; // BreakTypes - - var NotBreak = 0, - BreakStart = 1, - Break = 2, - BreakLastRegional = 3, - BreakPenultimateRegional = 4; - - function isSurrogate(str, pos) { - return 0xd800 <= str.charCodeAt(pos) && str.charCodeAt(pos) <= 0xdbff && 0xdc00 <= str.charCodeAt(pos + 1) && str.charCodeAt(pos + 1) <= 0xdfff; - } // Private function, gets a Unicode code point from a JavaScript UTF-16 string - // handling surrogate pairs appropriately - - - function codePointAt(str, idx) { - if (idx === undefined) { - idx = 0; - } - - var code = str.charCodeAt(idx); // if a high surrogate - - if (0xD800 <= code && code <= 0xDBFF && idx < str.length - 1) { - var hi = code; - var low = str.charCodeAt(idx + 1); - - if (0xDC00 <= low && low <= 0xDFFF) { - return (hi - 0xD800) * 0x400 + (low - 0xDC00) + 0x10000; - } - - return hi; - } // if a low surrogate - - - if (0xDC00 <= code && code <= 0xDFFF && idx >= 1) { - var hi = str.charCodeAt(idx - 1); - var low = code; - - if (0xD800 <= hi && hi <= 0xDBFF) { - return (hi - 0xD800) * 0x400 + (low - 0xDC00) + 0x10000; - } - - return low; - } //just return the char if an unmatched surrogate half or a - //single-char codepoint - - - return code; - } // Private function, returns whether a break is allowed between the - // two given grapheme breaking classes - - - function shouldBreak(start, mid, end) { - var all = [start].concat(mid).concat([end]); - var previous = all[all.length - 2]; - var next = end; // Lookahead termintor for: - // GB10. (E_Base | EBG) Extend* ? E_Modifier - - var eModifierIndex = all.lastIndexOf(E_Modifier); - - if (eModifierIndex > 1 && all.slice(1, eModifierIndex).every(function (c) { - return c == Extend; - }) && [Extend, E_Base, E_Base_GAZ].indexOf(start) == -1) { - return Break; - } // Lookahead termintor for: - // GB12. ^ (RI RI)* RI ? RI - // GB13. [^RI] (RI RI)* RI ? RI - - - var rIIndex = all.lastIndexOf(Regional_Indicator); - - if (rIIndex > 0 && all.slice(1, rIIndex).every(function (c) { - return c == Regional_Indicator; - }) && [Prepend, Regional_Indicator].indexOf(previous) == -1) { - if (all.filter(function (c) { - return c == Regional_Indicator; - }).length % 2 == 1) { - return BreakLastRegional; - } else { - return BreakPenultimateRegional; - } - } // GB3. CR X LF - - - if (previous == CR && next == LF) { - return NotBreak; - } // GB4. (Control|CR|LF) ÷ - else if (previous == Control || previous == CR || previous == LF) { - if (next == E_Modifier && mid.every(function (c) { - return c == Extend; - })) { - return Break; - } else { - return BreakStart; - } - } // GB5. ÷ (Control|CR|LF) - else if (next == Control || next == CR || next == LF) { - return BreakStart; - } // GB6. L X (L|V|LV|LVT) - else if (previous == L && (next == L || next == V || next == LV || next == LVT)) { - return NotBreak; - } // GB7. (LV|V) X (V|T) - else if ((previous == LV || previous == V) && (next == V || next == T)) { - return NotBreak; - } // GB8. (LVT|T) X (T) - else if ((previous == LVT || previous == T) && next == T) { - return NotBreak; - } // GB9. X (Extend|ZWJ) - else if (next == Extend || next == ZWJ) { - return NotBreak; - } // GB9a. X SpacingMark - else if (next == SpacingMark) { - return NotBreak; - } // GB9b. Prepend X - else if (previous == Prepend) { - return NotBreak; - } // GB10. (E_Base | EBG) Extend* ? E_Modifier - - - var previousNonExtendIndex = all.indexOf(Extend) != -1 ? all.lastIndexOf(Extend) - 1 : all.length - 2; - - if ([E_Base, E_Base_GAZ].indexOf(all[previousNonExtendIndex]) != -1 && all.slice(previousNonExtendIndex + 1, -1).every(function (c) { - return c == Extend; - }) && next == E_Modifier) { - return NotBreak; - } // GB11. ZWJ ? (Glue_After_Zwj | EBG) - - - if (previous == ZWJ && [Glue_After_Zwj, E_Base_GAZ].indexOf(next) != -1) { - return NotBreak; - } // GB12. ^ (RI RI)* RI ? RI - // GB13. [^RI] (RI RI)* RI ? RI - - - if (mid.indexOf(Regional_Indicator) != -1) { - return Break; - } - - if (previous == Regional_Indicator && next == Regional_Indicator) { - return NotBreak; - } // GB999. Any ? Any - - - return BreakStart; - } // Returns the next grapheme break in the string after the given index - - - this.nextBreak = function (string, index) { - if (index === undefined) { - index = 0; - } - - if (index < 0) { - return 0; - } - - if (index >= string.length - 1) { - return string.length; - } - - var prev = getGraphemeBreakProperty(codePointAt(string, index)); - var mid = []; - - for (var i = index + 1; i < string.length; i++) { - // check for already processed low surrogates - if (isSurrogate(string, i - 1)) { - continue; - } - - var next = getGraphemeBreakProperty(codePointAt(string, i)); - - if (shouldBreak(prev, mid, next)) { - return i; - } - - mid.push(next); - } - - return string.length; - }; // Breaks the given string into an array of grapheme cluster strings - - - this.splitGraphemes = function (str) { - var res = []; - var index = 0; - var brk; - - while ((brk = this.nextBreak(str, index)) < str.length) { - res.push(str.slice(index, brk)); - index = brk; - } - - if (index < str.length) { - res.push(str.slice(index)); - } - - return res; - }; // Returns the iterator of grapheme clusters there are in the given string - - - this.iterateGraphemes = function (str) { - var index = 0; - var res = { - next: function () { - var value; - var brk; - - if ((brk = this.nextBreak(str, index)) < str.length) { - value = str.slice(index, brk); - index = brk; - return { - value: value, - done: false - }; - } - - if (index < str.length) { - value = str.slice(index); - index = str.length; - return { - value: value, - done: false - }; - } - - return { - value: undefined, - done: true - }; - }.bind(this) - }; // ES2015 @@iterator method (iterable) for spread syntax and for...of statement - - if (typeof Symbol !== 'undefined' && Symbol.iterator) { - res[Symbol.iterator] = function () { - return res; - }; - } - - return res; - }; // Returns the number of grapheme clusters there are in the given string - - - this.countGraphemes = function (str) { - var count = 0; - var index = 0; - var brk; - - while ((brk = this.nextBreak(str, index)) < str.length) { - index = brk; - count++; - } - - if (index < str.length) { - count++; - } - - return count; - }; //given a Unicode code point, determines this symbol's grapheme break property - - - function getGraphemeBreakProperty(code) { - //grapheme break property for Unicode 10.0.0, - //taken from http://www.unicode.org/Public/10.0.0/ucd/auxiliary/GraphemeBreakProperty.txt - //and adapted to JavaScript rules - if (0x0600 <= code && code <= 0x0605 || // Cf [6] ARABIC NUMBER SIGN..ARABIC NUMBER MARK ABOVE - 0x06DD == code || // Cf ARABIC END OF AYAH - 0x070F == code || // Cf SYRIAC ABBREVIATION MARK - 0x08E2 == code || // Cf ARABIC DISPUTED END OF AYAH - 0x0D4E == code || // Lo MALAYALAM LETTER DOT REPH - 0x110BD == code || // Cf KAITHI NUMBER SIGN - 0x111C2 <= code && code <= 0x111C3 || // Lo [2] SHARADA SIGN JIHVAMULIYA..SHARADA SIGN UPADHMANIYA - 0x11A3A == code || // Lo ZANABAZAR SQUARE CLUSTER-INITIAL LETTER RA - 0x11A86 <= code && code <= 0x11A89 || // Lo [4] SOYOMBO CLUSTER-INITIAL LETTER RA..SOYOMBO CLUSTER-INITIAL LETTER SA - 0x11D46 == code // Lo MASARAM GONDI REPHA - ) { - return Prepend; - } - - if (0x000D == code // Cc - ) { - return CR; - } - - if (0x000A == code // Cc - ) { - return LF; - } - - if (0x0000 <= code && code <= 0x0009 || // Cc [10] .. - 0x000B <= code && code <= 0x000C || // Cc [2] .. - 0x000E <= code && code <= 0x001F || // Cc [18] .. - 0x007F <= code && code <= 0x009F || // Cc [33] .. - 0x00AD == code || // Cf SOFT HYPHEN - 0x061C == code || // Cf ARABIC LETTER MARK - 0x180E == code || // Cf MONGOLIAN VOWEL SEPARATOR - 0x200B == code || // Cf ZERO WIDTH SPACE - 0x200E <= code && code <= 0x200F || // Cf [2] LEFT-TO-RIGHT MARK..RIGHT-TO-LEFT MARK - 0x2028 == code || // Zl LINE SEPARATOR - 0x2029 == code || // Zp PARAGRAPH SEPARATOR - 0x202A <= code && code <= 0x202E || // Cf [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE - 0x2060 <= code && code <= 0x2064 || // Cf [5] WORD JOINER..INVISIBLE PLUS - 0x2065 == code || // Cn - 0x2066 <= code && code <= 0x206F || // Cf [10] LEFT-TO-RIGHT ISOLATE..NOMINAL DIGIT SHAPES - 0xD800 <= code && code <= 0xDFFF || // Cs [2048] .. - 0xFEFF == code || // Cf ZERO WIDTH NO-BREAK SPACE - 0xFFF0 <= code && code <= 0xFFF8 || // Cn [9] .. - 0xFFF9 <= code && code <= 0xFFFB || // Cf [3] INTERLINEAR ANNOTATION ANCHOR..INTERLINEAR ANNOTATION TERMINATOR - 0x1BCA0 <= code && code <= 0x1BCA3 || // Cf [4] SHORTHAND FORMAT LETTER OVERLAP..SHORTHAND FORMAT UP STEP - 0x1D173 <= code && code <= 0x1D17A || // Cf [8] MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE - 0xE0000 == code || // Cn - 0xE0001 == code || // Cf LANGUAGE TAG - 0xE0002 <= code && code <= 0xE001F || // Cn [30] .. - 0xE0080 <= code && code <= 0xE00FF || // Cn [128] .. - 0xE01F0 <= code && code <= 0xE0FFF // Cn [3600] .. - ) { - return Control; - } - - if (0x0300 <= code && code <= 0x036F || // Mn [112] COMBINING GRAVE ACCENT..COMBINING LATIN SMALL LETTER X - 0x0483 <= code && code <= 0x0487 || // Mn [5] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC POKRYTIE - 0x0488 <= code && code <= 0x0489 || // Me [2] COMBINING CYRILLIC HUNDRED THOUSANDS SIGN..COMBINING CYRILLIC MILLIONS SIGN - 0x0591 <= code && code <= 0x05BD || // Mn [45] HEBREW ACCENT ETNAHTA..HEBREW POINT METEG - 0x05BF == code || // Mn HEBREW POINT RAFE - 0x05C1 <= code && code <= 0x05C2 || // Mn [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT - 0x05C4 <= code && code <= 0x05C5 || // Mn [2] HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT - 0x05C7 == code || // Mn HEBREW POINT QAMATS QATAN - 0x0610 <= code && code <= 0x061A || // Mn [11] ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL KASRA - 0x064B <= code && code <= 0x065F || // Mn [21] ARABIC FATHATAN..ARABIC WAVY HAMZA BELOW - 0x0670 == code || // Mn ARABIC LETTER SUPERSCRIPT ALEF - 0x06D6 <= code && code <= 0x06DC || // Mn [7] ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA..ARABIC SMALL HIGH SEEN - 0x06DF <= code && code <= 0x06E4 || // Mn [6] ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH MADDA - 0x06E7 <= code && code <= 0x06E8 || // Mn [2] ARABIC SMALL HIGH YEH..ARABIC SMALL HIGH NOON - 0x06EA <= code && code <= 0x06ED || // Mn [4] ARABIC EMPTY CENTRE LOW STOP..ARABIC SMALL LOW MEEM - 0x0711 == code || // Mn SYRIAC LETTER SUPERSCRIPT ALAPH - 0x0730 <= code && code <= 0x074A || // Mn [27] SYRIAC PTHAHA ABOVE..SYRIAC BARREKH - 0x07A6 <= code && code <= 0x07B0 || // Mn [11] THAANA ABAFILI..THAANA SUKUN - 0x07EB <= code && code <= 0x07F3 || // Mn [9] NKO COMBINING SHORT HIGH TONE..NKO COMBINING DOUBLE DOT ABOVE - 0x0816 <= code && code <= 0x0819 || // Mn [4] SAMARITAN MARK IN..SAMARITAN MARK DAGESH - 0x081B <= code && code <= 0x0823 || // Mn [9] SAMARITAN MARK EPENTHETIC YUT..SAMARITAN VOWEL SIGN A - 0x0825 <= code && code <= 0x0827 || // Mn [3] SAMARITAN VOWEL SIGN SHORT A..SAMARITAN VOWEL SIGN U - 0x0829 <= code && code <= 0x082D || // Mn [5] SAMARITAN VOWEL SIGN LONG I..SAMARITAN MARK NEQUDAA - 0x0859 <= code && code <= 0x085B || // Mn [3] MANDAIC AFFRICATION MARK..MANDAIC GEMINATION MARK - 0x08D4 <= code && code <= 0x08E1 || // Mn [14] ARABIC SMALL HIGH WORD AR-RUB..ARABIC SMALL HIGH SIGN SAFHA - 0x08E3 <= code && code <= 0x0902 || // Mn [32] ARABIC TURNED DAMMA BELOW..DEVANAGARI SIGN ANUSVARA - 0x093A == code || // Mn DEVANAGARI VOWEL SIGN OE - 0x093C == code || // Mn DEVANAGARI SIGN NUKTA - 0x0941 <= code && code <= 0x0948 || // Mn [8] DEVANAGARI VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI - 0x094D == code || // Mn DEVANAGARI SIGN VIRAMA - 0x0951 <= code && code <= 0x0957 || // Mn [7] DEVANAGARI STRESS SIGN UDATTA..DEVANAGARI VOWEL SIGN UUE - 0x0962 <= code && code <= 0x0963 || // Mn [2] DEVANAGARI VOWEL SIGN VOCALIC L..DEVANAGARI VOWEL SIGN VOCALIC LL - 0x0981 == code || // Mn BENGALI SIGN CANDRABINDU - 0x09BC == code || // Mn BENGALI SIGN NUKTA - 0x09BE == code || // Mc BENGALI VOWEL SIGN AA - 0x09C1 <= code && code <= 0x09C4 || // Mn [4] BENGALI VOWEL SIGN U..BENGALI VOWEL SIGN VOCALIC RR - 0x09CD == code || // Mn BENGALI SIGN VIRAMA - 0x09D7 == code || // Mc BENGALI AU LENGTH MARK - 0x09E2 <= code && code <= 0x09E3 || // Mn [2] BENGALI VOWEL SIGN VOCALIC L..BENGALI VOWEL SIGN VOCALIC LL - 0x0A01 <= code && code <= 0x0A02 || // Mn [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN BINDI - 0x0A3C == code || // Mn GURMUKHI SIGN NUKTA - 0x0A41 <= code && code <= 0x0A42 || // Mn [2] GURMUKHI VOWEL SIGN U..GURMUKHI VOWEL SIGN UU - 0x0A47 <= code && code <= 0x0A48 || // Mn [2] GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN AI - 0x0A4B <= code && code <= 0x0A4D || // Mn [3] GURMUKHI VOWEL SIGN OO..GURMUKHI SIGN VIRAMA - 0x0A51 == code || // Mn GURMUKHI SIGN UDAAT - 0x0A70 <= code && code <= 0x0A71 || // Mn [2] GURMUKHI TIPPI..GURMUKHI ADDAK - 0x0A75 == code || // Mn GURMUKHI SIGN YAKASH - 0x0A81 <= code && code <= 0x0A82 || // Mn [2] GUJARATI SIGN CANDRABINDU..GUJARATI SIGN ANUSVARA - 0x0ABC == code || // Mn GUJARATI SIGN NUKTA - 0x0AC1 <= code && code <= 0x0AC5 || // Mn [5] GUJARATI VOWEL SIGN U..GUJARATI VOWEL SIGN CANDRA E - 0x0AC7 <= code && code <= 0x0AC8 || // Mn [2] GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN AI - 0x0ACD == code || // Mn GUJARATI SIGN VIRAMA - 0x0AE2 <= code && code <= 0x0AE3 || // Mn [2] GUJARATI VOWEL SIGN VOCALIC L..GUJARATI VOWEL SIGN VOCALIC LL - 0x0AFA <= code && code <= 0x0AFF || // Mn [6] GUJARATI SIGN SUKUN..GUJARATI SIGN TWO-CIRCLE NUKTA ABOVE - 0x0B01 == code || // Mn ORIYA SIGN CANDRABINDU - 0x0B3C == code || // Mn ORIYA SIGN NUKTA - 0x0B3E == code || // Mc ORIYA VOWEL SIGN AA - 0x0B3F == code || // Mn ORIYA VOWEL SIGN I - 0x0B41 <= code && code <= 0x0B44 || // Mn [4] ORIYA VOWEL SIGN U..ORIYA VOWEL SIGN VOCALIC RR - 0x0B4D == code || // Mn ORIYA SIGN VIRAMA - 0x0B56 == code || // Mn ORIYA AI LENGTH MARK - 0x0B57 == code || // Mc ORIYA AU LENGTH MARK - 0x0B62 <= code && code <= 0x0B63 || // Mn [2] ORIYA VOWEL SIGN VOCALIC L..ORIYA VOWEL SIGN VOCALIC LL - 0x0B82 == code || // Mn TAMIL SIGN ANUSVARA - 0x0BBE == code || // Mc TAMIL VOWEL SIGN AA - 0x0BC0 == code || // Mn TAMIL VOWEL SIGN II - 0x0BCD == code || // Mn TAMIL SIGN VIRAMA - 0x0BD7 == code || // Mc TAMIL AU LENGTH MARK - 0x0C00 == code || // Mn TELUGU SIGN COMBINING CANDRABINDU ABOVE - 0x0C3E <= code && code <= 0x0C40 || // Mn [3] TELUGU VOWEL SIGN AA..TELUGU VOWEL SIGN II - 0x0C46 <= code && code <= 0x0C48 || // Mn [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI - 0x0C4A <= code && code <= 0x0C4D || // Mn [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA - 0x0C55 <= code && code <= 0x0C56 || // Mn [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK - 0x0C62 <= code && code <= 0x0C63 || // Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL - 0x0C81 == code || // Mn KANNADA SIGN CANDRABINDU - 0x0CBC == code || // Mn KANNADA SIGN NUKTA - 0x0CBF == code || // Mn KANNADA VOWEL SIGN I - 0x0CC2 == code || // Mc KANNADA VOWEL SIGN UU - 0x0CC6 == code || // Mn KANNADA VOWEL SIGN E - 0x0CCC <= code && code <= 0x0CCD || // Mn [2] KANNADA VOWEL SIGN AU..KANNADA SIGN VIRAMA - 0x0CD5 <= code && code <= 0x0CD6 || // Mc [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK - 0x0CE2 <= code && code <= 0x0CE3 || // Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL - 0x0D00 <= code && code <= 0x0D01 || // Mn [2] MALAYALAM SIGN COMBINING ANUSVARA ABOVE..MALAYALAM SIGN CANDRABINDU - 0x0D3B <= code && code <= 0x0D3C || // Mn [2] MALAYALAM SIGN VERTICAL BAR VIRAMA..MALAYALAM SIGN CIRCULAR VIRAMA - 0x0D3E == code || // Mc MALAYALAM VOWEL SIGN AA - 0x0D41 <= code && code <= 0x0D44 || // Mn [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR - 0x0D4D == code || // Mn MALAYALAM SIGN VIRAMA - 0x0D57 == code || // Mc MALAYALAM AU LENGTH MARK - 0x0D62 <= code && code <= 0x0D63 || // Mn [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL - 0x0DCA == code || // Mn SINHALA SIGN AL-LAKUNA - 0x0DCF == code || // Mc SINHALA VOWEL SIGN AELA-PILLA - 0x0DD2 <= code && code <= 0x0DD4 || // Mn [3] SINHALA VOWEL SIGN KETTI IS-PILLA..SINHALA VOWEL SIGN KETTI PAA-PILLA - 0x0DD6 == code || // Mn SINHALA VOWEL SIGN DIGA PAA-PILLA - 0x0DDF == code || // Mc SINHALA VOWEL SIGN GAYANUKITTA - 0x0E31 == code || // Mn THAI CHARACTER MAI HAN-AKAT - 0x0E34 <= code && code <= 0x0E3A || // Mn [7] THAI CHARACTER SARA I..THAI CHARACTER PHINTHU - 0x0E47 <= code && code <= 0x0E4E || // Mn [8] THAI CHARACTER MAITAIKHU..THAI CHARACTER YAMAKKAN - 0x0EB1 == code || // Mn LAO VOWEL SIGN MAI KAN - 0x0EB4 <= code && code <= 0x0EB9 || // Mn [6] LAO VOWEL SIGN I..LAO VOWEL SIGN UU - 0x0EBB <= code && code <= 0x0EBC || // Mn [2] LAO VOWEL SIGN MAI KON..LAO SEMIVOWEL SIGN LO - 0x0EC8 <= code && code <= 0x0ECD || // Mn [6] LAO TONE MAI EK..LAO NIGGAHITA - 0x0F18 <= code && code <= 0x0F19 || // Mn [2] TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS - 0x0F35 == code || // Mn TIBETAN MARK NGAS BZUNG NYI ZLA - 0x0F37 == code || // Mn TIBETAN MARK NGAS BZUNG SGOR RTAGS - 0x0F39 == code || // Mn TIBETAN MARK TSA -PHRU - 0x0F71 <= code && code <= 0x0F7E || // Mn [14] TIBETAN VOWEL SIGN AA..TIBETAN SIGN RJES SU NGA RO - 0x0F80 <= code && code <= 0x0F84 || // Mn [5] TIBETAN VOWEL SIGN REVERSED I..TIBETAN MARK HALANTA - 0x0F86 <= code && code <= 0x0F87 || // Mn [2] TIBETAN SIGN LCI RTAGS..TIBETAN SIGN YANG RTAGS - 0x0F8D <= code && code <= 0x0F97 || // Mn [11] TIBETAN SUBJOINED SIGN LCE TSA CAN..TIBETAN SUBJOINED LETTER JA - 0x0F99 <= code && code <= 0x0FBC || // Mn [36] TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOINED LETTER FIXED-FORM RA - 0x0FC6 == code || // Mn TIBETAN SYMBOL PADMA GDAN - 0x102D <= code && code <= 0x1030 || // Mn [4] MYANMAR VOWEL SIGN I..MYANMAR VOWEL SIGN UU - 0x1032 <= code && code <= 0x1037 || // Mn [6] MYANMAR VOWEL SIGN AI..MYANMAR SIGN DOT BELOW - 0x1039 <= code && code <= 0x103A || // Mn [2] MYANMAR SIGN VIRAMA..MYANMAR SIGN ASAT - 0x103D <= code && code <= 0x103E || // Mn [2] MYANMAR CONSONANT SIGN MEDIAL WA..MYANMAR CONSONANT SIGN MEDIAL HA - 0x1058 <= code && code <= 0x1059 || // Mn [2] MYANMAR VOWEL SIGN VOCALIC L..MYANMAR VOWEL SIGN VOCALIC LL - 0x105E <= code && code <= 0x1060 || // Mn [3] MYANMAR CONSONANT SIGN MON MEDIAL NA..MYANMAR CONSONANT SIGN MON MEDIAL LA - 0x1071 <= code && code <= 0x1074 || // Mn [4] MYANMAR VOWEL SIGN GEBA KAREN I..MYANMAR VOWEL SIGN KAYAH EE - 0x1082 == code || // Mn MYANMAR CONSONANT SIGN SHAN MEDIAL WA - 0x1085 <= code && code <= 0x1086 || // Mn [2] MYANMAR VOWEL SIGN SHAN E ABOVE..MYANMAR VOWEL SIGN SHAN FINAL Y - 0x108D == code || // Mn MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE - 0x109D == code || // Mn MYANMAR VOWEL SIGN AITON AI - 0x135D <= code && code <= 0x135F || // Mn [3] ETHIOPIC COMBINING GEMINATION AND VOWEL LENGTH MARK..ETHIOPIC COMBINING GEMINATION MARK - 0x1712 <= code && code <= 0x1714 || // Mn [3] TAGALOG VOWEL SIGN I..TAGALOG SIGN VIRAMA - 0x1732 <= code && code <= 0x1734 || // Mn [3] HANUNOO VOWEL SIGN I..HANUNOO SIGN PAMUDPOD - 0x1752 <= code && code <= 0x1753 || // Mn [2] BUHID VOWEL SIGN I..BUHID VOWEL SIGN U - 0x1772 <= code && code <= 0x1773 || // Mn [2] TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U - 0x17B4 <= code && code <= 0x17B5 || // Mn [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA - 0x17B7 <= code && code <= 0x17BD || // Mn [7] KHMER VOWEL SIGN I..KHMER VOWEL SIGN UA - 0x17C6 == code || // Mn KHMER SIGN NIKAHIT - 0x17C9 <= code && code <= 0x17D3 || // Mn [11] KHMER SIGN MUUSIKATOAN..KHMER SIGN BATHAMASAT - 0x17DD == code || // Mn KHMER SIGN ATTHACAN - 0x180B <= code && code <= 0x180D || // Mn [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE - 0x1885 <= code && code <= 0x1886 || // Mn [2] MONGOLIAN LETTER ALI GALI BALUDA..MONGOLIAN LETTER ALI GALI THREE BALUDA - 0x18A9 == code || // Mn MONGOLIAN LETTER ALI GALI DAGALGA - 0x1920 <= code && code <= 0x1922 || // Mn [3] LIMBU VOWEL SIGN A..LIMBU VOWEL SIGN U - 0x1927 <= code && code <= 0x1928 || // Mn [2] LIMBU VOWEL SIGN E..LIMBU VOWEL SIGN O - 0x1932 == code || // Mn LIMBU SMALL LETTER ANUSVARA - 0x1939 <= code && code <= 0x193B || // Mn [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I - 0x1A17 <= code && code <= 0x1A18 || // Mn [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U - 0x1A1B == code || // Mn BUGINESE VOWEL SIGN AE - 0x1A56 == code || // Mn TAI THAM CONSONANT SIGN MEDIAL LA - 0x1A58 <= code && code <= 0x1A5E || // Mn [7] TAI THAM SIGN MAI KANG LAI..TAI THAM CONSONANT SIGN SA - 0x1A60 == code || // Mn TAI THAM SIGN SAKOT - 0x1A62 == code || // Mn TAI THAM VOWEL SIGN MAI SAT - 0x1A65 <= code && code <= 0x1A6C || // Mn [8] TAI THAM VOWEL SIGN I..TAI THAM VOWEL SIGN OA BELOW - 0x1A73 <= code && code <= 0x1A7C || // Mn [10] TAI THAM VOWEL SIGN OA ABOVE..TAI THAM SIGN KHUEN-LUE KARAN - 0x1A7F == code || // Mn TAI THAM COMBINING CRYPTOGRAMMIC DOT - 0x1AB0 <= code && code <= 0x1ABD || // Mn [14] COMBINING DOUBLED CIRCUMFLEX ACCENT..COMBINING PARENTHESES BELOW - 0x1ABE == code || // Me COMBINING PARENTHESES OVERLAY - 0x1B00 <= code && code <= 0x1B03 || // Mn [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG - 0x1B34 == code || // Mn BALINESE SIGN REREKAN - 0x1B36 <= code && code <= 0x1B3A || // Mn [5] BALINESE VOWEL SIGN ULU..BALINESE VOWEL SIGN RA REPA - 0x1B3C == code || // Mn BALINESE VOWEL SIGN LA LENGA - 0x1B42 == code || // Mn BALINESE VOWEL SIGN PEPET - 0x1B6B <= code && code <= 0x1B73 || // Mn [9] BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING GONG - 0x1B80 <= code && code <= 0x1B81 || // Mn [2] SUNDANESE SIGN PANYECEK..SUNDANESE SIGN PANGLAYAR - 0x1BA2 <= code && code <= 0x1BA5 || // Mn [4] SUNDANESE CONSONANT SIGN PANYAKRA..SUNDANESE VOWEL SIGN PANYUKU - 0x1BA8 <= code && code <= 0x1BA9 || // Mn [2] SUNDANESE VOWEL SIGN PAMEPET..SUNDANESE VOWEL SIGN PANEULEUNG - 0x1BAB <= code && code <= 0x1BAD || // Mn [3] SUNDANESE SIGN VIRAMA..SUNDANESE CONSONANT SIGN PASANGAN WA - 0x1BE6 == code || // Mn BATAK SIGN TOMPI - 0x1BE8 <= code && code <= 0x1BE9 || // Mn [2] BATAK VOWEL SIGN PAKPAK E..BATAK VOWEL SIGN EE - 0x1BED == code || // Mn BATAK VOWEL SIGN KARO O - 0x1BEF <= code && code <= 0x1BF1 || // Mn [3] BATAK VOWEL SIGN U FOR SIMALUNGUN SA..BATAK CONSONANT SIGN H - 0x1C2C <= code && code <= 0x1C33 || // Mn [8] LEPCHA VOWEL SIGN E..LEPCHA CONSONANT SIGN T - 0x1C36 <= code && code <= 0x1C37 || // Mn [2] LEPCHA SIGN RAN..LEPCHA SIGN NUKTA - 0x1CD0 <= code && code <= 0x1CD2 || // Mn [3] VEDIC TONE KARSHANA..VEDIC TONE PRENKHA - 0x1CD4 <= code && code <= 0x1CE0 || // Mn [13] VEDIC SIGN YAJURVEDIC MIDLINE SVARITA..VEDIC TONE RIGVEDIC KASHMIRI INDEPENDENT SVARITA - 0x1CE2 <= code && code <= 0x1CE8 || // Mn [7] VEDIC SIGN VISARGA SVARITA..VEDIC SIGN VISARGA ANUDATTA WITH TAIL - 0x1CED == code || // Mn VEDIC SIGN TIRYAK - 0x1CF4 == code || // Mn VEDIC TONE CANDRA ABOVE - 0x1CF8 <= code && code <= 0x1CF9 || // Mn [2] VEDIC TONE RING ABOVE..VEDIC TONE DOUBLE RING ABOVE - 0x1DC0 <= code && code <= 0x1DF9 || // Mn [58] COMBINING DOTTED GRAVE ACCENT..COMBINING WIDE INVERTED BRIDGE BELOW - 0x1DFB <= code && code <= 0x1DFF || // Mn [5] COMBINING DELETION MARK..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW - 0x200C == code || // Cf ZERO WIDTH NON-JOINER - 0x20D0 <= code && code <= 0x20DC || // Mn [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE - 0x20DD <= code && code <= 0x20E0 || // Me [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE BACKSLASH - 0x20E1 == code || // Mn COMBINING LEFT RIGHT ARROW ABOVE - 0x20E2 <= code && code <= 0x20E4 || // Me [3] COMBINING ENCLOSING SCREEN..COMBINING ENCLOSING UPWARD POINTING TRIANGLE - 0x20E5 <= code && code <= 0x20F0 || // Mn [12] COMBINING REVERSE SOLIDUS OVERLAY..COMBINING ASTERISK ABOVE - 0x2CEF <= code && code <= 0x2CF1 || // Mn [3] COPTIC COMBINING NI ABOVE..COPTIC COMBINING SPIRITUS LENIS - 0x2D7F == code || // Mn TIFINAGH CONSONANT JOINER - 0x2DE0 <= code && code <= 0x2DFF || // Mn [32] COMBINING CYRILLIC LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS - 0x302A <= code && code <= 0x302D || // Mn [4] IDEOGRAPHIC LEVEL TONE MARK..IDEOGRAPHIC ENTERING TONE MARK - 0x302E <= code && code <= 0x302F || // Mc [2] HANGUL SINGLE DOT TONE MARK..HANGUL DOUBLE DOT TONE MARK - 0x3099 <= code && code <= 0x309A || // Mn [2] COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK - 0xA66F == code || // Mn COMBINING CYRILLIC VZMET - 0xA670 <= code && code <= 0xA672 || // Me [3] COMBINING CYRILLIC TEN MILLIONS SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN - 0xA674 <= code && code <= 0xA67D || // Mn [10] COMBINING CYRILLIC LETTER UKRAINIAN IE..COMBINING CYRILLIC PAYEROK - 0xA69E <= code && code <= 0xA69F || // Mn [2] COMBINING CYRILLIC LETTER EF..COMBINING CYRILLIC LETTER IOTIFIED E - 0xA6F0 <= code && code <= 0xA6F1 || // Mn [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS - 0xA802 == code || // Mn SYLOTI NAGRI SIGN DVISVARA - 0xA806 == code || // Mn SYLOTI NAGRI SIGN HASANTA - 0xA80B == code || // Mn SYLOTI NAGRI SIGN ANUSVARA - 0xA825 <= code && code <= 0xA826 || // Mn [2] SYLOTI NAGRI VOWEL SIGN U..SYLOTI NAGRI VOWEL SIGN E - 0xA8C4 <= code && code <= 0xA8C5 || // Mn [2] SAURASHTRA SIGN VIRAMA..SAURASHTRA SIGN CANDRABINDU - 0xA8E0 <= code && code <= 0xA8F1 || // Mn [18] COMBINING DEVANAGARI DIGIT ZERO..COMBINING DEVANAGARI SIGN AVAGRAHA - 0xA926 <= code && code <= 0xA92D || // Mn [8] KAYAH LI VOWEL UE..KAYAH LI TONE CALYA PLOPHU - 0xA947 <= code && code <= 0xA951 || // Mn [11] REJANG VOWEL SIGN I..REJANG CONSONANT SIGN R - 0xA980 <= code && code <= 0xA982 || // Mn [3] JAVANESE SIGN PANYANGGA..JAVANESE SIGN LAYAR - 0xA9B3 == code || // Mn JAVANESE SIGN CECAK TELU - 0xA9B6 <= code && code <= 0xA9B9 || // Mn [4] JAVANESE VOWEL SIGN WULU..JAVANESE VOWEL SIGN SUKU MENDUT - 0xA9BC == code || // Mn JAVANESE VOWEL SIGN PEPET - 0xA9E5 == code || // Mn MYANMAR SIGN SHAN SAW - 0xAA29 <= code && code <= 0xAA2E || // Mn [6] CHAM VOWEL SIGN AA..CHAM VOWEL SIGN OE - 0xAA31 <= code && code <= 0xAA32 || // Mn [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIGN UE - 0xAA35 <= code && code <= 0xAA36 || // Mn [2] CHAM CONSONANT SIGN LA..CHAM CONSONANT SIGN WA - 0xAA43 == code || // Mn CHAM CONSONANT SIGN FINAL NG - 0xAA4C == code || // Mn CHAM CONSONANT SIGN FINAL M - 0xAA7C == code || // Mn MYANMAR SIGN TAI LAING TONE-2 - 0xAAB0 == code || // Mn TAI VIET MAI KANG - 0xAAB2 <= code && code <= 0xAAB4 || // Mn [3] TAI VIET VOWEL I..TAI VIET VOWEL U - 0xAAB7 <= code && code <= 0xAAB8 || // Mn [2] TAI VIET MAI KHIT..TAI VIET VOWEL IA - 0xAABE <= code && code <= 0xAABF || // Mn [2] TAI VIET VOWEL AM..TAI VIET TONE MAI EK - 0xAAC1 == code || // Mn TAI VIET TONE MAI THO - 0xAAEC <= code && code <= 0xAAED || // Mn [2] MEETEI MAYEK VOWEL SIGN UU..MEETEI MAYEK VOWEL SIGN AAI - 0xAAF6 == code || // Mn MEETEI MAYEK VIRAMA - 0xABE5 == code || // Mn MEETEI MAYEK VOWEL SIGN ANAP - 0xABE8 == code || // Mn MEETEI MAYEK VOWEL SIGN UNAP - 0xABED == code || // Mn MEETEI MAYEK APUN IYEK - 0xFB1E == code || // Mn HEBREW POINT JUDEO-SPANISH VARIKA - 0xFE00 <= code && code <= 0xFE0F || // Mn [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16 - 0xFE20 <= code && code <= 0xFE2F || // Mn [16] COMBINING LIGATURE LEFT HALF..COMBINING CYRILLIC TITLO RIGHT HALF - 0xFF9E <= code && code <= 0xFF9F || // Lm [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK - 0x101FD == code || // Mn PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE - 0x102E0 == code || // Mn COPTIC EPACT THOUSANDS MARK - 0x10376 <= code && code <= 0x1037A || // Mn [5] COMBINING OLD PERMIC LETTER AN..COMBINING OLD PERMIC LETTER SII - 0x10A01 <= code && code <= 0x10A03 || // Mn [3] KHAROSHTHI VOWEL SIGN I..KHAROSHTHI VOWEL SIGN VOCALIC R - 0x10A05 <= code && code <= 0x10A06 || // Mn [2] KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O - 0x10A0C <= code && code <= 0x10A0F || // Mn [4] KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI SIGN VISARGA - 0x10A38 <= code && code <= 0x10A3A || // Mn [3] KHAROSHTHI SIGN BAR ABOVE..KHAROSHTHI SIGN DOT BELOW - 0x10A3F == code || // Mn KHAROSHTHI VIRAMA - 0x10AE5 <= code && code <= 0x10AE6 || // Mn [2] MANICHAEAN ABBREVIATION MARK ABOVE..MANICHAEAN ABBREVIATION MARK BELOW - 0x11001 == code || // Mn BRAHMI SIGN ANUSVARA - 0x11038 <= code && code <= 0x11046 || // Mn [15] BRAHMI VOWEL SIGN AA..BRAHMI VIRAMA - 0x1107F <= code && code <= 0x11081 || // Mn [3] BRAHMI NUMBER JOINER..KAITHI SIGN ANUSVARA - 0x110B3 <= code && code <= 0x110B6 || // Mn [4] KAITHI VOWEL SIGN U..KAITHI VOWEL SIGN AI - 0x110B9 <= code && code <= 0x110BA || // Mn [2] KAITHI SIGN VIRAMA..KAITHI SIGN NUKTA - 0x11100 <= code && code <= 0x11102 || // Mn [3] CHAKMA SIGN CANDRABINDU..CHAKMA SIGN VISARGA - 0x11127 <= code && code <= 0x1112B || // Mn [5] CHAKMA VOWEL SIGN A..CHAKMA VOWEL SIGN UU - 0x1112D <= code && code <= 0x11134 || // Mn [8] CHAKMA VOWEL SIGN AI..CHAKMA MAAYYAA - 0x11173 == code || // Mn MAHAJANI SIGN NUKTA - 0x11180 <= code && code <= 0x11181 || // Mn [2] SHARADA SIGN CANDRABINDU..SHARADA SIGN ANUSVARA - 0x111B6 <= code && code <= 0x111BE || // Mn [9] SHARADA VOWEL SIGN U..SHARADA VOWEL SIGN O - 0x111CA <= code && code <= 0x111CC || // Mn [3] SHARADA SIGN NUKTA..SHARADA EXTRA SHORT VOWEL MARK - 0x1122F <= code && code <= 0x11231 || // Mn [3] KHOJKI VOWEL SIGN U..KHOJKI VOWEL SIGN AI - 0x11234 == code || // Mn KHOJKI SIGN ANUSVARA - 0x11236 <= code && code <= 0x11237 || // Mn [2] KHOJKI SIGN NUKTA..KHOJKI SIGN SHADDA - 0x1123E == code || // Mn KHOJKI SIGN SUKUN - 0x112DF == code || // Mn KHUDAWADI SIGN ANUSVARA - 0x112E3 <= code && code <= 0x112EA || // Mn [8] KHUDAWADI VOWEL SIGN U..KHUDAWADI SIGN VIRAMA - 0x11300 <= code && code <= 0x11301 || // Mn [2] GRANTHA SIGN COMBINING ANUSVARA ABOVE..GRANTHA SIGN CANDRABINDU - 0x1133C == code || // Mn GRANTHA SIGN NUKTA - 0x1133E == code || // Mc GRANTHA VOWEL SIGN AA - 0x11340 == code || // Mn GRANTHA VOWEL SIGN II - 0x11357 == code || // Mc GRANTHA AU LENGTH MARK - 0x11366 <= code && code <= 0x1136C || // Mn [7] COMBINING GRANTHA DIGIT ZERO..COMBINING GRANTHA DIGIT SIX - 0x11370 <= code && code <= 0x11374 || // Mn [5] COMBINING GRANTHA LETTER A..COMBINING GRANTHA LETTER PA - 0x11438 <= code && code <= 0x1143F || // Mn [8] NEWA VOWEL SIGN U..NEWA VOWEL SIGN AI - 0x11442 <= code && code <= 0x11444 || // Mn [3] NEWA SIGN VIRAMA..NEWA SIGN ANUSVARA - 0x11446 == code || // Mn NEWA SIGN NUKTA - 0x114B0 == code || // Mc TIRHUTA VOWEL SIGN AA - 0x114B3 <= code && code <= 0x114B8 || // Mn [6] TIRHUTA VOWEL SIGN U..TIRHUTA VOWEL SIGN VOCALIC LL - 0x114BA == code || // Mn TIRHUTA VOWEL SIGN SHORT E - 0x114BD == code || // Mc TIRHUTA VOWEL SIGN SHORT O - 0x114BF <= code && code <= 0x114C0 || // Mn [2] TIRHUTA SIGN CANDRABINDU..TIRHUTA SIGN ANUSVARA - 0x114C2 <= code && code <= 0x114C3 || // Mn [2] TIRHUTA SIGN VIRAMA..TIRHUTA SIGN NUKTA - 0x115AF == code || // Mc SIDDHAM VOWEL SIGN AA - 0x115B2 <= code && code <= 0x115B5 || // Mn [4] SIDDHAM VOWEL SIGN U..SIDDHAM VOWEL SIGN VOCALIC RR - 0x115BC <= code && code <= 0x115BD || // Mn [2] SIDDHAM SIGN CANDRABINDU..SIDDHAM SIGN ANUSVARA - 0x115BF <= code && code <= 0x115C0 || // Mn [2] SIDDHAM SIGN VIRAMA..SIDDHAM SIGN NUKTA - 0x115DC <= code && code <= 0x115DD || // Mn [2] SIDDHAM VOWEL SIGN ALTERNATE U..SIDDHAM VOWEL SIGN ALTERNATE UU - 0x11633 <= code && code <= 0x1163A || // Mn [8] MODI VOWEL SIGN U..MODI VOWEL SIGN AI - 0x1163D == code || // Mn MODI SIGN ANUSVARA - 0x1163F <= code && code <= 0x11640 || // Mn [2] MODI SIGN VIRAMA..MODI SIGN ARDHACANDRA - 0x116AB == code || // Mn TAKRI SIGN ANUSVARA - 0x116AD == code || // Mn TAKRI VOWEL SIGN AA - 0x116B0 <= code && code <= 0x116B5 || // Mn [6] TAKRI VOWEL SIGN U..TAKRI VOWEL SIGN AU - 0x116B7 == code || // Mn TAKRI SIGN NUKTA - 0x1171D <= code && code <= 0x1171F || // Mn [3] AHOM CONSONANT SIGN MEDIAL LA..AHOM CONSONANT SIGN MEDIAL LIGATING RA - 0x11722 <= code && code <= 0x11725 || // Mn [4] AHOM VOWEL SIGN I..AHOM VOWEL SIGN UU - 0x11727 <= code && code <= 0x1172B || // Mn [5] AHOM VOWEL SIGN AW..AHOM SIGN KILLER - 0x11A01 <= code && code <= 0x11A06 || // Mn [6] ZANABAZAR SQUARE VOWEL SIGN I..ZANABAZAR SQUARE VOWEL SIGN O - 0x11A09 <= code && code <= 0x11A0A || // Mn [2] ZANABAZAR SQUARE VOWEL SIGN REVERSED I..ZANABAZAR SQUARE VOWEL LENGTH MARK - 0x11A33 <= code && code <= 0x11A38 || // Mn [6] ZANABAZAR SQUARE FINAL CONSONANT MARK..ZANABAZAR SQUARE SIGN ANUSVARA - 0x11A3B <= code && code <= 0x11A3E || // Mn [4] ZANABAZAR SQUARE CLUSTER-FINAL LETTER YA..ZANABAZAR SQUARE CLUSTER-FINAL LETTER VA - 0x11A47 == code || // Mn ZANABAZAR SQUARE SUBJOINER - 0x11A51 <= code && code <= 0x11A56 || // Mn [6] SOYOMBO VOWEL SIGN I..SOYOMBO VOWEL SIGN OE - 0x11A59 <= code && code <= 0x11A5B || // Mn [3] SOYOMBO VOWEL SIGN VOCALIC R..SOYOMBO VOWEL LENGTH MARK - 0x11A8A <= code && code <= 0x11A96 || // Mn [13] SOYOMBO FINAL CONSONANT SIGN G..SOYOMBO SIGN ANUSVARA - 0x11A98 <= code && code <= 0x11A99 || // Mn [2] SOYOMBO GEMINATION MARK..SOYOMBO SUBJOINER - 0x11C30 <= code && code <= 0x11C36 || // Mn [7] BHAIKSUKI VOWEL SIGN I..BHAIKSUKI VOWEL SIGN VOCALIC L - 0x11C38 <= code && code <= 0x11C3D || // Mn [6] BHAIKSUKI VOWEL SIGN E..BHAIKSUKI SIGN ANUSVARA - 0x11C3F == code || // Mn BHAIKSUKI SIGN VIRAMA - 0x11C92 <= code && code <= 0x11CA7 || // Mn [22] MARCHEN SUBJOINED LETTER KA..MARCHEN SUBJOINED LETTER ZA - 0x11CAA <= code && code <= 0x11CB0 || // Mn [7] MARCHEN SUBJOINED LETTER RA..MARCHEN VOWEL SIGN AA - 0x11CB2 <= code && code <= 0x11CB3 || // Mn [2] MARCHEN VOWEL SIGN U..MARCHEN VOWEL SIGN E - 0x11CB5 <= code && code <= 0x11CB6 || // Mn [2] MARCHEN SIGN ANUSVARA..MARCHEN SIGN CANDRABINDU - 0x11D31 <= code && code <= 0x11D36 || // Mn [6] MASARAM GONDI VOWEL SIGN AA..MASARAM GONDI VOWEL SIGN VOCALIC R - 0x11D3A == code || // Mn MASARAM GONDI VOWEL SIGN E - 0x11D3C <= code && code <= 0x11D3D || // Mn [2] MASARAM GONDI VOWEL SIGN AI..MASARAM GONDI VOWEL SIGN O - 0x11D3F <= code && code <= 0x11D45 || // Mn [7] MASARAM GONDI VOWEL SIGN AU..MASARAM GONDI VIRAMA - 0x11D47 == code || // Mn MASARAM GONDI RA-KARA - 0x16AF0 <= code && code <= 0x16AF4 || // Mn [5] BASSA VAH COMBINING HIGH TONE..BASSA VAH COMBINING HIGH-LOW TONE - 0x16B30 <= code && code <= 0x16B36 || // Mn [7] PAHAWH HMONG MARK CIM TUB..PAHAWH HMONG MARK CIM TAUM - 0x16F8F <= code && code <= 0x16F92 || // Mn [4] MIAO TONE RIGHT..MIAO TONE BELOW - 0x1BC9D <= code && code <= 0x1BC9E || // Mn [2] DUPLOYAN THICK LETTER SELECTOR..DUPLOYAN DOUBLE MARK - 0x1D165 == code || // Mc MUSICAL SYMBOL COMBINING STEM - 0x1D167 <= code && code <= 0x1D169 || // Mn [3] MUSICAL SYMBOL COMBINING TREMOLO-1..MUSICAL SYMBOL COMBINING TREMOLO-3 - 0x1D16E <= code && code <= 0x1D172 || // Mc [5] MUSICAL SYMBOL COMBINING FLAG-1..MUSICAL SYMBOL COMBINING FLAG-5 - 0x1D17B <= code && code <= 0x1D182 || // Mn [8] MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL COMBINING LOURE - 0x1D185 <= code && code <= 0x1D18B || // Mn [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE - 0x1D1AA <= code && code <= 0x1D1AD || // Mn [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO - 0x1D242 <= code && code <= 0x1D244 || // Mn [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME - 0x1DA00 <= code && code <= 0x1DA36 || // Mn [55] SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN - 0x1DA3B <= code && code <= 0x1DA6C || // Mn [50] SIGNWRITING MOUTH CLOSED NEUTRAL..SIGNWRITING EXCITEMENT - 0x1DA75 == code || // Mn SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS - 0x1DA84 == code || // Mn SIGNWRITING LOCATION HEAD NECK - 0x1DA9B <= code && code <= 0x1DA9F || // Mn [5] SIGNWRITING FILL MODIFIER-2..SIGNWRITING FILL MODIFIER-6 - 0x1DAA1 <= code && code <= 0x1DAAF || // Mn [15] SIGNWRITING ROTATION MODIFIER-2..SIGNWRITING ROTATION MODIFIER-16 - 0x1E000 <= code && code <= 0x1E006 || // Mn [7] COMBINING GLAGOLITIC LETTER AZU..COMBINING GLAGOLITIC LETTER ZHIVETE - 0x1E008 <= code && code <= 0x1E018 || // Mn [17] COMBINING GLAGOLITIC LETTER ZEMLJA..COMBINING GLAGOLITIC LETTER HERU - 0x1E01B <= code && code <= 0x1E021 || // Mn [7] COMBINING GLAGOLITIC LETTER SHTA..COMBINING GLAGOLITIC LETTER YATI - 0x1E023 <= code && code <= 0x1E024 || // Mn [2] COMBINING GLAGOLITIC LETTER YU..COMBINING GLAGOLITIC LETTER SMALL YUS - 0x1E026 <= code && code <= 0x1E02A || // Mn [5] COMBINING GLAGOLITIC LETTER YO..COMBINING GLAGOLITIC LETTER FITA - 0x1E8D0 <= code && code <= 0x1E8D6 || // Mn [7] MENDE KIKAKUI COMBINING NUMBER TEENS..MENDE KIKAKUI COMBINING NUMBER MILLIONS - 0x1E944 <= code && code <= 0x1E94A || // Mn [7] ADLAM ALIF LENGTHENER..ADLAM NUKTA - 0xE0020 <= code && code <= 0xE007F || // Cf [96] TAG SPACE..CANCEL TAG - 0xE0100 <= code && code <= 0xE01EF // Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256 - ) { - return Extend; - } - - if (0x1F1E6 <= code && code <= 0x1F1FF // So [26] REGIONAL INDICATOR SYMBOL LETTER A..REGIONAL INDICATOR SYMBOL LETTER Z - ) { - return Regional_Indicator; - } - - if (0x0903 == code || // Mc DEVANAGARI SIGN VISARGA - 0x093B == code || // Mc DEVANAGARI VOWEL SIGN OOE - 0x093E <= code && code <= 0x0940 || // Mc [3] DEVANAGARI VOWEL SIGN AA..DEVANAGARI VOWEL SIGN II - 0x0949 <= code && code <= 0x094C || // Mc [4] DEVANAGARI VOWEL SIGN CANDRA O..DEVANAGARI VOWEL SIGN AU - 0x094E <= code && code <= 0x094F || // Mc [2] DEVANAGARI VOWEL SIGN PRISHTHAMATRA E..DEVANAGARI VOWEL SIGN AW - 0x0982 <= code && code <= 0x0983 || // Mc [2] BENGALI SIGN ANUSVARA..BENGALI SIGN VISARGA - 0x09BF <= code && code <= 0x09C0 || // Mc [2] BENGALI VOWEL SIGN I..BENGALI VOWEL SIGN II - 0x09C7 <= code && code <= 0x09C8 || // Mc [2] BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI - 0x09CB <= code && code <= 0x09CC || // Mc [2] BENGALI VOWEL SIGN O..BENGALI VOWEL SIGN AU - 0x0A03 == code || // Mc GURMUKHI SIGN VISARGA - 0x0A3E <= code && code <= 0x0A40 || // Mc [3] GURMUKHI VOWEL SIGN AA..GURMUKHI VOWEL SIGN II - 0x0A83 == code || // Mc GUJARATI SIGN VISARGA - 0x0ABE <= code && code <= 0x0AC0 || // Mc [3] GUJARATI VOWEL SIGN AA..GUJARATI VOWEL SIGN II - 0x0AC9 == code || // Mc GUJARATI VOWEL SIGN CANDRA O - 0x0ACB <= code && code <= 0x0ACC || // Mc [2] GUJARATI VOWEL SIGN O..GUJARATI VOWEL SIGN AU - 0x0B02 <= code && code <= 0x0B03 || // Mc [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA - 0x0B40 == code || // Mc ORIYA VOWEL SIGN II - 0x0B47 <= code && code <= 0x0B48 || // Mc [2] ORIYA VOWEL SIGN E..ORIYA VOWEL SIGN AI - 0x0B4B <= code && code <= 0x0B4C || // Mc [2] ORIYA VOWEL SIGN O..ORIYA VOWEL SIGN AU - 0x0BBF == code || // Mc TAMIL VOWEL SIGN I - 0x0BC1 <= code && code <= 0x0BC2 || // Mc [2] TAMIL VOWEL SIGN U..TAMIL VOWEL SIGN UU - 0x0BC6 <= code && code <= 0x0BC8 || // Mc [3] TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI - 0x0BCA <= code && code <= 0x0BCC || // Mc [3] TAMIL VOWEL SIGN O..TAMIL VOWEL SIGN AU - 0x0C01 <= code && code <= 0x0C03 || // Mc [3] TELUGU SIGN CANDRABINDU..TELUGU SIGN VISARGA - 0x0C41 <= code && code <= 0x0C44 || // Mc [4] TELUGU VOWEL SIGN U..TELUGU VOWEL SIGN VOCALIC RR - 0x0C82 <= code && code <= 0x0C83 || // Mc [2] KANNADA SIGN ANUSVARA..KANNADA SIGN VISARGA - 0x0CBE == code || // Mc KANNADA VOWEL SIGN AA - 0x0CC0 <= code && code <= 0x0CC1 || // Mc [2] KANNADA VOWEL SIGN II..KANNADA VOWEL SIGN U - 0x0CC3 <= code && code <= 0x0CC4 || // Mc [2] KANNADA VOWEL SIGN VOCALIC R..KANNADA VOWEL SIGN VOCALIC RR - 0x0CC7 <= code && code <= 0x0CC8 || // Mc [2] KANNADA VOWEL SIGN EE..KANNADA VOWEL SIGN AI - 0x0CCA <= code && code <= 0x0CCB || // Mc [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO - 0x0D02 <= code && code <= 0x0D03 || // Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA - 0x0D3F <= code && code <= 0x0D40 || // Mc [2] MALAYALAM VOWEL SIGN I..MALAYALAM VOWEL SIGN II - 0x0D46 <= code && code <= 0x0D48 || // Mc [3] MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI - 0x0D4A <= code && code <= 0x0D4C || // Mc [3] MALAYALAM VOWEL SIGN O..MALAYALAM VOWEL SIGN AU - 0x0D82 <= code && code <= 0x0D83 || // Mc [2] SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARGAYA - 0x0DD0 <= code && code <= 0x0DD1 || // Mc [2] SINHALA VOWEL SIGN KETTI AEDA-PILLA..SINHALA VOWEL SIGN DIGA AEDA-PILLA - 0x0DD8 <= code && code <= 0x0DDE || // Mc [7] SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA - 0x0DF2 <= code && code <= 0x0DF3 || // Mc [2] SINHALA VOWEL SIGN DIGA GAETTA-PILLA..SINHALA VOWEL SIGN DIGA GAYANUKITTA - 0x0E33 == code || // Lo THAI CHARACTER SARA AM - 0x0EB3 == code || // Lo LAO VOWEL SIGN AM - 0x0F3E <= code && code <= 0x0F3F || // Mc [2] TIBETAN SIGN YAR TSHES..TIBETAN SIGN MAR TSHES - 0x0F7F == code || // Mc TIBETAN SIGN RNAM BCAD - 0x1031 == code || // Mc MYANMAR VOWEL SIGN E - 0x103B <= code && code <= 0x103C || // Mc [2] MYANMAR CONSONANT SIGN MEDIAL YA..MYANMAR CONSONANT SIGN MEDIAL RA - 0x1056 <= code && code <= 0x1057 || // Mc [2] MYANMAR VOWEL SIGN VOCALIC R..MYANMAR VOWEL SIGN VOCALIC RR - 0x1084 == code || // Mc MYANMAR VOWEL SIGN SHAN E - 0x17B6 == code || // Mc KHMER VOWEL SIGN AA - 0x17BE <= code && code <= 0x17C5 || // Mc [8] KHMER VOWEL SIGN OE..KHMER VOWEL SIGN AU - 0x17C7 <= code && code <= 0x17C8 || // Mc [2] KHMER SIGN REAHMUK..KHMER SIGN YUUKALEAPINTU - 0x1923 <= code && code <= 0x1926 || // Mc [4] LIMBU VOWEL SIGN EE..LIMBU VOWEL SIGN AU - 0x1929 <= code && code <= 0x192B || // Mc [3] LIMBU SUBJOINED LETTER YA..LIMBU SUBJOINED LETTER WA - 0x1930 <= code && code <= 0x1931 || // Mc [2] LIMBU SMALL LETTER KA..LIMBU SMALL LETTER NGA - 0x1933 <= code && code <= 0x1938 || // Mc [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA - 0x1A19 <= code && code <= 0x1A1A || // Mc [2] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN O - 0x1A55 == code || // Mc TAI THAM CONSONANT SIGN MEDIAL RA - 0x1A57 == code || // Mc TAI THAM CONSONANT SIGN LA TANG LAI - 0x1A6D <= code && code <= 0x1A72 || // Mc [6] TAI THAM VOWEL SIGN OY..TAI THAM VOWEL SIGN THAM AI - 0x1B04 == code || // Mc BALINESE SIGN BISAH - 0x1B35 == code || // Mc BALINESE VOWEL SIGN TEDUNG - 0x1B3B == code || // Mc BALINESE VOWEL SIGN RA REPA TEDUNG - 0x1B3D <= code && code <= 0x1B41 || // Mc [5] BALINESE VOWEL SIGN LA LENGA TEDUNG..BALINESE VOWEL SIGN TALING REPA TEDUNG - 0x1B43 <= code && code <= 0x1B44 || // Mc [2] BALINESE VOWEL SIGN PEPET TEDUNG..BALINESE ADEG ADEG - 0x1B82 == code || // Mc SUNDANESE SIGN PANGWISAD - 0x1BA1 == code || // Mc SUNDANESE CONSONANT SIGN PAMINGKAL - 0x1BA6 <= code && code <= 0x1BA7 || // Mc [2] SUNDANESE VOWEL SIGN PANAELAENG..SUNDANESE VOWEL SIGN PANOLONG - 0x1BAA == code || // Mc SUNDANESE SIGN PAMAAEH - 0x1BE7 == code || // Mc BATAK VOWEL SIGN E - 0x1BEA <= code && code <= 0x1BEC || // Mc [3] BATAK VOWEL SIGN I..BATAK VOWEL SIGN O - 0x1BEE == code || // Mc BATAK VOWEL SIGN U - 0x1BF2 <= code && code <= 0x1BF3 || // Mc [2] BATAK PANGOLAT..BATAK PANONGONAN - 0x1C24 <= code && code <= 0x1C2B || // Mc [8] LEPCHA SUBJOINED LETTER YA..LEPCHA VOWEL SIGN UU - 0x1C34 <= code && code <= 0x1C35 || // Mc [2] LEPCHA CONSONANT SIGN NYIN-DO..LEPCHA CONSONANT SIGN KANG - 0x1CE1 == code || // Mc VEDIC TONE ATHARVAVEDIC INDEPENDENT SVARITA - 0x1CF2 <= code && code <= 0x1CF3 || // Mc [2] VEDIC SIGN ARDHAVISARGA..VEDIC SIGN ROTATED ARDHAVISARGA - 0x1CF7 == code || // Mc VEDIC SIGN ATIKRAMA - 0xA823 <= code && code <= 0xA824 || // Mc [2] SYLOTI NAGRI VOWEL SIGN A..SYLOTI NAGRI VOWEL SIGN I - 0xA827 == code || // Mc SYLOTI NAGRI VOWEL SIGN OO - 0xA880 <= code && code <= 0xA881 || // Mc [2] SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VISARGA - 0xA8B4 <= code && code <= 0xA8C3 || // Mc [16] SAURASHTRA CONSONANT SIGN HAARU..SAURASHTRA VOWEL SIGN AU - 0xA952 <= code && code <= 0xA953 || // Mc [2] REJANG CONSONANT SIGN H..REJANG VIRAMA - 0xA983 == code || // Mc JAVANESE SIGN WIGNYAN - 0xA9B4 <= code && code <= 0xA9B5 || // Mc [2] JAVANESE VOWEL SIGN TARUNG..JAVANESE VOWEL SIGN TOLONG - 0xA9BA <= code && code <= 0xA9BB || // Mc [2] JAVANESE VOWEL SIGN TALING..JAVANESE VOWEL SIGN DIRGA MURE - 0xA9BD <= code && code <= 0xA9C0 || // Mc [4] JAVANESE CONSONANT SIGN KERET..JAVANESE PANGKON - 0xAA2F <= code && code <= 0xAA30 || // Mc [2] CHAM VOWEL SIGN O..CHAM VOWEL SIGN AI - 0xAA33 <= code && code <= 0xAA34 || // Mc [2] CHAM CONSONANT SIGN YA..CHAM CONSONANT SIGN RA - 0xAA4D == code || // Mc CHAM CONSONANT SIGN FINAL H - 0xAAEB == code || // Mc MEETEI MAYEK VOWEL SIGN II - 0xAAEE <= code && code <= 0xAAEF || // Mc [2] MEETEI MAYEK VOWEL SIGN AU..MEETEI MAYEK VOWEL SIGN AAU - 0xAAF5 == code || // Mc MEETEI MAYEK VOWEL SIGN VISARGA - 0xABE3 <= code && code <= 0xABE4 || // Mc [2] MEETEI MAYEK VOWEL SIGN ONAP..MEETEI MAYEK VOWEL SIGN INAP - 0xABE6 <= code && code <= 0xABE7 || // Mc [2] MEETEI MAYEK VOWEL SIGN YENAP..MEETEI MAYEK VOWEL SIGN SOUNAP - 0xABE9 <= code && code <= 0xABEA || // Mc [2] MEETEI MAYEK VOWEL SIGN CHEINAP..MEETEI MAYEK VOWEL SIGN NUNG - 0xABEC == code || // Mc MEETEI MAYEK LUM IYEK - 0x11000 == code || // Mc BRAHMI SIGN CANDRABINDU - 0x11002 == code || // Mc BRAHMI SIGN VISARGA - 0x11082 == code || // Mc KAITHI SIGN VISARGA - 0x110B0 <= code && code <= 0x110B2 || // Mc [3] KAITHI VOWEL SIGN AA..KAITHI VOWEL SIGN II - 0x110B7 <= code && code <= 0x110B8 || // Mc [2] KAITHI VOWEL SIGN O..KAITHI VOWEL SIGN AU - 0x1112C == code || // Mc CHAKMA VOWEL SIGN E - 0x11182 == code || // Mc SHARADA SIGN VISARGA - 0x111B3 <= code && code <= 0x111B5 || // Mc [3] SHARADA VOWEL SIGN AA..SHARADA VOWEL SIGN II - 0x111BF <= code && code <= 0x111C0 || // Mc [2] SHARADA VOWEL SIGN AU..SHARADA SIGN VIRAMA - 0x1122C <= code && code <= 0x1122E || // Mc [3] KHOJKI VOWEL SIGN AA..KHOJKI VOWEL SIGN II - 0x11232 <= code && code <= 0x11233 || // Mc [2] KHOJKI VOWEL SIGN O..KHOJKI VOWEL SIGN AU - 0x11235 == code || // Mc KHOJKI SIGN VIRAMA - 0x112E0 <= code && code <= 0x112E2 || // Mc [3] KHUDAWADI VOWEL SIGN AA..KHUDAWADI VOWEL SIGN II - 0x11302 <= code && code <= 0x11303 || // Mc [2] GRANTHA SIGN ANUSVARA..GRANTHA SIGN VISARGA - 0x1133F == code || // Mc GRANTHA VOWEL SIGN I - 0x11341 <= code && code <= 0x11344 || // Mc [4] GRANTHA VOWEL SIGN U..GRANTHA VOWEL SIGN VOCALIC RR - 0x11347 <= code && code <= 0x11348 || // Mc [2] GRANTHA VOWEL SIGN EE..GRANTHA VOWEL SIGN AI - 0x1134B <= code && code <= 0x1134D || // Mc [3] GRANTHA VOWEL SIGN OO..GRANTHA SIGN VIRAMA - 0x11362 <= code && code <= 0x11363 || // Mc [2] GRANTHA VOWEL SIGN VOCALIC L..GRANTHA VOWEL SIGN VOCALIC LL - 0x11435 <= code && code <= 0x11437 || // Mc [3] NEWA VOWEL SIGN AA..NEWA VOWEL SIGN II - 0x11440 <= code && code <= 0x11441 || // Mc [2] NEWA VOWEL SIGN O..NEWA VOWEL SIGN AU - 0x11445 == code || // Mc NEWA SIGN VISARGA - 0x114B1 <= code && code <= 0x114B2 || // Mc [2] TIRHUTA VOWEL SIGN I..TIRHUTA VOWEL SIGN II - 0x114B9 == code || // Mc TIRHUTA VOWEL SIGN E - 0x114BB <= code && code <= 0x114BC || // Mc [2] TIRHUTA VOWEL SIGN AI..TIRHUTA VOWEL SIGN O - 0x114BE == code || // Mc TIRHUTA VOWEL SIGN AU - 0x114C1 == code || // Mc TIRHUTA SIGN VISARGA - 0x115B0 <= code && code <= 0x115B1 || // Mc [2] SIDDHAM VOWEL SIGN I..SIDDHAM VOWEL SIGN II - 0x115B8 <= code && code <= 0x115BB || // Mc [4] SIDDHAM VOWEL SIGN E..SIDDHAM VOWEL SIGN AU - 0x115BE == code || // Mc SIDDHAM SIGN VISARGA - 0x11630 <= code && code <= 0x11632 || // Mc [3] MODI VOWEL SIGN AA..MODI VOWEL SIGN II - 0x1163B <= code && code <= 0x1163C || // Mc [2] MODI VOWEL SIGN O..MODI VOWEL SIGN AU - 0x1163E == code || // Mc MODI SIGN VISARGA - 0x116AC == code || // Mc TAKRI SIGN VISARGA - 0x116AE <= code && code <= 0x116AF || // Mc [2] TAKRI VOWEL SIGN I..TAKRI VOWEL SIGN II - 0x116B6 == code || // Mc TAKRI SIGN VIRAMA - 0x11720 <= code && code <= 0x11721 || // Mc [2] AHOM VOWEL SIGN A..AHOM VOWEL SIGN AA - 0x11726 == code || // Mc AHOM VOWEL SIGN E - 0x11A07 <= code && code <= 0x11A08 || // Mc [2] ZANABAZAR SQUARE VOWEL SIGN AI..ZANABAZAR SQUARE VOWEL SIGN AU - 0x11A39 == code || // Mc ZANABAZAR SQUARE SIGN VISARGA - 0x11A57 <= code && code <= 0x11A58 || // Mc [2] SOYOMBO VOWEL SIGN AI..SOYOMBO VOWEL SIGN AU - 0x11A97 == code || // Mc SOYOMBO SIGN VISARGA - 0x11C2F == code || // Mc BHAIKSUKI VOWEL SIGN AA - 0x11C3E == code || // Mc BHAIKSUKI SIGN VISARGA - 0x11CA9 == code || // Mc MARCHEN SUBJOINED LETTER YA - 0x11CB1 == code || // Mc MARCHEN VOWEL SIGN I - 0x11CB4 == code || // Mc MARCHEN VOWEL SIGN O - 0x16F51 <= code && code <= 0x16F7E || // Mc [46] MIAO SIGN ASPIRATION..MIAO VOWEL SIGN NG - 0x1D166 == code || // Mc MUSICAL SYMBOL COMBINING SPRECHGESANG STEM - 0x1D16D == code // Mc MUSICAL SYMBOL COMBINING AUGMENTATION DOT - ) { - return SpacingMark; - } - - if (0x1100 <= code && code <= 0x115F || // Lo [96] HANGUL CHOSEONG KIYEOK..HANGUL CHOSEONG FILLER - 0xA960 <= code && code <= 0xA97C // Lo [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANGUL CHOSEONG SSANGYEORINHIEUH - ) { - return L; - } - - if (0x1160 <= code && code <= 0x11A7 || // Lo [72] HANGUL JUNGSEONG FILLER..HANGUL JUNGSEONG O-YAE - 0xD7B0 <= code && code <= 0xD7C6 // Lo [23] HANGUL JUNGSEONG O-YEO..HANGUL JUNGSEONG ARAEA-E - ) { - return V; - } - - if (0x11A8 <= code && code <= 0x11FF || // Lo [88] HANGUL JONGSEONG KIYEOK..HANGUL JONGSEONG SSANGNIEUN - 0xD7CB <= code && code <= 0xD7FB // Lo [49] HANGUL JONGSEONG NIEUN-RIEUL..HANGUL JONGSEONG PHIEUPH-THIEUTH - ) { - return T; - } - - if (0xAC00 == code || // Lo HANGUL SYLLABLE GA - 0xAC1C == code || // Lo HANGUL SYLLABLE GAE - 0xAC38 == code || // Lo HANGUL SYLLABLE GYA - 0xAC54 == code || // Lo HANGUL SYLLABLE GYAE - 0xAC70 == code || // Lo HANGUL SYLLABLE GEO - 0xAC8C == code || // Lo HANGUL SYLLABLE GE - 0xACA8 == code || // Lo HANGUL SYLLABLE GYEO - 0xACC4 == code || // Lo HANGUL SYLLABLE GYE - 0xACE0 == code || // Lo HANGUL SYLLABLE GO - 0xACFC == code || // Lo HANGUL SYLLABLE GWA - 0xAD18 == code || // Lo HANGUL SYLLABLE GWAE - 0xAD34 == code || // Lo HANGUL SYLLABLE GOE - 0xAD50 == code || // Lo HANGUL SYLLABLE GYO - 0xAD6C == code || // Lo HANGUL SYLLABLE GU - 0xAD88 == code || // Lo HANGUL SYLLABLE GWEO - 0xADA4 == code || // Lo HANGUL SYLLABLE GWE - 0xADC0 == code || // Lo HANGUL SYLLABLE GWI - 0xADDC == code || // Lo HANGUL SYLLABLE GYU - 0xADF8 == code || // Lo HANGUL SYLLABLE GEU - 0xAE14 == code || // Lo HANGUL SYLLABLE GYI - 0xAE30 == code || // Lo HANGUL SYLLABLE GI - 0xAE4C == code || // Lo HANGUL SYLLABLE GGA - 0xAE68 == code || // Lo HANGUL SYLLABLE GGAE - 0xAE84 == code || // Lo HANGUL SYLLABLE GGYA - 0xAEA0 == code || // Lo HANGUL SYLLABLE GGYAE - 0xAEBC == code || // Lo HANGUL SYLLABLE GGEO - 0xAED8 == code || // Lo HANGUL SYLLABLE GGE - 0xAEF4 == code || // Lo HANGUL SYLLABLE GGYEO - 0xAF10 == code || // Lo HANGUL SYLLABLE GGYE - 0xAF2C == code || // Lo HANGUL SYLLABLE GGO - 0xAF48 == code || // Lo HANGUL SYLLABLE GGWA - 0xAF64 == code || // Lo HANGUL SYLLABLE GGWAE - 0xAF80 == code || // Lo HANGUL SYLLABLE GGOE - 0xAF9C == code || // Lo HANGUL SYLLABLE GGYO - 0xAFB8 == code || // Lo HANGUL SYLLABLE GGU - 0xAFD4 == code || // Lo HANGUL SYLLABLE GGWEO - 0xAFF0 == code || // Lo HANGUL SYLLABLE GGWE - 0xB00C == code || // Lo HANGUL SYLLABLE GGWI - 0xB028 == code || // Lo HANGUL SYLLABLE GGYU - 0xB044 == code || // Lo HANGUL SYLLABLE GGEU - 0xB060 == code || // Lo HANGUL SYLLABLE GGYI - 0xB07C == code || // Lo HANGUL SYLLABLE GGI - 0xB098 == code || // Lo HANGUL SYLLABLE NA - 0xB0B4 == code || // Lo HANGUL SYLLABLE NAE - 0xB0D0 == code || // Lo HANGUL SYLLABLE NYA - 0xB0EC == code || // Lo HANGUL SYLLABLE NYAE - 0xB108 == code || // Lo HANGUL SYLLABLE NEO - 0xB124 == code || // Lo HANGUL SYLLABLE NE - 0xB140 == code || // Lo HANGUL SYLLABLE NYEO - 0xB15C == code || // Lo HANGUL SYLLABLE NYE - 0xB178 == code || // Lo HANGUL SYLLABLE NO - 0xB194 == code || // Lo HANGUL SYLLABLE NWA - 0xB1B0 == code || // Lo HANGUL SYLLABLE NWAE - 0xB1CC == code || // Lo HANGUL SYLLABLE NOE - 0xB1E8 == code || // Lo HANGUL SYLLABLE NYO - 0xB204 == code || // Lo HANGUL SYLLABLE NU - 0xB220 == code || // Lo HANGUL SYLLABLE NWEO - 0xB23C == code || // Lo HANGUL SYLLABLE NWE - 0xB258 == code || // Lo HANGUL SYLLABLE NWI - 0xB274 == code || // Lo HANGUL SYLLABLE NYU - 0xB290 == code || // Lo HANGUL SYLLABLE NEU - 0xB2AC == code || // Lo HANGUL SYLLABLE NYI - 0xB2C8 == code || // Lo HANGUL SYLLABLE NI - 0xB2E4 == code || // Lo HANGUL SYLLABLE DA - 0xB300 == code || // Lo HANGUL SYLLABLE DAE - 0xB31C == code || // Lo HANGUL SYLLABLE DYA - 0xB338 == code || // Lo HANGUL SYLLABLE DYAE - 0xB354 == code || // Lo HANGUL SYLLABLE DEO - 0xB370 == code || // Lo HANGUL SYLLABLE DE - 0xB38C == code || // Lo HANGUL SYLLABLE DYEO - 0xB3A8 == code || // Lo HANGUL SYLLABLE DYE - 0xB3C4 == code || // Lo HANGUL SYLLABLE DO - 0xB3E0 == code || // Lo HANGUL SYLLABLE DWA - 0xB3FC == code || // Lo HANGUL SYLLABLE DWAE - 0xB418 == code || // Lo HANGUL SYLLABLE DOE - 0xB434 == code || // Lo HANGUL SYLLABLE DYO - 0xB450 == code || // Lo HANGUL SYLLABLE DU - 0xB46C == code || // Lo HANGUL SYLLABLE DWEO - 0xB488 == code || // Lo HANGUL SYLLABLE DWE - 0xB4A4 == code || // Lo HANGUL SYLLABLE DWI - 0xB4C0 == code || // Lo HANGUL SYLLABLE DYU - 0xB4DC == code || // Lo HANGUL SYLLABLE DEU - 0xB4F8 == code || // Lo HANGUL SYLLABLE DYI - 0xB514 == code || // Lo HANGUL SYLLABLE DI - 0xB530 == code || // Lo HANGUL SYLLABLE DDA - 0xB54C == code || // Lo HANGUL SYLLABLE DDAE - 0xB568 == code || // Lo HANGUL SYLLABLE DDYA - 0xB584 == code || // Lo HANGUL SYLLABLE DDYAE - 0xB5A0 == code || // Lo HANGUL SYLLABLE DDEO - 0xB5BC == code || // Lo HANGUL SYLLABLE DDE - 0xB5D8 == code || // Lo HANGUL SYLLABLE DDYEO - 0xB5F4 == code || // Lo HANGUL SYLLABLE DDYE - 0xB610 == code || // Lo HANGUL SYLLABLE DDO - 0xB62C == code || // Lo HANGUL SYLLABLE DDWA - 0xB648 == code || // Lo HANGUL SYLLABLE DDWAE - 0xB664 == code || // Lo HANGUL SYLLABLE DDOE - 0xB680 == code || // Lo HANGUL SYLLABLE DDYO - 0xB69C == code || // Lo HANGUL SYLLABLE DDU - 0xB6B8 == code || // Lo HANGUL SYLLABLE DDWEO - 0xB6D4 == code || // Lo HANGUL SYLLABLE DDWE - 0xB6F0 == code || // Lo HANGUL SYLLABLE DDWI - 0xB70C == code || // Lo HANGUL SYLLABLE DDYU - 0xB728 == code || // Lo HANGUL SYLLABLE DDEU - 0xB744 == code || // Lo HANGUL SYLLABLE DDYI - 0xB760 == code || // Lo HANGUL SYLLABLE DDI - 0xB77C == code || // Lo HANGUL SYLLABLE RA - 0xB798 == code || // Lo HANGUL SYLLABLE RAE - 0xB7B4 == code || // Lo HANGUL SYLLABLE RYA - 0xB7D0 == code || // Lo HANGUL SYLLABLE RYAE - 0xB7EC == code || // Lo HANGUL SYLLABLE REO - 0xB808 == code || // Lo HANGUL SYLLABLE RE - 0xB824 == code || // Lo HANGUL SYLLABLE RYEO - 0xB840 == code || // Lo HANGUL SYLLABLE RYE - 0xB85C == code || // Lo HANGUL SYLLABLE RO - 0xB878 == code || // Lo HANGUL SYLLABLE RWA - 0xB894 == code || // Lo HANGUL SYLLABLE RWAE - 0xB8B0 == code || // Lo HANGUL SYLLABLE ROE - 0xB8CC == code || // Lo HANGUL SYLLABLE RYO - 0xB8E8 == code || // Lo HANGUL SYLLABLE RU - 0xB904 == code || // Lo HANGUL SYLLABLE RWEO - 0xB920 == code || // Lo HANGUL SYLLABLE RWE - 0xB93C == code || // Lo HANGUL SYLLABLE RWI - 0xB958 == code || // Lo HANGUL SYLLABLE RYU - 0xB974 == code || // Lo HANGUL SYLLABLE REU - 0xB990 == code || // Lo HANGUL SYLLABLE RYI - 0xB9AC == code || // Lo HANGUL SYLLABLE RI - 0xB9C8 == code || // Lo HANGUL SYLLABLE MA - 0xB9E4 == code || // Lo HANGUL SYLLABLE MAE - 0xBA00 == code || // Lo HANGUL SYLLABLE MYA - 0xBA1C == code || // Lo HANGUL SYLLABLE MYAE - 0xBA38 == code || // Lo HANGUL SYLLABLE MEO - 0xBA54 == code || // Lo HANGUL SYLLABLE ME - 0xBA70 == code || // Lo HANGUL SYLLABLE MYEO - 0xBA8C == code || // Lo HANGUL SYLLABLE MYE - 0xBAA8 == code || // Lo HANGUL SYLLABLE MO - 0xBAC4 == code || // Lo HANGUL SYLLABLE MWA - 0xBAE0 == code || // Lo HANGUL SYLLABLE MWAE - 0xBAFC == code || // Lo HANGUL SYLLABLE MOE - 0xBB18 == code || // Lo HANGUL SYLLABLE MYO - 0xBB34 == code || // Lo HANGUL SYLLABLE MU - 0xBB50 == code || // Lo HANGUL SYLLABLE MWEO - 0xBB6C == code || // Lo HANGUL SYLLABLE MWE - 0xBB88 == code || // Lo HANGUL SYLLABLE MWI - 0xBBA4 == code || // Lo HANGUL SYLLABLE MYU - 0xBBC0 == code || // Lo HANGUL SYLLABLE MEU - 0xBBDC == code || // Lo HANGUL SYLLABLE MYI - 0xBBF8 == code || // Lo HANGUL SYLLABLE MI - 0xBC14 == code || // Lo HANGUL SYLLABLE BA - 0xBC30 == code || // Lo HANGUL SYLLABLE BAE - 0xBC4C == code || // Lo HANGUL SYLLABLE BYA - 0xBC68 == code || // Lo HANGUL SYLLABLE BYAE - 0xBC84 == code || // Lo HANGUL SYLLABLE BEO - 0xBCA0 == code || // Lo HANGUL SYLLABLE BE - 0xBCBC == code || // Lo HANGUL SYLLABLE BYEO - 0xBCD8 == code || // Lo HANGUL SYLLABLE BYE - 0xBCF4 == code || // Lo HANGUL SYLLABLE BO - 0xBD10 == code || // Lo HANGUL SYLLABLE BWA - 0xBD2C == code || // Lo HANGUL SYLLABLE BWAE - 0xBD48 == code || // Lo HANGUL SYLLABLE BOE - 0xBD64 == code || // Lo HANGUL SYLLABLE BYO - 0xBD80 == code || // Lo HANGUL SYLLABLE BU - 0xBD9C == code || // Lo HANGUL SYLLABLE BWEO - 0xBDB8 == code || // Lo HANGUL SYLLABLE BWE - 0xBDD4 == code || // Lo HANGUL SYLLABLE BWI - 0xBDF0 == code || // Lo HANGUL SYLLABLE BYU - 0xBE0C == code || // Lo HANGUL SYLLABLE BEU - 0xBE28 == code || // Lo HANGUL SYLLABLE BYI - 0xBE44 == code || // Lo HANGUL SYLLABLE BI - 0xBE60 == code || // Lo HANGUL SYLLABLE BBA - 0xBE7C == code || // Lo HANGUL SYLLABLE BBAE - 0xBE98 == code || // Lo HANGUL SYLLABLE BBYA - 0xBEB4 == code || // Lo HANGUL SYLLABLE BBYAE - 0xBED0 == code || // Lo HANGUL SYLLABLE BBEO - 0xBEEC == code || // Lo HANGUL SYLLABLE BBE - 0xBF08 == code || // Lo HANGUL SYLLABLE BBYEO - 0xBF24 == code || // Lo HANGUL SYLLABLE BBYE - 0xBF40 == code || // Lo HANGUL SYLLABLE BBO - 0xBF5C == code || // Lo HANGUL SYLLABLE BBWA - 0xBF78 == code || // Lo HANGUL SYLLABLE BBWAE - 0xBF94 == code || // Lo HANGUL SYLLABLE BBOE - 0xBFB0 == code || // Lo HANGUL SYLLABLE BBYO - 0xBFCC == code || // Lo HANGUL SYLLABLE BBU - 0xBFE8 == code || // Lo HANGUL SYLLABLE BBWEO - 0xC004 == code || // Lo HANGUL SYLLABLE BBWE - 0xC020 == code || // Lo HANGUL SYLLABLE BBWI - 0xC03C == code || // Lo HANGUL SYLLABLE BBYU - 0xC058 == code || // Lo HANGUL SYLLABLE BBEU - 0xC074 == code || // Lo HANGUL SYLLABLE BBYI - 0xC090 == code || // Lo HANGUL SYLLABLE BBI - 0xC0AC == code || // Lo HANGUL SYLLABLE SA - 0xC0C8 == code || // Lo HANGUL SYLLABLE SAE - 0xC0E4 == code || // Lo HANGUL SYLLABLE SYA - 0xC100 == code || // Lo HANGUL SYLLABLE SYAE - 0xC11C == code || // Lo HANGUL SYLLABLE SEO - 0xC138 == code || // Lo HANGUL SYLLABLE SE - 0xC154 == code || // Lo HANGUL SYLLABLE SYEO - 0xC170 == code || // Lo HANGUL SYLLABLE SYE - 0xC18C == code || // Lo HANGUL SYLLABLE SO - 0xC1A8 == code || // Lo HANGUL SYLLABLE SWA - 0xC1C4 == code || // Lo HANGUL SYLLABLE SWAE - 0xC1E0 == code || // Lo HANGUL SYLLABLE SOE - 0xC1FC == code || // Lo HANGUL SYLLABLE SYO - 0xC218 == code || // Lo HANGUL SYLLABLE SU - 0xC234 == code || // Lo HANGUL SYLLABLE SWEO - 0xC250 == code || // Lo HANGUL SYLLABLE SWE - 0xC26C == code || // Lo HANGUL SYLLABLE SWI - 0xC288 == code || // Lo HANGUL SYLLABLE SYU - 0xC2A4 == code || // Lo HANGUL SYLLABLE SEU - 0xC2C0 == code || // Lo HANGUL SYLLABLE SYI - 0xC2DC == code || // Lo HANGUL SYLLABLE SI - 0xC2F8 == code || // Lo HANGUL SYLLABLE SSA - 0xC314 == code || // Lo HANGUL SYLLABLE SSAE - 0xC330 == code || // Lo HANGUL SYLLABLE SSYA - 0xC34C == code || // Lo HANGUL SYLLABLE SSYAE - 0xC368 == code || // Lo HANGUL SYLLABLE SSEO - 0xC384 == code || // Lo HANGUL SYLLABLE SSE - 0xC3A0 == code || // Lo HANGUL SYLLABLE SSYEO - 0xC3BC == code || // Lo HANGUL SYLLABLE SSYE - 0xC3D8 == code || // Lo HANGUL SYLLABLE SSO - 0xC3F4 == code || // Lo HANGUL SYLLABLE SSWA - 0xC410 == code || // Lo HANGUL SYLLABLE SSWAE - 0xC42C == code || // Lo HANGUL SYLLABLE SSOE - 0xC448 == code || // Lo HANGUL SYLLABLE SSYO - 0xC464 == code || // Lo HANGUL SYLLABLE SSU - 0xC480 == code || // Lo HANGUL SYLLABLE SSWEO - 0xC49C == code || // Lo HANGUL SYLLABLE SSWE - 0xC4B8 == code || // Lo HANGUL SYLLABLE SSWI - 0xC4D4 == code || // Lo HANGUL SYLLABLE SSYU - 0xC4F0 == code || // Lo HANGUL SYLLABLE SSEU - 0xC50C == code || // Lo HANGUL SYLLABLE SSYI - 0xC528 == code || // Lo HANGUL SYLLABLE SSI - 0xC544 == code || // Lo HANGUL SYLLABLE A - 0xC560 == code || // Lo HANGUL SYLLABLE AE - 0xC57C == code || // Lo HANGUL SYLLABLE YA - 0xC598 == code || // Lo HANGUL SYLLABLE YAE - 0xC5B4 == code || // Lo HANGUL SYLLABLE EO - 0xC5D0 == code || // Lo HANGUL SYLLABLE E - 0xC5EC == code || // Lo HANGUL SYLLABLE YEO - 0xC608 == code || // Lo HANGUL SYLLABLE YE - 0xC624 == code || // Lo HANGUL SYLLABLE O - 0xC640 == code || // Lo HANGUL SYLLABLE WA - 0xC65C == code || // Lo HANGUL SYLLABLE WAE - 0xC678 == code || // Lo HANGUL SYLLABLE OE - 0xC694 == code || // Lo HANGUL SYLLABLE YO - 0xC6B0 == code || // Lo HANGUL SYLLABLE U - 0xC6CC == code || // Lo HANGUL SYLLABLE WEO - 0xC6E8 == code || // Lo HANGUL SYLLABLE WE - 0xC704 == code || // Lo HANGUL SYLLABLE WI - 0xC720 == code || // Lo HANGUL SYLLABLE YU - 0xC73C == code || // Lo HANGUL SYLLABLE EU - 0xC758 == code || // Lo HANGUL SYLLABLE YI - 0xC774 == code || // Lo HANGUL SYLLABLE I - 0xC790 == code || // Lo HANGUL SYLLABLE JA - 0xC7AC == code || // Lo HANGUL SYLLABLE JAE - 0xC7C8 == code || // Lo HANGUL SYLLABLE JYA - 0xC7E4 == code || // Lo HANGUL SYLLABLE JYAE - 0xC800 == code || // Lo HANGUL SYLLABLE JEO - 0xC81C == code || // Lo HANGUL SYLLABLE JE - 0xC838 == code || // Lo HANGUL SYLLABLE JYEO - 0xC854 == code || // Lo HANGUL SYLLABLE JYE - 0xC870 == code || // Lo HANGUL SYLLABLE JO - 0xC88C == code || // Lo HANGUL SYLLABLE JWA - 0xC8A8 == code || // Lo HANGUL SYLLABLE JWAE - 0xC8C4 == code || // Lo HANGUL SYLLABLE JOE - 0xC8E0 == code || // Lo HANGUL SYLLABLE JYO - 0xC8FC == code || // Lo HANGUL SYLLABLE JU - 0xC918 == code || // Lo HANGUL SYLLABLE JWEO - 0xC934 == code || // Lo HANGUL SYLLABLE JWE - 0xC950 == code || // Lo HANGUL SYLLABLE JWI - 0xC96C == code || // Lo HANGUL SYLLABLE JYU - 0xC988 == code || // Lo HANGUL SYLLABLE JEU - 0xC9A4 == code || // Lo HANGUL SYLLABLE JYI - 0xC9C0 == code || // Lo HANGUL SYLLABLE JI - 0xC9DC == code || // Lo HANGUL SYLLABLE JJA - 0xC9F8 == code || // Lo HANGUL SYLLABLE JJAE - 0xCA14 == code || // Lo HANGUL SYLLABLE JJYA - 0xCA30 == code || // Lo HANGUL SYLLABLE JJYAE - 0xCA4C == code || // Lo HANGUL SYLLABLE JJEO - 0xCA68 == code || // Lo HANGUL SYLLABLE JJE - 0xCA84 == code || // Lo HANGUL SYLLABLE JJYEO - 0xCAA0 == code || // Lo HANGUL SYLLABLE JJYE - 0xCABC == code || // Lo HANGUL SYLLABLE JJO - 0xCAD8 == code || // Lo HANGUL SYLLABLE JJWA - 0xCAF4 == code || // Lo HANGUL SYLLABLE JJWAE - 0xCB10 == code || // Lo HANGUL SYLLABLE JJOE - 0xCB2C == code || // Lo HANGUL SYLLABLE JJYO - 0xCB48 == code || // Lo HANGUL SYLLABLE JJU - 0xCB64 == code || // Lo HANGUL SYLLABLE JJWEO - 0xCB80 == code || // Lo HANGUL SYLLABLE JJWE - 0xCB9C == code || // Lo HANGUL SYLLABLE JJWI - 0xCBB8 == code || // Lo HANGUL SYLLABLE JJYU - 0xCBD4 == code || // Lo HANGUL SYLLABLE JJEU - 0xCBF0 == code || // Lo HANGUL SYLLABLE JJYI - 0xCC0C == code || // Lo HANGUL SYLLABLE JJI - 0xCC28 == code || // Lo HANGUL SYLLABLE CA - 0xCC44 == code || // Lo HANGUL SYLLABLE CAE - 0xCC60 == code || // Lo HANGUL SYLLABLE CYA - 0xCC7C == code || // Lo HANGUL SYLLABLE CYAE - 0xCC98 == code || // Lo HANGUL SYLLABLE CEO - 0xCCB4 == code || // Lo HANGUL SYLLABLE CE - 0xCCD0 == code || // Lo HANGUL SYLLABLE CYEO - 0xCCEC == code || // Lo HANGUL SYLLABLE CYE - 0xCD08 == code || // Lo HANGUL SYLLABLE CO - 0xCD24 == code || // Lo HANGUL SYLLABLE CWA - 0xCD40 == code || // Lo HANGUL SYLLABLE CWAE - 0xCD5C == code || // Lo HANGUL SYLLABLE COE - 0xCD78 == code || // Lo HANGUL SYLLABLE CYO - 0xCD94 == code || // Lo HANGUL SYLLABLE CU - 0xCDB0 == code || // Lo HANGUL SYLLABLE CWEO - 0xCDCC == code || // Lo HANGUL SYLLABLE CWE - 0xCDE8 == code || // Lo HANGUL SYLLABLE CWI - 0xCE04 == code || // Lo HANGUL SYLLABLE CYU - 0xCE20 == code || // Lo HANGUL SYLLABLE CEU - 0xCE3C == code || // Lo HANGUL SYLLABLE CYI - 0xCE58 == code || // Lo HANGUL SYLLABLE CI - 0xCE74 == code || // Lo HANGUL SYLLABLE KA - 0xCE90 == code || // Lo HANGUL SYLLABLE KAE - 0xCEAC == code || // Lo HANGUL SYLLABLE KYA - 0xCEC8 == code || // Lo HANGUL SYLLABLE KYAE - 0xCEE4 == code || // Lo HANGUL SYLLABLE KEO - 0xCF00 == code || // Lo HANGUL SYLLABLE KE - 0xCF1C == code || // Lo HANGUL SYLLABLE KYEO - 0xCF38 == code || // Lo HANGUL SYLLABLE KYE - 0xCF54 == code || // Lo HANGUL SYLLABLE KO - 0xCF70 == code || // Lo HANGUL SYLLABLE KWA - 0xCF8C == code || // Lo HANGUL SYLLABLE KWAE - 0xCFA8 == code || // Lo HANGUL SYLLABLE KOE - 0xCFC4 == code || // Lo HANGUL SYLLABLE KYO - 0xCFE0 == code || // Lo HANGUL SYLLABLE KU - 0xCFFC == code || // Lo HANGUL SYLLABLE KWEO - 0xD018 == code || // Lo HANGUL SYLLABLE KWE - 0xD034 == code || // Lo HANGUL SYLLABLE KWI - 0xD050 == code || // Lo HANGUL SYLLABLE KYU - 0xD06C == code || // Lo HANGUL SYLLABLE KEU - 0xD088 == code || // Lo HANGUL SYLLABLE KYI - 0xD0A4 == code || // Lo HANGUL SYLLABLE KI - 0xD0C0 == code || // Lo HANGUL SYLLABLE TA - 0xD0DC == code || // Lo HANGUL SYLLABLE TAE - 0xD0F8 == code || // Lo HANGUL SYLLABLE TYA - 0xD114 == code || // Lo HANGUL SYLLABLE TYAE - 0xD130 == code || // Lo HANGUL SYLLABLE TEO - 0xD14C == code || // Lo HANGUL SYLLABLE TE - 0xD168 == code || // Lo HANGUL SYLLABLE TYEO - 0xD184 == code || // Lo HANGUL SYLLABLE TYE - 0xD1A0 == code || // Lo HANGUL SYLLABLE TO - 0xD1BC == code || // Lo HANGUL SYLLABLE TWA - 0xD1D8 == code || // Lo HANGUL SYLLABLE TWAE - 0xD1F4 == code || // Lo HANGUL SYLLABLE TOE - 0xD210 == code || // Lo HANGUL SYLLABLE TYO - 0xD22C == code || // Lo HANGUL SYLLABLE TU - 0xD248 == code || // Lo HANGUL SYLLABLE TWEO - 0xD264 == code || // Lo HANGUL SYLLABLE TWE - 0xD280 == code || // Lo HANGUL SYLLABLE TWI - 0xD29C == code || // Lo HANGUL SYLLABLE TYU - 0xD2B8 == code || // Lo HANGUL SYLLABLE TEU - 0xD2D4 == code || // Lo HANGUL SYLLABLE TYI - 0xD2F0 == code || // Lo HANGUL SYLLABLE TI - 0xD30C == code || // Lo HANGUL SYLLABLE PA - 0xD328 == code || // Lo HANGUL SYLLABLE PAE - 0xD344 == code || // Lo HANGUL SYLLABLE PYA - 0xD360 == code || // Lo HANGUL SYLLABLE PYAE - 0xD37C == code || // Lo HANGUL SYLLABLE PEO - 0xD398 == code || // Lo HANGUL SYLLABLE PE - 0xD3B4 == code || // Lo HANGUL SYLLABLE PYEO - 0xD3D0 == code || // Lo HANGUL SYLLABLE PYE - 0xD3EC == code || // Lo HANGUL SYLLABLE PO - 0xD408 == code || // Lo HANGUL SYLLABLE PWA - 0xD424 == code || // Lo HANGUL SYLLABLE PWAE - 0xD440 == code || // Lo HANGUL SYLLABLE POE - 0xD45C == code || // Lo HANGUL SYLLABLE PYO - 0xD478 == code || // Lo HANGUL SYLLABLE PU - 0xD494 == code || // Lo HANGUL SYLLABLE PWEO - 0xD4B0 == code || // Lo HANGUL SYLLABLE PWE - 0xD4CC == code || // Lo HANGUL SYLLABLE PWI - 0xD4E8 == code || // Lo HANGUL SYLLABLE PYU - 0xD504 == code || // Lo HANGUL SYLLABLE PEU - 0xD520 == code || // Lo HANGUL SYLLABLE PYI - 0xD53C == code || // Lo HANGUL SYLLABLE PI - 0xD558 == code || // Lo HANGUL SYLLABLE HA - 0xD574 == code || // Lo HANGUL SYLLABLE HAE - 0xD590 == code || // Lo HANGUL SYLLABLE HYA - 0xD5AC == code || // Lo HANGUL SYLLABLE HYAE - 0xD5C8 == code || // Lo HANGUL SYLLABLE HEO - 0xD5E4 == code || // Lo HANGUL SYLLABLE HE - 0xD600 == code || // Lo HANGUL SYLLABLE HYEO - 0xD61C == code || // Lo HANGUL SYLLABLE HYE - 0xD638 == code || // Lo HANGUL SYLLABLE HO - 0xD654 == code || // Lo HANGUL SYLLABLE HWA - 0xD670 == code || // Lo HANGUL SYLLABLE HWAE - 0xD68C == code || // Lo HANGUL SYLLABLE HOE - 0xD6A8 == code || // Lo HANGUL SYLLABLE HYO - 0xD6C4 == code || // Lo HANGUL SYLLABLE HU - 0xD6E0 == code || // Lo HANGUL SYLLABLE HWEO - 0xD6FC == code || // Lo HANGUL SYLLABLE HWE - 0xD718 == code || // Lo HANGUL SYLLABLE HWI - 0xD734 == code || // Lo HANGUL SYLLABLE HYU - 0xD750 == code || // Lo HANGUL SYLLABLE HEU - 0xD76C == code || // Lo HANGUL SYLLABLE HYI - 0xD788 == code // Lo HANGUL SYLLABLE HI - ) { - return LV; - } - - if (0xAC01 <= code && code <= 0xAC1B || // Lo [27] HANGUL SYLLABLE GAG..HANGUL SYLLABLE GAH - 0xAC1D <= code && code <= 0xAC37 || // Lo [27] HANGUL SYLLABLE GAEG..HANGUL SYLLABLE GAEH - 0xAC39 <= code && code <= 0xAC53 || // Lo [27] HANGUL SYLLABLE GYAG..HANGUL SYLLABLE GYAH - 0xAC55 <= code && code <= 0xAC6F || // Lo [27] HANGUL SYLLABLE GYAEG..HANGUL SYLLABLE GYAEH - 0xAC71 <= code && code <= 0xAC8B || // Lo [27] HANGUL SYLLABLE GEOG..HANGUL SYLLABLE GEOH - 0xAC8D <= code && code <= 0xACA7 || // Lo [27] HANGUL SYLLABLE GEG..HANGUL SYLLABLE GEH - 0xACA9 <= code && code <= 0xACC3 || // Lo [27] HANGUL SYLLABLE GYEOG..HANGUL SYLLABLE GYEOH - 0xACC5 <= code && code <= 0xACDF || // Lo [27] HANGUL SYLLABLE GYEG..HANGUL SYLLABLE GYEH - 0xACE1 <= code && code <= 0xACFB || // Lo [27] HANGUL SYLLABLE GOG..HANGUL SYLLABLE GOH - 0xACFD <= code && code <= 0xAD17 || // Lo [27] HANGUL SYLLABLE GWAG..HANGUL SYLLABLE GWAH - 0xAD19 <= code && code <= 0xAD33 || // Lo [27] HANGUL SYLLABLE GWAEG..HANGUL SYLLABLE GWAEH - 0xAD35 <= code && code <= 0xAD4F || // Lo [27] HANGUL SYLLABLE GOEG..HANGUL SYLLABLE GOEH - 0xAD51 <= code && code <= 0xAD6B || // Lo [27] HANGUL SYLLABLE GYOG..HANGUL SYLLABLE GYOH - 0xAD6D <= code && code <= 0xAD87 || // Lo [27] HANGUL SYLLABLE GUG..HANGUL SYLLABLE GUH - 0xAD89 <= code && code <= 0xADA3 || // Lo [27] HANGUL SYLLABLE GWEOG..HANGUL SYLLABLE GWEOH - 0xADA5 <= code && code <= 0xADBF || // Lo [27] HANGUL SYLLABLE GWEG..HANGUL SYLLABLE GWEH - 0xADC1 <= code && code <= 0xADDB || // Lo [27] HANGUL SYLLABLE GWIG..HANGUL SYLLABLE GWIH - 0xADDD <= code && code <= 0xADF7 || // Lo [27] HANGUL SYLLABLE GYUG..HANGUL SYLLABLE GYUH - 0xADF9 <= code && code <= 0xAE13 || // Lo [27] HANGUL SYLLABLE GEUG..HANGUL SYLLABLE GEUH - 0xAE15 <= code && code <= 0xAE2F || // Lo [27] HANGUL SYLLABLE GYIG..HANGUL SYLLABLE GYIH - 0xAE31 <= code && code <= 0xAE4B || // Lo [27] HANGUL SYLLABLE GIG..HANGUL SYLLABLE GIH - 0xAE4D <= code && code <= 0xAE67 || // Lo [27] HANGUL SYLLABLE GGAG..HANGUL SYLLABLE GGAH - 0xAE69 <= code && code <= 0xAE83 || // Lo [27] HANGUL SYLLABLE GGAEG..HANGUL SYLLABLE GGAEH - 0xAE85 <= code && code <= 0xAE9F || // Lo [27] HANGUL SYLLABLE GGYAG..HANGUL SYLLABLE GGYAH - 0xAEA1 <= code && code <= 0xAEBB || // Lo [27] HANGUL SYLLABLE GGYAEG..HANGUL SYLLABLE GGYAEH - 0xAEBD <= code && code <= 0xAED7 || // Lo [27] HANGUL SYLLABLE GGEOG..HANGUL SYLLABLE GGEOH - 0xAED9 <= code && code <= 0xAEF3 || // Lo [27] HANGUL SYLLABLE GGEG..HANGUL SYLLABLE GGEH - 0xAEF5 <= code && code <= 0xAF0F || // Lo [27] HANGUL SYLLABLE GGYEOG..HANGUL SYLLABLE GGYEOH - 0xAF11 <= code && code <= 0xAF2B || // Lo [27] HANGUL SYLLABLE GGYEG..HANGUL SYLLABLE GGYEH - 0xAF2D <= code && code <= 0xAF47 || // Lo [27] HANGUL SYLLABLE GGOG..HANGUL SYLLABLE GGOH - 0xAF49 <= code && code <= 0xAF63 || // Lo [27] HANGUL SYLLABLE GGWAG..HANGUL SYLLABLE GGWAH - 0xAF65 <= code && code <= 0xAF7F || // Lo [27] HANGUL SYLLABLE GGWAEG..HANGUL SYLLABLE GGWAEH - 0xAF81 <= code && code <= 0xAF9B || // Lo [27] HANGUL SYLLABLE GGOEG..HANGUL SYLLABLE GGOEH - 0xAF9D <= code && code <= 0xAFB7 || // Lo [27] HANGUL SYLLABLE GGYOG..HANGUL SYLLABLE GGYOH - 0xAFB9 <= code && code <= 0xAFD3 || // Lo [27] HANGUL SYLLABLE GGUG..HANGUL SYLLABLE GGUH - 0xAFD5 <= code && code <= 0xAFEF || // Lo [27] HANGUL SYLLABLE GGWEOG..HANGUL SYLLABLE GGWEOH - 0xAFF1 <= code && code <= 0xB00B || // Lo [27] HANGUL SYLLABLE GGWEG..HANGUL SYLLABLE GGWEH - 0xB00D <= code && code <= 0xB027 || // Lo [27] HANGUL SYLLABLE GGWIG..HANGUL SYLLABLE GGWIH - 0xB029 <= code && code <= 0xB043 || // Lo [27] HANGUL SYLLABLE GGYUG..HANGUL SYLLABLE GGYUH - 0xB045 <= code && code <= 0xB05F || // Lo [27] HANGUL SYLLABLE GGEUG..HANGUL SYLLABLE GGEUH - 0xB061 <= code && code <= 0xB07B || // Lo [27] HANGUL SYLLABLE GGYIG..HANGUL SYLLABLE GGYIH - 0xB07D <= code && code <= 0xB097 || // Lo [27] HANGUL SYLLABLE GGIG..HANGUL SYLLABLE GGIH - 0xB099 <= code && code <= 0xB0B3 || // Lo [27] HANGUL SYLLABLE NAG..HANGUL SYLLABLE NAH - 0xB0B5 <= code && code <= 0xB0CF || // Lo [27] HANGUL SYLLABLE NAEG..HANGUL SYLLABLE NAEH - 0xB0D1 <= code && code <= 0xB0EB || // Lo [27] HANGUL SYLLABLE NYAG..HANGUL SYLLABLE NYAH - 0xB0ED <= code && code <= 0xB107 || // Lo [27] HANGUL SYLLABLE NYAEG..HANGUL SYLLABLE NYAEH - 0xB109 <= code && code <= 0xB123 || // Lo [27] HANGUL SYLLABLE NEOG..HANGUL SYLLABLE NEOH - 0xB125 <= code && code <= 0xB13F || // Lo [27] HANGUL SYLLABLE NEG..HANGUL SYLLABLE NEH - 0xB141 <= code && code <= 0xB15B || // Lo [27] HANGUL SYLLABLE NYEOG..HANGUL SYLLABLE NYEOH - 0xB15D <= code && code <= 0xB177 || // Lo [27] HANGUL SYLLABLE NYEG..HANGUL SYLLABLE NYEH - 0xB179 <= code && code <= 0xB193 || // Lo [27] HANGUL SYLLABLE NOG..HANGUL SYLLABLE NOH - 0xB195 <= code && code <= 0xB1AF || // Lo [27] HANGUL SYLLABLE NWAG..HANGUL SYLLABLE NWAH - 0xB1B1 <= code && code <= 0xB1CB || // Lo [27] HANGUL SYLLABLE NWAEG..HANGUL SYLLABLE NWAEH - 0xB1CD <= code && code <= 0xB1E7 || // Lo [27] HANGUL SYLLABLE NOEG..HANGUL SYLLABLE NOEH - 0xB1E9 <= code && code <= 0xB203 || // Lo [27] HANGUL SYLLABLE NYOG..HANGUL SYLLABLE NYOH - 0xB205 <= code && code <= 0xB21F || // Lo [27] HANGUL SYLLABLE NUG..HANGUL SYLLABLE NUH - 0xB221 <= code && code <= 0xB23B || // Lo [27] HANGUL SYLLABLE NWEOG..HANGUL SYLLABLE NWEOH - 0xB23D <= code && code <= 0xB257 || // Lo [27] HANGUL SYLLABLE NWEG..HANGUL SYLLABLE NWEH - 0xB259 <= code && code <= 0xB273 || // Lo [27] HANGUL SYLLABLE NWIG..HANGUL SYLLABLE NWIH - 0xB275 <= code && code <= 0xB28F || // Lo [27] HANGUL SYLLABLE NYUG..HANGUL SYLLABLE NYUH - 0xB291 <= code && code <= 0xB2AB || // Lo [27] HANGUL SYLLABLE NEUG..HANGUL SYLLABLE NEUH - 0xB2AD <= code && code <= 0xB2C7 || // Lo [27] HANGUL SYLLABLE NYIG..HANGUL SYLLABLE NYIH - 0xB2C9 <= code && code <= 0xB2E3 || // Lo [27] HANGUL SYLLABLE NIG..HANGUL SYLLABLE NIH - 0xB2E5 <= code && code <= 0xB2FF || // Lo [27] HANGUL SYLLABLE DAG..HANGUL SYLLABLE DAH - 0xB301 <= code && code <= 0xB31B || // Lo [27] HANGUL SYLLABLE DAEG..HANGUL SYLLABLE DAEH - 0xB31D <= code && code <= 0xB337 || // Lo [27] HANGUL SYLLABLE DYAG..HANGUL SYLLABLE DYAH - 0xB339 <= code && code <= 0xB353 || // Lo [27] HANGUL SYLLABLE DYAEG..HANGUL SYLLABLE DYAEH - 0xB355 <= code && code <= 0xB36F || // Lo [27] HANGUL SYLLABLE DEOG..HANGUL SYLLABLE DEOH - 0xB371 <= code && code <= 0xB38B || // Lo [27] HANGUL SYLLABLE DEG..HANGUL SYLLABLE DEH - 0xB38D <= code && code <= 0xB3A7 || // Lo [27] HANGUL SYLLABLE DYEOG..HANGUL SYLLABLE DYEOH - 0xB3A9 <= code && code <= 0xB3C3 || // Lo [27] HANGUL SYLLABLE DYEG..HANGUL SYLLABLE DYEH - 0xB3C5 <= code && code <= 0xB3DF || // Lo [27] HANGUL SYLLABLE DOG..HANGUL SYLLABLE DOH - 0xB3E1 <= code && code <= 0xB3FB || // Lo [27] HANGUL SYLLABLE DWAG..HANGUL SYLLABLE DWAH - 0xB3FD <= code && code <= 0xB417 || // Lo [27] HANGUL SYLLABLE DWAEG..HANGUL SYLLABLE DWAEH - 0xB419 <= code && code <= 0xB433 || // Lo [27] HANGUL SYLLABLE DOEG..HANGUL SYLLABLE DOEH - 0xB435 <= code && code <= 0xB44F || // Lo [27] HANGUL SYLLABLE DYOG..HANGUL SYLLABLE DYOH - 0xB451 <= code && code <= 0xB46B || // Lo [27] HANGUL SYLLABLE DUG..HANGUL SYLLABLE DUH - 0xB46D <= code && code <= 0xB487 || // Lo [27] HANGUL SYLLABLE DWEOG..HANGUL SYLLABLE DWEOH - 0xB489 <= code && code <= 0xB4A3 || // Lo [27] HANGUL SYLLABLE DWEG..HANGUL SYLLABLE DWEH - 0xB4A5 <= code && code <= 0xB4BF || // Lo [27] HANGUL SYLLABLE DWIG..HANGUL SYLLABLE DWIH - 0xB4C1 <= code && code <= 0xB4DB || // Lo [27] HANGUL SYLLABLE DYUG..HANGUL SYLLABLE DYUH - 0xB4DD <= code && code <= 0xB4F7 || // Lo [27] HANGUL SYLLABLE DEUG..HANGUL SYLLABLE DEUH - 0xB4F9 <= code && code <= 0xB513 || // Lo [27] HANGUL SYLLABLE DYIG..HANGUL SYLLABLE DYIH - 0xB515 <= code && code <= 0xB52F || // Lo [27] HANGUL SYLLABLE DIG..HANGUL SYLLABLE DIH - 0xB531 <= code && code <= 0xB54B || // Lo [27] HANGUL SYLLABLE DDAG..HANGUL SYLLABLE DDAH - 0xB54D <= code && code <= 0xB567 || // Lo [27] HANGUL SYLLABLE DDAEG..HANGUL SYLLABLE DDAEH - 0xB569 <= code && code <= 0xB583 || // Lo [27] HANGUL SYLLABLE DDYAG..HANGUL SYLLABLE DDYAH - 0xB585 <= code && code <= 0xB59F || // Lo [27] HANGUL SYLLABLE DDYAEG..HANGUL SYLLABLE DDYAEH - 0xB5A1 <= code && code <= 0xB5BB || // Lo [27] HANGUL SYLLABLE DDEOG..HANGUL SYLLABLE DDEOH - 0xB5BD <= code && code <= 0xB5D7 || // Lo [27] HANGUL SYLLABLE DDEG..HANGUL SYLLABLE DDEH - 0xB5D9 <= code && code <= 0xB5F3 || // Lo [27] HANGUL SYLLABLE DDYEOG..HANGUL SYLLABLE DDYEOH - 0xB5F5 <= code && code <= 0xB60F || // Lo [27] HANGUL SYLLABLE DDYEG..HANGUL SYLLABLE DDYEH - 0xB611 <= code && code <= 0xB62B || // Lo [27] HANGUL SYLLABLE DDOG..HANGUL SYLLABLE DDOH - 0xB62D <= code && code <= 0xB647 || // Lo [27] HANGUL SYLLABLE DDWAG..HANGUL SYLLABLE DDWAH - 0xB649 <= code && code <= 0xB663 || // Lo [27] HANGUL SYLLABLE DDWAEG..HANGUL SYLLABLE DDWAEH - 0xB665 <= code && code <= 0xB67F || // Lo [27] HANGUL SYLLABLE DDOEG..HANGUL SYLLABLE DDOEH - 0xB681 <= code && code <= 0xB69B || // Lo [27] HANGUL SYLLABLE DDYOG..HANGUL SYLLABLE DDYOH - 0xB69D <= code && code <= 0xB6B7 || // Lo [27] HANGUL SYLLABLE DDUG..HANGUL SYLLABLE DDUH - 0xB6B9 <= code && code <= 0xB6D3 || // Lo [27] HANGUL SYLLABLE DDWEOG..HANGUL SYLLABLE DDWEOH - 0xB6D5 <= code && code <= 0xB6EF || // Lo [27] HANGUL SYLLABLE DDWEG..HANGUL SYLLABLE DDWEH - 0xB6F1 <= code && code <= 0xB70B || // Lo [27] HANGUL SYLLABLE DDWIG..HANGUL SYLLABLE DDWIH - 0xB70D <= code && code <= 0xB727 || // Lo [27] HANGUL SYLLABLE DDYUG..HANGUL SYLLABLE DDYUH - 0xB729 <= code && code <= 0xB743 || // Lo [27] HANGUL SYLLABLE DDEUG..HANGUL SYLLABLE DDEUH - 0xB745 <= code && code <= 0xB75F || // Lo [27] HANGUL SYLLABLE DDYIG..HANGUL SYLLABLE DDYIH - 0xB761 <= code && code <= 0xB77B || // Lo [27] HANGUL SYLLABLE DDIG..HANGUL SYLLABLE DDIH - 0xB77D <= code && code <= 0xB797 || // Lo [27] HANGUL SYLLABLE RAG..HANGUL SYLLABLE RAH - 0xB799 <= code && code <= 0xB7B3 || // Lo [27] HANGUL SYLLABLE RAEG..HANGUL SYLLABLE RAEH - 0xB7B5 <= code && code <= 0xB7CF || // Lo [27] HANGUL SYLLABLE RYAG..HANGUL SYLLABLE RYAH - 0xB7D1 <= code && code <= 0xB7EB || // Lo [27] HANGUL SYLLABLE RYAEG..HANGUL SYLLABLE RYAEH - 0xB7ED <= code && code <= 0xB807 || // Lo [27] HANGUL SYLLABLE REOG..HANGUL SYLLABLE REOH - 0xB809 <= code && code <= 0xB823 || // Lo [27] HANGUL SYLLABLE REG..HANGUL SYLLABLE REH - 0xB825 <= code && code <= 0xB83F || // Lo [27] HANGUL SYLLABLE RYEOG..HANGUL SYLLABLE RYEOH - 0xB841 <= code && code <= 0xB85B || // Lo [27] HANGUL SYLLABLE RYEG..HANGUL SYLLABLE RYEH - 0xB85D <= code && code <= 0xB877 || // Lo [27] HANGUL SYLLABLE ROG..HANGUL SYLLABLE ROH - 0xB879 <= code && code <= 0xB893 || // Lo [27] HANGUL SYLLABLE RWAG..HANGUL SYLLABLE RWAH - 0xB895 <= code && code <= 0xB8AF || // Lo [27] HANGUL SYLLABLE RWAEG..HANGUL SYLLABLE RWAEH - 0xB8B1 <= code && code <= 0xB8CB || // Lo [27] HANGUL SYLLABLE ROEG..HANGUL SYLLABLE ROEH - 0xB8CD <= code && code <= 0xB8E7 || // Lo [27] HANGUL SYLLABLE RYOG..HANGUL SYLLABLE RYOH - 0xB8E9 <= code && code <= 0xB903 || // Lo [27] HANGUL SYLLABLE RUG..HANGUL SYLLABLE RUH - 0xB905 <= code && code <= 0xB91F || // Lo [27] HANGUL SYLLABLE RWEOG..HANGUL SYLLABLE RWEOH - 0xB921 <= code && code <= 0xB93B || // Lo [27] HANGUL SYLLABLE RWEG..HANGUL SYLLABLE RWEH - 0xB93D <= code && code <= 0xB957 || // Lo [27] HANGUL SYLLABLE RWIG..HANGUL SYLLABLE RWIH - 0xB959 <= code && code <= 0xB973 || // Lo [27] HANGUL SYLLABLE RYUG..HANGUL SYLLABLE RYUH - 0xB975 <= code && code <= 0xB98F || // Lo [27] HANGUL SYLLABLE REUG..HANGUL SYLLABLE REUH - 0xB991 <= code && code <= 0xB9AB || // Lo [27] HANGUL SYLLABLE RYIG..HANGUL SYLLABLE RYIH - 0xB9AD <= code && code <= 0xB9C7 || // Lo [27] HANGUL SYLLABLE RIG..HANGUL SYLLABLE RIH - 0xB9C9 <= code && code <= 0xB9E3 || // Lo [27] HANGUL SYLLABLE MAG..HANGUL SYLLABLE MAH - 0xB9E5 <= code && code <= 0xB9FF || // Lo [27] HANGUL SYLLABLE MAEG..HANGUL SYLLABLE MAEH - 0xBA01 <= code && code <= 0xBA1B || // Lo [27] HANGUL SYLLABLE MYAG..HANGUL SYLLABLE MYAH - 0xBA1D <= code && code <= 0xBA37 || // Lo [27] HANGUL SYLLABLE MYAEG..HANGUL SYLLABLE MYAEH - 0xBA39 <= code && code <= 0xBA53 || // Lo [27] HANGUL SYLLABLE MEOG..HANGUL SYLLABLE MEOH - 0xBA55 <= code && code <= 0xBA6F || // Lo [27] HANGUL SYLLABLE MEG..HANGUL SYLLABLE MEH - 0xBA71 <= code && code <= 0xBA8B || // Lo [27] HANGUL SYLLABLE MYEOG..HANGUL SYLLABLE MYEOH - 0xBA8D <= code && code <= 0xBAA7 || // Lo [27] HANGUL SYLLABLE MYEG..HANGUL SYLLABLE MYEH - 0xBAA9 <= code && code <= 0xBAC3 || // Lo [27] HANGUL SYLLABLE MOG..HANGUL SYLLABLE MOH - 0xBAC5 <= code && code <= 0xBADF || // Lo [27] HANGUL SYLLABLE MWAG..HANGUL SYLLABLE MWAH - 0xBAE1 <= code && code <= 0xBAFB || // Lo [27] HANGUL SYLLABLE MWAEG..HANGUL SYLLABLE MWAEH - 0xBAFD <= code && code <= 0xBB17 || // Lo [27] HANGUL SYLLABLE MOEG..HANGUL SYLLABLE MOEH - 0xBB19 <= code && code <= 0xBB33 || // Lo [27] HANGUL SYLLABLE MYOG..HANGUL SYLLABLE MYOH - 0xBB35 <= code && code <= 0xBB4F || // Lo [27] HANGUL SYLLABLE MUG..HANGUL SYLLABLE MUH - 0xBB51 <= code && code <= 0xBB6B || // Lo [27] HANGUL SYLLABLE MWEOG..HANGUL SYLLABLE MWEOH - 0xBB6D <= code && code <= 0xBB87 || // Lo [27] HANGUL SYLLABLE MWEG..HANGUL SYLLABLE MWEH - 0xBB89 <= code && code <= 0xBBA3 || // Lo [27] HANGUL SYLLABLE MWIG..HANGUL SYLLABLE MWIH - 0xBBA5 <= code && code <= 0xBBBF || // Lo [27] HANGUL SYLLABLE MYUG..HANGUL SYLLABLE MYUH - 0xBBC1 <= code && code <= 0xBBDB || // Lo [27] HANGUL SYLLABLE MEUG..HANGUL SYLLABLE MEUH - 0xBBDD <= code && code <= 0xBBF7 || // Lo [27] HANGUL SYLLABLE MYIG..HANGUL SYLLABLE MYIH - 0xBBF9 <= code && code <= 0xBC13 || // Lo [27] HANGUL SYLLABLE MIG..HANGUL SYLLABLE MIH - 0xBC15 <= code && code <= 0xBC2F || // Lo [27] HANGUL SYLLABLE BAG..HANGUL SYLLABLE BAH - 0xBC31 <= code && code <= 0xBC4B || // Lo [27] HANGUL SYLLABLE BAEG..HANGUL SYLLABLE BAEH - 0xBC4D <= code && code <= 0xBC67 || // Lo [27] HANGUL SYLLABLE BYAG..HANGUL SYLLABLE BYAH - 0xBC69 <= code && code <= 0xBC83 || // Lo [27] HANGUL SYLLABLE BYAEG..HANGUL SYLLABLE BYAEH - 0xBC85 <= code && code <= 0xBC9F || // Lo [27] HANGUL SYLLABLE BEOG..HANGUL SYLLABLE BEOH - 0xBCA1 <= code && code <= 0xBCBB || // Lo [27] HANGUL SYLLABLE BEG..HANGUL SYLLABLE BEH - 0xBCBD <= code && code <= 0xBCD7 || // Lo [27] HANGUL SYLLABLE BYEOG..HANGUL SYLLABLE BYEOH - 0xBCD9 <= code && code <= 0xBCF3 || // Lo [27] HANGUL SYLLABLE BYEG..HANGUL SYLLABLE BYEH - 0xBCF5 <= code && code <= 0xBD0F || // Lo [27] HANGUL SYLLABLE BOG..HANGUL SYLLABLE BOH - 0xBD11 <= code && code <= 0xBD2B || // Lo [27] HANGUL SYLLABLE BWAG..HANGUL SYLLABLE BWAH - 0xBD2D <= code && code <= 0xBD47 || // Lo [27] HANGUL SYLLABLE BWAEG..HANGUL SYLLABLE BWAEH - 0xBD49 <= code && code <= 0xBD63 || // Lo [27] HANGUL SYLLABLE BOEG..HANGUL SYLLABLE BOEH - 0xBD65 <= code && code <= 0xBD7F || // Lo [27] HANGUL SYLLABLE BYOG..HANGUL SYLLABLE BYOH - 0xBD81 <= code && code <= 0xBD9B || // Lo [27] HANGUL SYLLABLE BUG..HANGUL SYLLABLE BUH - 0xBD9D <= code && code <= 0xBDB7 || // Lo [27] HANGUL SYLLABLE BWEOG..HANGUL SYLLABLE BWEOH - 0xBDB9 <= code && code <= 0xBDD3 || // Lo [27] HANGUL SYLLABLE BWEG..HANGUL SYLLABLE BWEH - 0xBDD5 <= code && code <= 0xBDEF || // Lo [27] HANGUL SYLLABLE BWIG..HANGUL SYLLABLE BWIH - 0xBDF1 <= code && code <= 0xBE0B || // Lo [27] HANGUL SYLLABLE BYUG..HANGUL SYLLABLE BYUH - 0xBE0D <= code && code <= 0xBE27 || // Lo [27] HANGUL SYLLABLE BEUG..HANGUL SYLLABLE BEUH - 0xBE29 <= code && code <= 0xBE43 || // Lo [27] HANGUL SYLLABLE BYIG..HANGUL SYLLABLE BYIH - 0xBE45 <= code && code <= 0xBE5F || // Lo [27] HANGUL SYLLABLE BIG..HANGUL SYLLABLE BIH - 0xBE61 <= code && code <= 0xBE7B || // Lo [27] HANGUL SYLLABLE BBAG..HANGUL SYLLABLE BBAH - 0xBE7D <= code && code <= 0xBE97 || // Lo [27] HANGUL SYLLABLE BBAEG..HANGUL SYLLABLE BBAEH - 0xBE99 <= code && code <= 0xBEB3 || // Lo [27] HANGUL SYLLABLE BBYAG..HANGUL SYLLABLE BBYAH - 0xBEB5 <= code && code <= 0xBECF || // Lo [27] HANGUL SYLLABLE BBYAEG..HANGUL SYLLABLE BBYAEH - 0xBED1 <= code && code <= 0xBEEB || // Lo [27] HANGUL SYLLABLE BBEOG..HANGUL SYLLABLE BBEOH - 0xBEED <= code && code <= 0xBF07 || // Lo [27] HANGUL SYLLABLE BBEG..HANGUL SYLLABLE BBEH - 0xBF09 <= code && code <= 0xBF23 || // Lo [27] HANGUL SYLLABLE BBYEOG..HANGUL SYLLABLE BBYEOH - 0xBF25 <= code && code <= 0xBF3F || // Lo [27] HANGUL SYLLABLE BBYEG..HANGUL SYLLABLE BBYEH - 0xBF41 <= code && code <= 0xBF5B || // Lo [27] HANGUL SYLLABLE BBOG..HANGUL SYLLABLE BBOH - 0xBF5D <= code && code <= 0xBF77 || // Lo [27] HANGUL SYLLABLE BBWAG..HANGUL SYLLABLE BBWAH - 0xBF79 <= code && code <= 0xBF93 || // Lo [27] HANGUL SYLLABLE BBWAEG..HANGUL SYLLABLE BBWAEH - 0xBF95 <= code && code <= 0xBFAF || // Lo [27] HANGUL SYLLABLE BBOEG..HANGUL SYLLABLE BBOEH - 0xBFB1 <= code && code <= 0xBFCB || // Lo [27] HANGUL SYLLABLE BBYOG..HANGUL SYLLABLE BBYOH - 0xBFCD <= code && code <= 0xBFE7 || // Lo [27] HANGUL SYLLABLE BBUG..HANGUL SYLLABLE BBUH - 0xBFE9 <= code && code <= 0xC003 || // Lo [27] HANGUL SYLLABLE BBWEOG..HANGUL SYLLABLE BBWEOH - 0xC005 <= code && code <= 0xC01F || // Lo [27] HANGUL SYLLABLE BBWEG..HANGUL SYLLABLE BBWEH - 0xC021 <= code && code <= 0xC03B || // Lo [27] HANGUL SYLLABLE BBWIG..HANGUL SYLLABLE BBWIH - 0xC03D <= code && code <= 0xC057 || // Lo [27] HANGUL SYLLABLE BBYUG..HANGUL SYLLABLE BBYUH - 0xC059 <= code && code <= 0xC073 || // Lo [27] HANGUL SYLLABLE BBEUG..HANGUL SYLLABLE BBEUH - 0xC075 <= code && code <= 0xC08F || // Lo [27] HANGUL SYLLABLE BBYIG..HANGUL SYLLABLE BBYIH - 0xC091 <= code && code <= 0xC0AB || // Lo [27] HANGUL SYLLABLE BBIG..HANGUL SYLLABLE BBIH - 0xC0AD <= code && code <= 0xC0C7 || // Lo [27] HANGUL SYLLABLE SAG..HANGUL SYLLABLE SAH - 0xC0C9 <= code && code <= 0xC0E3 || // Lo [27] HANGUL SYLLABLE SAEG..HANGUL SYLLABLE SAEH - 0xC0E5 <= code && code <= 0xC0FF || // Lo [27] HANGUL SYLLABLE SYAG..HANGUL SYLLABLE SYAH - 0xC101 <= code && code <= 0xC11B || // Lo [27] HANGUL SYLLABLE SYAEG..HANGUL SYLLABLE SYAEH - 0xC11D <= code && code <= 0xC137 || // Lo [27] HANGUL SYLLABLE SEOG..HANGUL SYLLABLE SEOH - 0xC139 <= code && code <= 0xC153 || // Lo [27] HANGUL SYLLABLE SEG..HANGUL SYLLABLE SEH - 0xC155 <= code && code <= 0xC16F || // Lo [27] HANGUL SYLLABLE SYEOG..HANGUL SYLLABLE SYEOH - 0xC171 <= code && code <= 0xC18B || // Lo [27] HANGUL SYLLABLE SYEG..HANGUL SYLLABLE SYEH - 0xC18D <= code && code <= 0xC1A7 || // Lo [27] HANGUL SYLLABLE SOG..HANGUL SYLLABLE SOH - 0xC1A9 <= code && code <= 0xC1C3 || // Lo [27] HANGUL SYLLABLE SWAG..HANGUL SYLLABLE SWAH - 0xC1C5 <= code && code <= 0xC1DF || // Lo [27] HANGUL SYLLABLE SWAEG..HANGUL SYLLABLE SWAEH - 0xC1E1 <= code && code <= 0xC1FB || // Lo [27] HANGUL SYLLABLE SOEG..HANGUL SYLLABLE SOEH - 0xC1FD <= code && code <= 0xC217 || // Lo [27] HANGUL SYLLABLE SYOG..HANGUL SYLLABLE SYOH - 0xC219 <= code && code <= 0xC233 || // Lo [27] HANGUL SYLLABLE SUG..HANGUL SYLLABLE SUH - 0xC235 <= code && code <= 0xC24F || // Lo [27] HANGUL SYLLABLE SWEOG..HANGUL SYLLABLE SWEOH - 0xC251 <= code && code <= 0xC26B || // Lo [27] HANGUL SYLLABLE SWEG..HANGUL SYLLABLE SWEH - 0xC26D <= code && code <= 0xC287 || // Lo [27] HANGUL SYLLABLE SWIG..HANGUL SYLLABLE SWIH - 0xC289 <= code && code <= 0xC2A3 || // Lo [27] HANGUL SYLLABLE SYUG..HANGUL SYLLABLE SYUH - 0xC2A5 <= code && code <= 0xC2BF || // Lo [27] HANGUL SYLLABLE SEUG..HANGUL SYLLABLE SEUH - 0xC2C1 <= code && code <= 0xC2DB || // Lo [27] HANGUL SYLLABLE SYIG..HANGUL SYLLABLE SYIH - 0xC2DD <= code && code <= 0xC2F7 || // Lo [27] HANGUL SYLLABLE SIG..HANGUL SYLLABLE SIH - 0xC2F9 <= code && code <= 0xC313 || // Lo [27] HANGUL SYLLABLE SSAG..HANGUL SYLLABLE SSAH - 0xC315 <= code && code <= 0xC32F || // Lo [27] HANGUL SYLLABLE SSAEG..HANGUL SYLLABLE SSAEH - 0xC331 <= code && code <= 0xC34B || // Lo [27] HANGUL SYLLABLE SSYAG..HANGUL SYLLABLE SSYAH - 0xC34D <= code && code <= 0xC367 || // Lo [27] HANGUL SYLLABLE SSYAEG..HANGUL SYLLABLE SSYAEH - 0xC369 <= code && code <= 0xC383 || // Lo [27] HANGUL SYLLABLE SSEOG..HANGUL SYLLABLE SSEOH - 0xC385 <= code && code <= 0xC39F || // Lo [27] HANGUL SYLLABLE SSEG..HANGUL SYLLABLE SSEH - 0xC3A1 <= code && code <= 0xC3BB || // Lo [27] HANGUL SYLLABLE SSYEOG..HANGUL SYLLABLE SSYEOH - 0xC3BD <= code && code <= 0xC3D7 || // Lo [27] HANGUL SYLLABLE SSYEG..HANGUL SYLLABLE SSYEH - 0xC3D9 <= code && code <= 0xC3F3 || // Lo [27] HANGUL SYLLABLE SSOG..HANGUL SYLLABLE SSOH - 0xC3F5 <= code && code <= 0xC40F || // Lo [27] HANGUL SYLLABLE SSWAG..HANGUL SYLLABLE SSWAH - 0xC411 <= code && code <= 0xC42B || // Lo [27] HANGUL SYLLABLE SSWAEG..HANGUL SYLLABLE SSWAEH - 0xC42D <= code && code <= 0xC447 || // Lo [27] HANGUL SYLLABLE SSOEG..HANGUL SYLLABLE SSOEH - 0xC449 <= code && code <= 0xC463 || // Lo [27] HANGUL SYLLABLE SSYOG..HANGUL SYLLABLE SSYOH - 0xC465 <= code && code <= 0xC47F || // Lo [27] HANGUL SYLLABLE SSUG..HANGUL SYLLABLE SSUH - 0xC481 <= code && code <= 0xC49B || // Lo [27] HANGUL SYLLABLE SSWEOG..HANGUL SYLLABLE SSWEOH - 0xC49D <= code && code <= 0xC4B7 || // Lo [27] HANGUL SYLLABLE SSWEG..HANGUL SYLLABLE SSWEH - 0xC4B9 <= code && code <= 0xC4D3 || // Lo [27] HANGUL SYLLABLE SSWIG..HANGUL SYLLABLE SSWIH - 0xC4D5 <= code && code <= 0xC4EF || // Lo [27] HANGUL SYLLABLE SSYUG..HANGUL SYLLABLE SSYUH - 0xC4F1 <= code && code <= 0xC50B || // Lo [27] HANGUL SYLLABLE SSEUG..HANGUL SYLLABLE SSEUH - 0xC50D <= code && code <= 0xC527 || // Lo [27] HANGUL SYLLABLE SSYIG..HANGUL SYLLABLE SSYIH - 0xC529 <= code && code <= 0xC543 || // Lo [27] HANGUL SYLLABLE SSIG..HANGUL SYLLABLE SSIH - 0xC545 <= code && code <= 0xC55F || // Lo [27] HANGUL SYLLABLE AG..HANGUL SYLLABLE AH - 0xC561 <= code && code <= 0xC57B || // Lo [27] HANGUL SYLLABLE AEG..HANGUL SYLLABLE AEH - 0xC57D <= code && code <= 0xC597 || // Lo [27] HANGUL SYLLABLE YAG..HANGUL SYLLABLE YAH - 0xC599 <= code && code <= 0xC5B3 || // Lo [27] HANGUL SYLLABLE YAEG..HANGUL SYLLABLE YAEH - 0xC5B5 <= code && code <= 0xC5CF || // Lo [27] HANGUL SYLLABLE EOG..HANGUL SYLLABLE EOH - 0xC5D1 <= code && code <= 0xC5EB || // Lo [27] HANGUL SYLLABLE EG..HANGUL SYLLABLE EH - 0xC5ED <= code && code <= 0xC607 || // Lo [27] HANGUL SYLLABLE YEOG..HANGUL SYLLABLE YEOH - 0xC609 <= code && code <= 0xC623 || // Lo [27] HANGUL SYLLABLE YEG..HANGUL SYLLABLE YEH - 0xC625 <= code && code <= 0xC63F || // Lo [27] HANGUL SYLLABLE OG..HANGUL SYLLABLE OH - 0xC641 <= code && code <= 0xC65B || // Lo [27] HANGUL SYLLABLE WAG..HANGUL SYLLABLE WAH - 0xC65D <= code && code <= 0xC677 || // Lo [27] HANGUL SYLLABLE WAEG..HANGUL SYLLABLE WAEH - 0xC679 <= code && code <= 0xC693 || // Lo [27] HANGUL SYLLABLE OEG..HANGUL SYLLABLE OEH - 0xC695 <= code && code <= 0xC6AF || // Lo [27] HANGUL SYLLABLE YOG..HANGUL SYLLABLE YOH - 0xC6B1 <= code && code <= 0xC6CB || // Lo [27] HANGUL SYLLABLE UG..HANGUL SYLLABLE UH - 0xC6CD <= code && code <= 0xC6E7 || // Lo [27] HANGUL SYLLABLE WEOG..HANGUL SYLLABLE WEOH - 0xC6E9 <= code && code <= 0xC703 || // Lo [27] HANGUL SYLLABLE WEG..HANGUL SYLLABLE WEH - 0xC705 <= code && code <= 0xC71F || // Lo [27] HANGUL SYLLABLE WIG..HANGUL SYLLABLE WIH - 0xC721 <= code && code <= 0xC73B || // Lo [27] HANGUL SYLLABLE YUG..HANGUL SYLLABLE YUH - 0xC73D <= code && code <= 0xC757 || // Lo [27] HANGUL SYLLABLE EUG..HANGUL SYLLABLE EUH - 0xC759 <= code && code <= 0xC773 || // Lo [27] HANGUL SYLLABLE YIG..HANGUL SYLLABLE YIH - 0xC775 <= code && code <= 0xC78F || // Lo [27] HANGUL SYLLABLE IG..HANGUL SYLLABLE IH - 0xC791 <= code && code <= 0xC7AB || // Lo [27] HANGUL SYLLABLE JAG..HANGUL SYLLABLE JAH - 0xC7AD <= code && code <= 0xC7C7 || // Lo [27] HANGUL SYLLABLE JAEG..HANGUL SYLLABLE JAEH - 0xC7C9 <= code && code <= 0xC7E3 || // Lo [27] HANGUL SYLLABLE JYAG..HANGUL SYLLABLE JYAH - 0xC7E5 <= code && code <= 0xC7FF || // Lo [27] HANGUL SYLLABLE JYAEG..HANGUL SYLLABLE JYAEH - 0xC801 <= code && code <= 0xC81B || // Lo [27] HANGUL SYLLABLE JEOG..HANGUL SYLLABLE JEOH - 0xC81D <= code && code <= 0xC837 || // Lo [27] HANGUL SYLLABLE JEG..HANGUL SYLLABLE JEH - 0xC839 <= code && code <= 0xC853 || // Lo [27] HANGUL SYLLABLE JYEOG..HANGUL SYLLABLE JYEOH - 0xC855 <= code && code <= 0xC86F || // Lo [27] HANGUL SYLLABLE JYEG..HANGUL SYLLABLE JYEH - 0xC871 <= code && code <= 0xC88B || // Lo [27] HANGUL SYLLABLE JOG..HANGUL SYLLABLE JOH - 0xC88D <= code && code <= 0xC8A7 || // Lo [27] HANGUL SYLLABLE JWAG..HANGUL SYLLABLE JWAH - 0xC8A9 <= code && code <= 0xC8C3 || // Lo [27] HANGUL SYLLABLE JWAEG..HANGUL SYLLABLE JWAEH - 0xC8C5 <= code && code <= 0xC8DF || // Lo [27] HANGUL SYLLABLE JOEG..HANGUL SYLLABLE JOEH - 0xC8E1 <= code && code <= 0xC8FB || // Lo [27] HANGUL SYLLABLE JYOG..HANGUL SYLLABLE JYOH - 0xC8FD <= code && code <= 0xC917 || // Lo [27] HANGUL SYLLABLE JUG..HANGUL SYLLABLE JUH - 0xC919 <= code && code <= 0xC933 || // Lo [27] HANGUL SYLLABLE JWEOG..HANGUL SYLLABLE JWEOH - 0xC935 <= code && code <= 0xC94F || // Lo [27] HANGUL SYLLABLE JWEG..HANGUL SYLLABLE JWEH - 0xC951 <= code && code <= 0xC96B || // Lo [27] HANGUL SYLLABLE JWIG..HANGUL SYLLABLE JWIH - 0xC96D <= code && code <= 0xC987 || // Lo [27] HANGUL SYLLABLE JYUG..HANGUL SYLLABLE JYUH - 0xC989 <= code && code <= 0xC9A3 || // Lo [27] HANGUL SYLLABLE JEUG..HANGUL SYLLABLE JEUH - 0xC9A5 <= code && code <= 0xC9BF || // Lo [27] HANGUL SYLLABLE JYIG..HANGUL SYLLABLE JYIH - 0xC9C1 <= code && code <= 0xC9DB || // Lo [27] HANGUL SYLLABLE JIG..HANGUL SYLLABLE JIH - 0xC9DD <= code && code <= 0xC9F7 || // Lo [27] HANGUL SYLLABLE JJAG..HANGUL SYLLABLE JJAH - 0xC9F9 <= code && code <= 0xCA13 || // Lo [27] HANGUL SYLLABLE JJAEG..HANGUL SYLLABLE JJAEH - 0xCA15 <= code && code <= 0xCA2F || // Lo [27] HANGUL SYLLABLE JJYAG..HANGUL SYLLABLE JJYAH - 0xCA31 <= code && code <= 0xCA4B || // Lo [27] HANGUL SYLLABLE JJYAEG..HANGUL SYLLABLE JJYAEH - 0xCA4D <= code && code <= 0xCA67 || // Lo [27] HANGUL SYLLABLE JJEOG..HANGUL SYLLABLE JJEOH - 0xCA69 <= code && code <= 0xCA83 || // Lo [27] HANGUL SYLLABLE JJEG..HANGUL SYLLABLE JJEH - 0xCA85 <= code && code <= 0xCA9F || // Lo [27] HANGUL SYLLABLE JJYEOG..HANGUL SYLLABLE JJYEOH - 0xCAA1 <= code && code <= 0xCABB || // Lo [27] HANGUL SYLLABLE JJYEG..HANGUL SYLLABLE JJYEH - 0xCABD <= code && code <= 0xCAD7 || // Lo [27] HANGUL SYLLABLE JJOG..HANGUL SYLLABLE JJOH - 0xCAD9 <= code && code <= 0xCAF3 || // Lo [27] HANGUL SYLLABLE JJWAG..HANGUL SYLLABLE JJWAH - 0xCAF5 <= code && code <= 0xCB0F || // Lo [27] HANGUL SYLLABLE JJWAEG..HANGUL SYLLABLE JJWAEH - 0xCB11 <= code && code <= 0xCB2B || // Lo [27] HANGUL SYLLABLE JJOEG..HANGUL SYLLABLE JJOEH - 0xCB2D <= code && code <= 0xCB47 || // Lo [27] HANGUL SYLLABLE JJYOG..HANGUL SYLLABLE JJYOH - 0xCB49 <= code && code <= 0xCB63 || // Lo [27] HANGUL SYLLABLE JJUG..HANGUL SYLLABLE JJUH - 0xCB65 <= code && code <= 0xCB7F || // Lo [27] HANGUL SYLLABLE JJWEOG..HANGUL SYLLABLE JJWEOH - 0xCB81 <= code && code <= 0xCB9B || // Lo [27] HANGUL SYLLABLE JJWEG..HANGUL SYLLABLE JJWEH - 0xCB9D <= code && code <= 0xCBB7 || // Lo [27] HANGUL SYLLABLE JJWIG..HANGUL SYLLABLE JJWIH - 0xCBB9 <= code && code <= 0xCBD3 || // Lo [27] HANGUL SYLLABLE JJYUG..HANGUL SYLLABLE JJYUH - 0xCBD5 <= code && code <= 0xCBEF || // Lo [27] HANGUL SYLLABLE JJEUG..HANGUL SYLLABLE JJEUH - 0xCBF1 <= code && code <= 0xCC0B || // Lo [27] HANGUL SYLLABLE JJYIG..HANGUL SYLLABLE JJYIH - 0xCC0D <= code && code <= 0xCC27 || // Lo [27] HANGUL SYLLABLE JJIG..HANGUL SYLLABLE JJIH - 0xCC29 <= code && code <= 0xCC43 || // Lo [27] HANGUL SYLLABLE CAG..HANGUL SYLLABLE CAH - 0xCC45 <= code && code <= 0xCC5F || // Lo [27] HANGUL SYLLABLE CAEG..HANGUL SYLLABLE CAEH - 0xCC61 <= code && code <= 0xCC7B || // Lo [27] HANGUL SYLLABLE CYAG..HANGUL SYLLABLE CYAH - 0xCC7D <= code && code <= 0xCC97 || // Lo [27] HANGUL SYLLABLE CYAEG..HANGUL SYLLABLE CYAEH - 0xCC99 <= code && code <= 0xCCB3 || // Lo [27] HANGUL SYLLABLE CEOG..HANGUL SYLLABLE CEOH - 0xCCB5 <= code && code <= 0xCCCF || // Lo [27] HANGUL SYLLABLE CEG..HANGUL SYLLABLE CEH - 0xCCD1 <= code && code <= 0xCCEB || // Lo [27] HANGUL SYLLABLE CYEOG..HANGUL SYLLABLE CYEOH - 0xCCED <= code && code <= 0xCD07 || // Lo [27] HANGUL SYLLABLE CYEG..HANGUL SYLLABLE CYEH - 0xCD09 <= code && code <= 0xCD23 || // Lo [27] HANGUL SYLLABLE COG..HANGUL SYLLABLE COH - 0xCD25 <= code && code <= 0xCD3F || // Lo [27] HANGUL SYLLABLE CWAG..HANGUL SYLLABLE CWAH - 0xCD41 <= code && code <= 0xCD5B || // Lo [27] HANGUL SYLLABLE CWAEG..HANGUL SYLLABLE CWAEH - 0xCD5D <= code && code <= 0xCD77 || // Lo [27] HANGUL SYLLABLE COEG..HANGUL SYLLABLE COEH - 0xCD79 <= code && code <= 0xCD93 || // Lo [27] HANGUL SYLLABLE CYOG..HANGUL SYLLABLE CYOH - 0xCD95 <= code && code <= 0xCDAF || // Lo [27] HANGUL SYLLABLE CUG..HANGUL SYLLABLE CUH - 0xCDB1 <= code && code <= 0xCDCB || // Lo [27] HANGUL SYLLABLE CWEOG..HANGUL SYLLABLE CWEOH - 0xCDCD <= code && code <= 0xCDE7 || // Lo [27] HANGUL SYLLABLE CWEG..HANGUL SYLLABLE CWEH - 0xCDE9 <= code && code <= 0xCE03 || // Lo [27] HANGUL SYLLABLE CWIG..HANGUL SYLLABLE CWIH - 0xCE05 <= code && code <= 0xCE1F || // Lo [27] HANGUL SYLLABLE CYUG..HANGUL SYLLABLE CYUH - 0xCE21 <= code && code <= 0xCE3B || // Lo [27] HANGUL SYLLABLE CEUG..HANGUL SYLLABLE CEUH - 0xCE3D <= code && code <= 0xCE57 || // Lo [27] HANGUL SYLLABLE CYIG..HANGUL SYLLABLE CYIH - 0xCE59 <= code && code <= 0xCE73 || // Lo [27] HANGUL SYLLABLE CIG..HANGUL SYLLABLE CIH - 0xCE75 <= code && code <= 0xCE8F || // Lo [27] HANGUL SYLLABLE KAG..HANGUL SYLLABLE KAH - 0xCE91 <= code && code <= 0xCEAB || // Lo [27] HANGUL SYLLABLE KAEG..HANGUL SYLLABLE KAEH - 0xCEAD <= code && code <= 0xCEC7 || // Lo [27] HANGUL SYLLABLE KYAG..HANGUL SYLLABLE KYAH - 0xCEC9 <= code && code <= 0xCEE3 || // Lo [27] HANGUL SYLLABLE KYAEG..HANGUL SYLLABLE KYAEH - 0xCEE5 <= code && code <= 0xCEFF || // Lo [27] HANGUL SYLLABLE KEOG..HANGUL SYLLABLE KEOH - 0xCF01 <= code && code <= 0xCF1B || // Lo [27] HANGUL SYLLABLE KEG..HANGUL SYLLABLE KEH - 0xCF1D <= code && code <= 0xCF37 || // Lo [27] HANGUL SYLLABLE KYEOG..HANGUL SYLLABLE KYEOH - 0xCF39 <= code && code <= 0xCF53 || // Lo [27] HANGUL SYLLABLE KYEG..HANGUL SYLLABLE KYEH - 0xCF55 <= code && code <= 0xCF6F || // Lo [27] HANGUL SYLLABLE KOG..HANGUL SYLLABLE KOH - 0xCF71 <= code && code <= 0xCF8B || // Lo [27] HANGUL SYLLABLE KWAG..HANGUL SYLLABLE KWAH - 0xCF8D <= code && code <= 0xCFA7 || // Lo [27] HANGUL SYLLABLE KWAEG..HANGUL SYLLABLE KWAEH - 0xCFA9 <= code && code <= 0xCFC3 || // Lo [27] HANGUL SYLLABLE KOEG..HANGUL SYLLABLE KOEH - 0xCFC5 <= code && code <= 0xCFDF || // Lo [27] HANGUL SYLLABLE KYOG..HANGUL SYLLABLE KYOH - 0xCFE1 <= code && code <= 0xCFFB || // Lo [27] HANGUL SYLLABLE KUG..HANGUL SYLLABLE KUH - 0xCFFD <= code && code <= 0xD017 || // Lo [27] HANGUL SYLLABLE KWEOG..HANGUL SYLLABLE KWEOH - 0xD019 <= code && code <= 0xD033 || // Lo [27] HANGUL SYLLABLE KWEG..HANGUL SYLLABLE KWEH - 0xD035 <= code && code <= 0xD04F || // Lo [27] HANGUL SYLLABLE KWIG..HANGUL SYLLABLE KWIH - 0xD051 <= code && code <= 0xD06B || // Lo [27] HANGUL SYLLABLE KYUG..HANGUL SYLLABLE KYUH - 0xD06D <= code && code <= 0xD087 || // Lo [27] HANGUL SYLLABLE KEUG..HANGUL SYLLABLE KEUH - 0xD089 <= code && code <= 0xD0A3 || // Lo [27] HANGUL SYLLABLE KYIG..HANGUL SYLLABLE KYIH - 0xD0A5 <= code && code <= 0xD0BF || // Lo [27] HANGUL SYLLABLE KIG..HANGUL SYLLABLE KIH - 0xD0C1 <= code && code <= 0xD0DB || // Lo [27] HANGUL SYLLABLE TAG..HANGUL SYLLABLE TAH - 0xD0DD <= code && code <= 0xD0F7 || // Lo [27] HANGUL SYLLABLE TAEG..HANGUL SYLLABLE TAEH - 0xD0F9 <= code && code <= 0xD113 || // Lo [27] HANGUL SYLLABLE TYAG..HANGUL SYLLABLE TYAH - 0xD115 <= code && code <= 0xD12F || // Lo [27] HANGUL SYLLABLE TYAEG..HANGUL SYLLABLE TYAEH - 0xD131 <= code && code <= 0xD14B || // Lo [27] HANGUL SYLLABLE TEOG..HANGUL SYLLABLE TEOH - 0xD14D <= code && code <= 0xD167 || // Lo [27] HANGUL SYLLABLE TEG..HANGUL SYLLABLE TEH - 0xD169 <= code && code <= 0xD183 || // Lo [27] HANGUL SYLLABLE TYEOG..HANGUL SYLLABLE TYEOH - 0xD185 <= code && code <= 0xD19F || // Lo [27] HANGUL SYLLABLE TYEG..HANGUL SYLLABLE TYEH - 0xD1A1 <= code && code <= 0xD1BB || // Lo [27] HANGUL SYLLABLE TOG..HANGUL SYLLABLE TOH - 0xD1BD <= code && code <= 0xD1D7 || // Lo [27] HANGUL SYLLABLE TWAG..HANGUL SYLLABLE TWAH - 0xD1D9 <= code && code <= 0xD1F3 || // Lo [27] HANGUL SYLLABLE TWAEG..HANGUL SYLLABLE TWAEH - 0xD1F5 <= code && code <= 0xD20F || // Lo [27] HANGUL SYLLABLE TOEG..HANGUL SYLLABLE TOEH - 0xD211 <= code && code <= 0xD22B || // Lo [27] HANGUL SYLLABLE TYOG..HANGUL SYLLABLE TYOH - 0xD22D <= code && code <= 0xD247 || // Lo [27] HANGUL SYLLABLE TUG..HANGUL SYLLABLE TUH - 0xD249 <= code && code <= 0xD263 || // Lo [27] HANGUL SYLLABLE TWEOG..HANGUL SYLLABLE TWEOH - 0xD265 <= code && code <= 0xD27F || // Lo [27] HANGUL SYLLABLE TWEG..HANGUL SYLLABLE TWEH - 0xD281 <= code && code <= 0xD29B || // Lo [27] HANGUL SYLLABLE TWIG..HANGUL SYLLABLE TWIH - 0xD29D <= code && code <= 0xD2B7 || // Lo [27] HANGUL SYLLABLE TYUG..HANGUL SYLLABLE TYUH - 0xD2B9 <= code && code <= 0xD2D3 || // Lo [27] HANGUL SYLLABLE TEUG..HANGUL SYLLABLE TEUH - 0xD2D5 <= code && code <= 0xD2EF || // Lo [27] HANGUL SYLLABLE TYIG..HANGUL SYLLABLE TYIH - 0xD2F1 <= code && code <= 0xD30B || // Lo [27] HANGUL SYLLABLE TIG..HANGUL SYLLABLE TIH - 0xD30D <= code && code <= 0xD327 || // Lo [27] HANGUL SYLLABLE PAG..HANGUL SYLLABLE PAH - 0xD329 <= code && code <= 0xD343 || // Lo [27] HANGUL SYLLABLE PAEG..HANGUL SYLLABLE PAEH - 0xD345 <= code && code <= 0xD35F || // Lo [27] HANGUL SYLLABLE PYAG..HANGUL SYLLABLE PYAH - 0xD361 <= code && code <= 0xD37B || // Lo [27] HANGUL SYLLABLE PYAEG..HANGUL SYLLABLE PYAEH - 0xD37D <= code && code <= 0xD397 || // Lo [27] HANGUL SYLLABLE PEOG..HANGUL SYLLABLE PEOH - 0xD399 <= code && code <= 0xD3B3 || // Lo [27] HANGUL SYLLABLE PEG..HANGUL SYLLABLE PEH - 0xD3B5 <= code && code <= 0xD3CF || // Lo [27] HANGUL SYLLABLE PYEOG..HANGUL SYLLABLE PYEOH - 0xD3D1 <= code && code <= 0xD3EB || // Lo [27] HANGUL SYLLABLE PYEG..HANGUL SYLLABLE PYEH - 0xD3ED <= code && code <= 0xD407 || // Lo [27] HANGUL SYLLABLE POG..HANGUL SYLLABLE POH - 0xD409 <= code && code <= 0xD423 || // Lo [27] HANGUL SYLLABLE PWAG..HANGUL SYLLABLE PWAH - 0xD425 <= code && code <= 0xD43F || // Lo [27] HANGUL SYLLABLE PWAEG..HANGUL SYLLABLE PWAEH - 0xD441 <= code && code <= 0xD45B || // Lo [27] HANGUL SYLLABLE POEG..HANGUL SYLLABLE POEH - 0xD45D <= code && code <= 0xD477 || // Lo [27] HANGUL SYLLABLE PYOG..HANGUL SYLLABLE PYOH - 0xD479 <= code && code <= 0xD493 || // Lo [27] HANGUL SYLLABLE PUG..HANGUL SYLLABLE PUH - 0xD495 <= code && code <= 0xD4AF || // Lo [27] HANGUL SYLLABLE PWEOG..HANGUL SYLLABLE PWEOH - 0xD4B1 <= code && code <= 0xD4CB || // Lo [27] HANGUL SYLLABLE PWEG..HANGUL SYLLABLE PWEH - 0xD4CD <= code && code <= 0xD4E7 || // Lo [27] HANGUL SYLLABLE PWIG..HANGUL SYLLABLE PWIH - 0xD4E9 <= code && code <= 0xD503 || // Lo [27] HANGUL SYLLABLE PYUG..HANGUL SYLLABLE PYUH - 0xD505 <= code && code <= 0xD51F || // Lo [27] HANGUL SYLLABLE PEUG..HANGUL SYLLABLE PEUH - 0xD521 <= code && code <= 0xD53B || // Lo [27] HANGUL SYLLABLE PYIG..HANGUL SYLLABLE PYIH - 0xD53D <= code && code <= 0xD557 || // Lo [27] HANGUL SYLLABLE PIG..HANGUL SYLLABLE PIH - 0xD559 <= code && code <= 0xD573 || // Lo [27] HANGUL SYLLABLE HAG..HANGUL SYLLABLE HAH - 0xD575 <= code && code <= 0xD58F || // Lo [27] HANGUL SYLLABLE HAEG..HANGUL SYLLABLE HAEH - 0xD591 <= code && code <= 0xD5AB || // Lo [27] HANGUL SYLLABLE HYAG..HANGUL SYLLABLE HYAH - 0xD5AD <= code && code <= 0xD5C7 || // Lo [27] HANGUL SYLLABLE HYAEG..HANGUL SYLLABLE HYAEH - 0xD5C9 <= code && code <= 0xD5E3 || // Lo [27] HANGUL SYLLABLE HEOG..HANGUL SYLLABLE HEOH - 0xD5E5 <= code && code <= 0xD5FF || // Lo [27] HANGUL SYLLABLE HEG..HANGUL SYLLABLE HEH - 0xD601 <= code && code <= 0xD61B || // Lo [27] HANGUL SYLLABLE HYEOG..HANGUL SYLLABLE HYEOH - 0xD61D <= code && code <= 0xD637 || // Lo [27] HANGUL SYLLABLE HYEG..HANGUL SYLLABLE HYEH - 0xD639 <= code && code <= 0xD653 || // Lo [27] HANGUL SYLLABLE HOG..HANGUL SYLLABLE HOH - 0xD655 <= code && code <= 0xD66F || // Lo [27] HANGUL SYLLABLE HWAG..HANGUL SYLLABLE HWAH - 0xD671 <= code && code <= 0xD68B || // Lo [27] HANGUL SYLLABLE HWAEG..HANGUL SYLLABLE HWAEH - 0xD68D <= code && code <= 0xD6A7 || // Lo [27] HANGUL SYLLABLE HOEG..HANGUL SYLLABLE HOEH - 0xD6A9 <= code && code <= 0xD6C3 || // Lo [27] HANGUL SYLLABLE HYOG..HANGUL SYLLABLE HYOH - 0xD6C5 <= code && code <= 0xD6DF || // Lo [27] HANGUL SYLLABLE HUG..HANGUL SYLLABLE HUH - 0xD6E1 <= code && code <= 0xD6FB || // Lo [27] HANGUL SYLLABLE HWEOG..HANGUL SYLLABLE HWEOH - 0xD6FD <= code && code <= 0xD717 || // Lo [27] HANGUL SYLLABLE HWEG..HANGUL SYLLABLE HWEH - 0xD719 <= code && code <= 0xD733 || // Lo [27] HANGUL SYLLABLE HWIG..HANGUL SYLLABLE HWIH - 0xD735 <= code && code <= 0xD74F || // Lo [27] HANGUL SYLLABLE HYUG..HANGUL SYLLABLE HYUH - 0xD751 <= code && code <= 0xD76B || // Lo [27] HANGUL SYLLABLE HEUG..HANGUL SYLLABLE HEUH - 0xD76D <= code && code <= 0xD787 || // Lo [27] HANGUL SYLLABLE HYIG..HANGUL SYLLABLE HYIH - 0xD789 <= code && code <= 0xD7A3 // Lo [27] HANGUL SYLLABLE HIG..HANGUL SYLLABLE HIH - ) { - return LVT; - } - - if (0x261D == code || // So WHITE UP POINTING INDEX - 0x26F9 == code || // So PERSON WITH BALL - 0x270A <= code && code <= 0x270D || // So [4] RAISED FIST..WRITING HAND - 0x1F385 == code || // So FATHER CHRISTMAS - 0x1F3C2 <= code && code <= 0x1F3C4 || // So [3] SNOWBOARDER..SURFER - 0x1F3C7 == code || // So HORSE RACING - 0x1F3CA <= code && code <= 0x1F3CC || // So [3] SWIMMER..GOLFER - 0x1F442 <= code && code <= 0x1F443 || // So [2] EAR..NOSE - 0x1F446 <= code && code <= 0x1F450 || // So [11] WHITE UP POINTING BACKHAND INDEX..OPEN HANDS SIGN - 0x1F46E == code || // So POLICE OFFICER - 0x1F470 <= code && code <= 0x1F478 || // So [9] BRIDE WITH VEIL..PRINCESS - 0x1F47C == code || // So BABY ANGEL - 0x1F481 <= code && code <= 0x1F483 || // So [3] INFORMATION DESK PERSON..DANCER - 0x1F485 <= code && code <= 0x1F487 || // So [3] NAIL POLISH..HAIRCUT - 0x1F4AA == code || // So FLEXED BICEPS - 0x1F574 <= code && code <= 0x1F575 || // So [2] MAN IN BUSINESS SUIT LEVITATING..SLEUTH OR SPY - 0x1F57A == code || // So MAN DANCING - 0x1F590 == code || // So RAISED HAND WITH FINGERS SPLAYED - 0x1F595 <= code && code <= 0x1F596 || // So [2] REVERSED HAND WITH MIDDLE FINGER EXTENDED..RAISED HAND WITH PART BETWEEN MIDDLE AND RING FINGERS - 0x1F645 <= code && code <= 0x1F647 || // So [3] FACE WITH NO GOOD GESTURE..PERSON BOWING DEEPLY - 0x1F64B <= code && code <= 0x1F64F || // So [5] HAPPY PERSON RAISING ONE HAND..PERSON WITH FOLDED HANDS - 0x1F6A3 == code || // So ROWBOAT - 0x1F6B4 <= code && code <= 0x1F6B6 || // So [3] BICYCLIST..PEDESTRIAN - 0x1F6C0 == code || // So BATH - 0x1F6CC == code || // So SLEEPING ACCOMMODATION - 0x1F918 <= code && code <= 0x1F91C || // So [5] SIGN OF THE HORNS..RIGHT-FACING FIST - 0x1F91E <= code && code <= 0x1F91F || // So [2] HAND WITH INDEX AND MIDDLE FINGERS CROSSED..I LOVE YOU HAND SIGN - 0x1F926 == code || // So FACE PALM - 0x1F930 <= code && code <= 0x1F939 || // So [10] PREGNANT WOMAN..JUGGLING - 0x1F93D <= code && code <= 0x1F93E || // So [2] WATER POLO..HANDBALL - 0x1F9D1 <= code && code <= 0x1F9DD // So [13] ADULT..ELF - ) { - return E_Base; - } - - if (0x1F3FB <= code && code <= 0x1F3FF // Sk [5] EMOJI MODIFIER FITZPATRICK TYPE-1-2..EMOJI MODIFIER FITZPATRICK TYPE-6 - ) { - return E_Modifier; - } - - if (0x200D == code // Cf ZERO WIDTH JOINER - ) { - return ZWJ; - } - - if (0x2640 == code || // So FEMALE SIGN - 0x2642 == code || // So MALE SIGN - 0x2695 <= code && code <= 0x2696 || // So [2] STAFF OF AESCULAPIUS..SCALES - 0x2708 == code || // So AIRPLANE - 0x2764 == code || // So HEAVY BLACK HEART - 0x1F308 == code || // So RAINBOW - 0x1F33E == code || // So EAR OF RICE - 0x1F373 == code || // So COOKING - 0x1F393 == code || // So GRADUATION CAP - 0x1F3A4 == code || // So MICROPHONE - 0x1F3A8 == code || // So ARTIST PALETTE - 0x1F3EB == code || // So SCHOOL - 0x1F3ED == code || // So FACTORY - 0x1F48B == code || // So KISS MARK - 0x1F4BB <= code && code <= 0x1F4BC || // So [2] PERSONAL COMPUTER..BRIEFCASE - 0x1F527 == code || // So WRENCH - 0x1F52C == code || // So MICROSCOPE - 0x1F5E8 == code || // So LEFT SPEECH BUBBLE - 0x1F680 == code || // So ROCKET - 0x1F692 == code // So FIRE ENGINE - ) { - return Glue_After_Zwj; - } - - if (0x1F466 <= code && code <= 0x1F469 // So [4] BOY..WOMAN - ) { - return E_Base_GAZ; - } //all unlisted characters have a grapheme break property of "Other" - - - return Other; - } - - return this; -} - -if ( true && module.exports) { - module.exports = GraphemeSplitter; -} - -/***/ }), -/* 699 */ +/* 705 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -82602,16 +71544,19 @@ if ( true && module.exports) { * @fileoverview Rule to enforce spacing before and after keywords. * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639), + keywords = __webpack_require__(679); -const astUtils = __webpack_require__(618), - keywords = __webpack_require__(653); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Constants //------------------------------------------------------------------------------ - const PREV_TOKEN = /^[)\]}>]$/u; const NEXT_TOKEN = /^(?:[([{<~!]|\+\+?|--?)$/u; const PREV_TOKEN_M = /^[)\]}>*]$/u; @@ -82619,17 +71564,19 @@ const NEXT_TOKEN_M = /^[{*]$/u; const TEMPLATE_OPEN_PAREN = /\$\{$/u; const TEMPLATE_CLOSE_PAREN = /^\}/u; const CHECK_TYPE = /^(?:JSXElement|RegularExpression|String|Template|PrivateIdentifier)$/u; -const KEYS = keywords.concat(["as", "async", "await", "from", "get", "let", "of", "set", "yield"]); // check duplications. +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 //------------------------------------------------------------------------------ @@ -82638,34 +71585,31 @@ const KEYS = keywords.concat(["as", "async", "await", "from", "get", "let", "of" * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent spacing before and after keywords", recommended: false, - url: "https://eslint.org/docs/rules/keyword-spacing" + url: "https://eslint.org/docs/latest/rules/keyword-spacing" }, fixable: "whitespace", schema: [{ @@ -82708,44 +71652,38 @@ module.exports = { unexpectedAfter: "Unexpected space(s) after \"{{value}}\"." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const tokensToIgnore = new WeakSet(); + /** * 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) && !tokensToIgnore.has(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) && !tokensToIgnore.has(prevToken) && astUtils.isTokenOnSameLine(prevToken, token) && sourceCode.isSpaceBetweenTokens(prevToken, token)) { context.report({ loc: { @@ -82754,49 +71692,41 @@ module.exports = { }, 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) && !tokensToIgnore.has(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) && !tokensToIgnore.has(nextToken) && astUtils.isTokenOnSameLine(token, nextToken) && sourceCode.isSpaceBetweenTokens(token, nextToken)) { context.report({ loc: { @@ -82805,14 +71735,13 @@ module.exports = { }, 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. @@ -82820,8 +71749,6 @@ module.exports = { * Keys are keywords (there are for every keyword). * Values are instances of `{"before": function, "after": function}`. */ - - function parseOptions() { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; const before = options.before !== false; @@ -82832,11 +71759,9 @@ module.exports = { }; 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; @@ -82848,11 +71773,10 @@ module.exports = { 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. @@ -82861,10 +71785,10 @@ module.exports = { * 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. @@ -82873,37 +71797,33 @@ module.exports = { * 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. @@ -82913,120 +71833,106 @@ module.exports = { * @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); const inToken = sourceCode.getTokenBefore(node.right, astUtils.isNotOpeningParenToken); const previousToken = sourceCode.getTokenBefore(inToken); - if (previousToken.type !== "PrivateIdentifier") { checkSpacingBefore(inToken); } - checkSpacingAfter(inToken); } + /** * 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)); @@ -83034,16 +71940,14 @@ module.exports = { } else { checkSpacingAroundFirstToken(node); } - const ofToken = sourceCode.getTokenBefore(node.right, astUtils.isNotOpeningParenToken); const previousToken = sourceCode.getTokenBefore(ofToken); - if (previousToken.type !== "PrivateIdentifier") { checkSpacingBefore(ofToken); } - checkSpacingAfter(ofToken); } + /** * Reports `import`, `export`, `as`, and `from` keywords of a given node if * usage of spacing around those keywords is invalid. @@ -83055,51 +71959,44 @@ module.exports = { * @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); checkSpacingAfter(asToken, NEXT_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 An `ImportSpecifier` node to check. * @returns {void} */ - - function checkSpacingForImportSpecifier(node) { if (node.imported.range[0] !== node.local.range[0]) { const asToken = sourceCode.getTokenBefore(node.local); checkSpacingBefore(asToken, PREV_TOKEN_M); } } + /** * Reports `as` keyword of a given node if usage of spacing around this * keyword is invalid. * @param {ASTNode} node An `ExportSpecifier` node to check. * @returns {void} */ - - function checkSpacingForExportSpecifier(node) { if (node.local.range[0] !== node.exported.range[0]) { const asToken = sourceCode.getTokenBefore(node.exported); @@ -83107,18 +72004,18 @@ module.exports = { checkSpacingAfter(asToken, 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. @@ -83126,13 +72023,10 @@ module.exports = { * @throws {Error} If unable to find token get, set, or async beside method name. * @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) { @@ -83140,31 +72034,26 @@ module.exports = { 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, @@ -83211,20 +72100,17 @@ module.exports = { PropertyDefinition: checkSpacingForProperty, StaticBlock: checkSpacingAroundFirstToken, Property: checkSpacingForProperty, - // To avoid conflicts with `space-infix-ops`, e.g. `a > this.b` "BinaryExpression[operator='>']"(node) { const operatorToken = sourceCode.getTokenBefore(node.right, astUtils.isNotOpeningParenToken); tokensToIgnore.add(operatorToken); } - }; } - }; /***/ }), -/* 700 */ +/* 706 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -83234,20 +72120,20 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce position of line comments", recommended: false, - url: "https://eslint.org/docs/rules/line-comment-position" + url: "https://eslint.org/docs/latest/rules/line-comment-position" }, schema: [{ oneOf: [{ @@ -83276,30 +72162,28 @@ module.exports = { beside: "Expected comment to be beside code." } }, - create(context) { const options = context.options[0]; let above, - ignorePattern, - applyDefaultIgnorePatterns = true; - + 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(); //-------------------------------------------------------------------------- + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- @@ -83310,16 +72194,13 @@ module.exports = { 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({ @@ -83337,14 +72218,12 @@ module.exports = { } }); } - }; } - }; /***/ }), -/* 701 */ +/* 707 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -83352,24 +72231,26 @@ module.exports = { * @fileoverview Rule to enforce a single linebreak style. * @author Erik Mueller */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent linebreak style", recommended: false, - url: "https://eslint.org/docs/rules/linebreak-style" + url: "https://eslint.org/docs/latest/rules/linebreak-style" }, fixable: "whitespace", schema: [{ @@ -83380,9 +72261,10 @@ module.exports = { expectedCRLF: "Expected linebreaks to be 'CRLF' but found 'LF'." } }, - create(context) { - const sourceCode = context.getSourceCode(); //-------------------------------------------------------------------------- + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -83393,33 +72275,30 @@ module.exports = { * @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(); + 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({ @@ -83441,11 +72320,10 @@ module.exports = { } }; } - }; /***/ }), -/* 702 */ +/* 708 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -83453,21 +72331,22 @@ module.exports = { * @fileoverview Enforces empty lines around comments. * @author Jamund Ferguson */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ /** - * Return an array with with any line numbers that are empty. + * Return an array 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(), @@ -83475,13 +72354,12 @@ function getEmptyLineNums(lines) { })).filter(line => !line.code).map(line => line.num); return emptyLines; } + /** - * Return an array with with any line numbers that contain comments. + * Return an array 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 => { @@ -83490,20 +72368,20 @@ function getCommentLineNums(comments) { lines.push(start, end); }); return lines; -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Require empty lines around comments", recommended: false, - url: "https://eslint.org/docs/rules/lines-around-comment" + url: "https://eslint.org/docs/latest/rules/lines-around-comment" }, fixable: "whitespace", schema: [{ @@ -83556,6 +72434,10 @@ module.exports = { }, applyDefaultIgnorePatterns: { type: "boolean" + }, + afterHashbangComment: { + type: "boolean", + default: false } }, additionalProperties: false @@ -83565,7 +72447,6 @@ module.exports = { before: "Expected line before comment." } }, - create(context) { const options = Object.assign({}, context.options[0]); const ignorePattern = options.ignorePattern; @@ -83573,66 +72454,59 @@ module.exports = { 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 sourceCode = context.sourceCode; const lines = sourceCode.lines, - numLines = lines.length + 1, - comments = sourceCode.getAllComments(), - commentLines = getCommentLineNums(comments), - emptyLines = getEmptyLineNums(lines), - commentAndEmptyLines = new Set(commentLines.concat(emptyLines)); + numLines = lines.length + 1, + comments = sourceCode.getAllComments(), + commentLines = getCommentLineNums(comments), + emptyLines = getEmptyLineNums(lines), + commentAndEmptyLines = new Set(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|null} The parent node that contains the given token. */ - - function getParentNodeOfToken(token) { const node = sourceCode.getNodeByRangeIndex(token.range[0]); + /* * For the purpose of this rule, the comment token is in a `StaticBlock` node only * if it's inside the braces of that `StaticBlock` node. @@ -83652,7 +72526,6 @@ module.exports = { * } * */ - if (node && node.type === "StaticBlock") { const openingBrace = sourceCode.getFirstToken(node, { skip: 1 @@ -83660,23 +72533,19 @@ module.exports = { return token.range[0] >= openingBrace.range[0] ? node : null; } - return node; } + /** * 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); - if (parent && isParentNodeType(parent, nodeType)) { let parentStartNodeOrToken = parent; - if (parent.type === "StaticBlock") { parentStartNodeOrToken = sourceCode.getFirstToken(parent, { skip: 1 @@ -83689,101 +72558,92 @@ module.exports = { return token.loc.start.line - parentStartNodeOrToken.loc.start.line === 1; } - return false; } + /** * 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, "StaticBlock") || isCommentAtParentStart(token, "SwitchCase") || isCommentAtParentStart(token, "SwitchStatement"); } + /** * 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, "StaticBlock") || 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. @@ -83792,84 +72652,77 @@ module.exports = { * @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; + before = opts.before; const prevLineNum = token.loc.start.line - 1, - nextLineNum = token.loc.end.line + 1, - commentIsNotAlone = codeAroundComment(token); + 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); + 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 + 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 - + } + // 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 + }); + // check for newline before if (!exceptionStartAllowed && before && !commentAndEmptyLines.has(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 - + } + // check for newline after if (!exceptionEndAllowed && after && !commentAndEmptyLines.has(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 => { @@ -83887,17 +72740,22 @@ module.exports = { before: options.beforeBlockComment }); } + } else if (token.type === "Shebang") { + if (options.afterHashbangComment) { + checkForEmptyLine(token, { + after: options.afterHashbangComment, + before: false + }); + } } }); } - }; } - }; /***/ }), -/* 703 */ +/* 709 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -83908,20 +72766,21 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Require or disallow newlines around directives", recommended: false, - url: "https://eslint.org/docs/rules/lines-around-directive" + url: "https://eslint.org/docs/latest/rules/lines-around-directive" }, schema: [{ oneOf: [{ @@ -83948,12 +72807,13 @@ module.exports = { deprecated: true, replacedBy: ["padding-line-between-statements"] }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const config = context.options[0] || "always"; const expectLineBefore = typeof config === "string" ? config : config.before; - const expectLineAfter = typeof config === "string" ? config : config.after; //-------------------------------------------------------------------------- + const expectLineAfter = typeof config === "string" ? config : config.after; + + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -83962,7 +72822,6 @@ module.exports = { * @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 @@ -83970,6 +72829,7 @@ module.exports = { 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 @@ -83977,20 +72837,17 @@ module.exports = { * @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, { @@ -83998,6 +72855,7 @@ module.exports = { }); return tokenAfter.loc.start.line - lastToken.loc.end.line >= 2; } + /** * Report errors for newlines around directives. * @param {ASTNode} node Node to check. @@ -84005,8 +72863,6 @@ module.exports = { * @param {boolean} expected Whether or not a newline was expected or unexpected. * @returns {void} */ - - function reportError(node, location, expected) { context.report({ node, @@ -84015,77 +72871,67 @@ module.exports = { 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, @@ -84093,11 +72939,10 @@ module.exports = { ArrowFunctionExpression: checkDirectives }; } - }; /***/ }), -/* 704 */ +/* 710 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -84105,24 +72950,25 @@ module.exports = { * @fileoverview Rule to check empty newline between class members * @author 薛定谔的猫 */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Require or disallow an empty line between class members", recommended: false, - url: "https://eslint.org/docs/rules/lines-between-class-members" + url: "https://eslint.org/docs/latest/rules/lines-between-class-members" }, fixable: "whitespace", schema: [{ @@ -84142,14 +72988,14 @@ module.exports = { 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(); + const sourceCode = context.sourceCode; + /** * Gets a pair of tokens that should be used to check lines between two class member nodes. * @@ -84179,7 +73025,6 @@ module.exports = { * @returns {Token} The actual last token of `node`. * @private */ - function getBoundaryTokens(curNode, nextNode) { const lastToken = sourceCode.getLastToken(curNode); const prevToken = sourceCode.getTokenBefore(lastToken); @@ -84194,6 +73039,7 @@ module.exports = { nextFirst: nextToken }; } + /** * 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. @@ -84201,19 +73047,16 @@ module.exports = { * @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. @@ -84221,37 +73064,30 @@ module.exports = { * @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 { @@ -84265,32 +73101,467 @@ module.exports = { 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"); } - }); } } } - }; } - }; /***/ }), -/* 705 */ +/* 711 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +/** + * @fileoverview Rule to replace assignment expressions with logical operator assignment + * @author Daniel Martens + */ + + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const baseTypes = new Set(["Identifier", "Super", "ThisExpression"]); + +/** + * Returns true iff either "undefined" or a void expression (eg. "void 0") + * @param {ASTNode} expression Expression to check + * @param {import('eslint-scope').Scope} scope Scope of the expression + * @returns {boolean} True iff "undefined" or "void ..." + */ +function isUndefined(expression, scope) { + if (expression.type === "Identifier" && expression.name === "undefined") { + return astUtils.isReferenceToGlobalVariable(scope, expression); + } + return expression.type === "UnaryExpression" && expression.operator === "void" && expression.argument.type === "Literal" && expression.argument.value === 0; +} + +/** + * Returns true iff the reference is either an identifier or member expression + * @param {ASTNode} expression Expression to check + * @returns {boolean} True for identifiers and member expressions + */ +function isReference(expression) { + return expression.type === "Identifier" && expression.name !== "undefined" || expression.type === "MemberExpression"; +} + +/** + * Returns true iff the expression checks for nullish with loose equals. + * Examples: value == null, value == void 0 + * @param {ASTNode} expression Test condition + * @param {import('eslint-scope').Scope} scope Scope of the expression + * @returns {boolean} True iff implicit nullish comparison + */ +function isImplicitNullishComparison(expression, scope) { + if (expression.type !== "BinaryExpression" || expression.operator !== "==") { + return false; + } + const reference = isReference(expression.left) ? "left" : "right"; + const nullish = reference === "left" ? "right" : "left"; + return isReference(expression[reference]) && (astUtils.isNullLiteral(expression[nullish]) || isUndefined(expression[nullish], scope)); +} + +/** + * Condition with two equal comparisons. + * @param {ASTNode} expression Condition + * @returns {boolean} True iff matches ? === ? || ? === ? + */ +function isDoubleComparison(expression) { + return expression.type === "LogicalExpression" && expression.operator === "||" && expression.left.type === "BinaryExpression" && expression.left.operator === "===" && expression.right.type === "BinaryExpression" && expression.right.operator === "==="; +} + +/** + * Returns true iff the expression checks for undefined and null. + * Example: value === null || value === undefined + * @param {ASTNode} expression Test condition + * @param {import('eslint-scope').Scope} scope Scope of the expression + * @returns {boolean} True iff explicit nullish comparison + */ +function isExplicitNullishComparison(expression, scope) { + if (!isDoubleComparison(expression)) { + return false; + } + const leftReference = isReference(expression.left.left) ? "left" : "right"; + const leftNullish = leftReference === "left" ? "right" : "left"; + const rightReference = isReference(expression.right.left) ? "left" : "right"; + const rightNullish = rightReference === "left" ? "right" : "left"; + return astUtils.isSameReference(expression.left[leftReference], expression.right[rightReference]) && (astUtils.isNullLiteral(expression.left[leftNullish]) && isUndefined(expression.right[rightNullish], scope) || isUndefined(expression.left[leftNullish], scope) && astUtils.isNullLiteral(expression.right[rightNullish])); +} + +/** + * Returns true for Boolean(arg) calls + * @param {ASTNode} expression Test condition + * @param {import('eslint-scope').Scope} scope Scope of the expression + * @returns {boolean} Whether the expression is a boolean cast + */ +function isBooleanCast(expression, scope) { + return expression.type === "CallExpression" && expression.callee.name === "Boolean" && expression.arguments.length === 1 && astUtils.isReferenceToGlobalVariable(scope, expression.callee); +} + +/** + * Returns true for: + * truthiness checks: value, Boolean(value), !!value + * falsiness checks: !value, !Boolean(value) + * nullish checks: value == null, value === undefined || value === null + * @param {ASTNode} expression Test condition + * @param {import('eslint-scope').Scope} scope Scope of the expression + * @returns {?{ reference: ASTNode, operator: '??'|'||'|'&&'}} Null if not a known existence + */ +function getExistence(expression, scope) { + const isNegated = expression.type === "UnaryExpression" && expression.operator === "!"; + const base = isNegated ? expression.argument : expression; + switch (true) { + case isReference(base): + return { + reference: base, + operator: isNegated ? "||" : "&&" + }; + case base.type === "UnaryExpression" && base.operator === "!" && isReference(base.argument): + return { + reference: base.argument, + operator: "&&" + }; + case isBooleanCast(base, scope) && isReference(base.arguments[0]): + return { + reference: base.arguments[0], + operator: isNegated ? "||" : "&&" + }; + case isImplicitNullishComparison(expression, scope): + return { + reference: isReference(expression.left) ? expression.left : expression.right, + operator: "??" + }; + case isExplicitNullishComparison(expression, scope): + return { + reference: isReference(expression.left.left) ? expression.left.left : expression.left.right, + operator: "??" + }; + default: + return null; + } +} + +/** + * Returns true iff the node is inside a with block + * @param {ASTNode} node Node to check + * @returns {boolean} True iff passed node is inside a with block + */ +function isInsideWithBlock(node) { + if (node.type === "Program") { + return false; + } + return node.parent.type === "WithStatement" && node.parent.body === node ? true : isInsideWithBlock(node.parent); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + docs: { + description: "Require or disallow logical assignment operator shorthand", + recommended: false, + url: "https://eslint.org/docs/latest/rules/logical-assignment-operators" + }, + schema: { + type: "array", + oneOf: [{ + items: [{ + const: "always" + }, { + type: "object", + properties: { + enforceForIfStatements: { + type: "boolean" + } + }, + additionalProperties: false + }], + minItems: 0, + // 0 for allowing passing no options + maxItems: 2 + }, { + items: [{ + const: "never" + }], + minItems: 1, + maxItems: 1 + }] + }, + fixable: "code", + // eslint-disable-next-line eslint-plugin/require-meta-has-suggestions -- Does not detect conditional suggestions + hasSuggestions: true, + messages: { + assignment: "Assignment (=) can be replaced with operator assignment ({{operator}}).", + useLogicalOperator: "Convert this assignment to use the operator {{ operator }}.", + logical: "Logical expression can be replaced with an assignment ({{ operator }}).", + convertLogical: "Replace this logical expression with an assignment with the operator {{ operator }}.", + if: "'if' statement can be replaced with a logical operator assignment with operator {{ operator }}.", + convertIf: "Replace this 'if' statement with a logical assignment with operator {{ operator }}.", + unexpected: "Unexpected logical operator assignment ({{operator}}) shorthand.", + separate: "Separate the logical assignment into an assignment with a logical operator." + } + }, + create(context) { + const mode = context.options[0] === "never" ? "never" : "always"; + const checkIf = mode === "always" && context.options.length > 1 && context.options[1].enforceForIfStatements; + const sourceCode = context.sourceCode; + const isStrict = sourceCode.getScope(sourceCode.ast).isStrict; + + /** + * Returns false if the access could be a getter + * @param {ASTNode} node Assignment expression + * @returns {boolean} True iff the fix is safe + */ + function cannotBeGetter(node) { + return node.type === "Identifier" && (isStrict || !isInsideWithBlock(node)); + } + + /** + * Check whether only a single property is accessed + * @param {ASTNode} node reference + * @returns {boolean} True iff a single property is accessed + */ + function accessesSingleProperty(node) { + if (!isStrict && isInsideWithBlock(node)) { + return node.type === "Identifier"; + } + return node.type === "MemberExpression" && baseTypes.has(node.object.type) && (!node.computed || node.property.type !== "MemberExpression" && node.property.type !== "ChainExpression"); + } + + /** + * Adds a fixer or suggestion whether on the fix is safe. + * @param {{ messageId: string, node: ASTNode }} descriptor Report descriptor without fix or suggest + * @param {{ messageId: string, fix: Function }} suggestion Adds the fix or the whole suggestion as only element in "suggest" to suggestion + * @param {boolean} shouldBeFixed Fix iff the condition is true + * @returns {Object} Descriptor with either an added fix or suggestion + */ + function createConditionalFixer(descriptor, suggestion, shouldBeFixed) { + if (shouldBeFixed) { + return { + ...descriptor, + fix: suggestion.fix + }; + } + return { + ...descriptor, + suggest: [suggestion] + }; + } + + /** + * Returns the operator token for assignments and binary expressions + * @param {ASTNode} node AssignmentExpression or BinaryExpression + * @returns {import('eslint').AST.Token} Operator token between the left and right expression + */ + function getOperatorToken(node) { + return sourceCode.getFirstTokenBetween(node.left, node.right, token => token.value === node.operator); + } + if (mode === "never") { + return { + // foo ||= bar + "AssignmentExpression"(assignment) { + if (!astUtils.isLogicalAssignmentOperator(assignment.operator)) { + return; + } + const descriptor = { + messageId: "unexpected", + node: assignment, + data: { + operator: assignment.operator + } + }; + const suggestion = { + messageId: "separate", + *fix(ruleFixer) { + if (sourceCode.getCommentsInside(assignment).length > 0) { + return; + } + const operatorToken = getOperatorToken(assignment); + + // -> foo = bar + yield ruleFixer.replaceText(operatorToken, "="); + const assignmentText = sourceCode.getText(assignment.left); + const operator = assignment.operator.slice(0, -1); + + // -> foo = foo || bar + yield ruleFixer.insertTextAfter(operatorToken, ` ${assignmentText} ${operator}`); + const precedence = astUtils.getPrecedence(assignment.right) <= astUtils.getPrecedence({ + type: "LogicalExpression", + operator + }); + + // ?? and || / && cannot be mixed but have same precedence + const mixed = assignment.operator === "??=" && astUtils.isLogicalExpression(assignment.right); + if (!astUtils.isParenthesised(sourceCode, assignment.right) && (precedence || mixed)) { + // -> foo = foo || (bar) + yield ruleFixer.insertTextBefore(assignment.right, "("); + yield ruleFixer.insertTextAfter(assignment.right, ")"); + } + } + }; + context.report(createConditionalFixer(descriptor, suggestion, cannotBeGetter(assignment.left))); + } + }; + } + return { + // foo = foo || bar + "AssignmentExpression[operator='='][right.type='LogicalExpression']"(assignment) { + if (!astUtils.isSameReference(assignment.left, assignment.right.left)) { + return; + } + const descriptor = { + messageId: "assignment", + node: assignment, + data: { + operator: `${assignment.right.operator}=` + } + }; + const suggestion = { + messageId: "useLogicalOperator", + data: { + operator: `${assignment.right.operator}=` + }, + *fix(ruleFixer) { + if (sourceCode.getCommentsInside(assignment).length > 0) { + return; + } + + // No need for parenthesis around the assignment based on precedence as the precedence stays the same even with changed operator + const assignmentOperatorToken = getOperatorToken(assignment); + + // -> foo ||= foo || bar + yield ruleFixer.insertTextBefore(assignmentOperatorToken, assignment.right.operator); + + // -> foo ||= bar + const logicalOperatorToken = getOperatorToken(assignment.right); + const firstRightOperandToken = sourceCode.getTokenAfter(logicalOperatorToken); + yield ruleFixer.removeRange([assignment.right.range[0], firstRightOperandToken.range[0]]); + } + }; + context.report(createConditionalFixer(descriptor, suggestion, cannotBeGetter(assignment.left))); + }, + // foo || (foo = bar) + 'LogicalExpression[right.type="AssignmentExpression"][right.operator="="]'(logical) { + // Right side has to be parenthesized, otherwise would be parsed as (foo || foo) = bar which is illegal + if (isReference(logical.left) && astUtils.isSameReference(logical.left, logical.right.left)) { + const descriptor = { + messageId: "logical", + node: logical, + data: { + operator: `${logical.operator}=` + } + }; + const suggestion = { + messageId: "convertLogical", + data: { + operator: `${logical.operator}=` + }, + *fix(ruleFixer) { + if (sourceCode.getCommentsInside(logical).length > 0) { + return; + } + const requiresOuterParenthesis = logical.parent.type !== "ExpressionStatement" && astUtils.getPrecedence({ + type: "AssignmentExpression" + }) < astUtils.getPrecedence(logical.parent); + if (!astUtils.isParenthesised(sourceCode, logical) && requiresOuterParenthesis) { + yield ruleFixer.insertTextBefore(logical, "("); + yield ruleFixer.insertTextAfter(logical, ")"); + } + + // Also removes all opening parenthesis + yield ruleFixer.removeRange([logical.range[0], logical.right.range[0]]); // -> foo = bar) + + // Also removes all ending parenthesis + yield ruleFixer.removeRange([logical.right.range[1], logical.range[1]]); // -> foo = bar + + const operatorToken = getOperatorToken(logical.right); + yield ruleFixer.insertTextBefore(operatorToken, logical.operator); // -> foo ||= bar + } + }; + + const fix = cannotBeGetter(logical.left) || accessesSingleProperty(logical.left); + context.report(createConditionalFixer(descriptor, suggestion, fix)); + } + }, + // if (foo) foo = bar + "IfStatement[alternate=null]"(ifNode) { + if (!checkIf) { + return; + } + const hasBody = ifNode.consequent.type === "BlockStatement"; + if (hasBody && ifNode.consequent.body.length !== 1) { + return; + } + const body = hasBody ? ifNode.consequent.body[0] : ifNode.consequent; + const scope = sourceCode.getScope(ifNode); + const existence = getExistence(ifNode.test, scope); + if (body.type === "ExpressionStatement" && body.expression.type === "AssignmentExpression" && body.expression.operator === "=" && existence !== null && astUtils.isSameReference(existence.reference, body.expression.left)) { + const descriptor = { + messageId: "if", + node: ifNode, + data: { + operator: `${existence.operator}=` + } + }; + const suggestion = { + messageId: "convertIf", + data: { + operator: `${existence.operator}=` + }, + *fix(ruleFixer) { + if (sourceCode.getCommentsInside(ifNode).length > 0) { + return; + } + const firstBodyToken = sourceCode.getFirstToken(body); + const prevToken = sourceCode.getTokenBefore(ifNode); + if (prevToken !== null && prevToken.value !== ";" && prevToken.value !== "{" && firstBodyToken.type !== "Identifier" && firstBodyToken.type !== "Keyword") { + // Do not fix if the fixed statement could be part of the previous statement (eg. fn() if (a == null) (a) = b --> fn()(a) ??= b) + return; + } + const operatorToken = getOperatorToken(body.expression); + yield ruleFixer.insertTextBefore(operatorToken, existence.operator); // -> if (foo) foo ||= bar + + yield ruleFixer.removeRange([ifNode.range[0], body.range[0]]); // -> foo ||= bar + + yield ruleFixer.removeRange([body.range[1], ifNode.range[1]]); // -> foo ||= bar, only present if "if" had a body + + const nextToken = sourceCode.getTokenAfter(body.expression); + if (hasBody && nextToken !== null && nextToken.value !== ";") { + yield ruleFixer.insertTextAfter(ifNode, ";"); + } + } + }; + const shouldBeFixed = cannotBeGetter(existence.reference) || ifNode.test.type !== "LogicalExpression" && accessesSingleProperty(existence.reference); + context.report(createConditionalFixer(descriptor, suggestion, shouldBeFixed)); + } + } + }; + } +}; + +/***/ }), +/* 712 */ /***/ ((module) => { "use strict"; @@ -84298,22 +73569,24 @@ module.exports = { * @fileoverview Enforce a maximum number of classes per file * @author James Garbutt */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce a maximum number of classes per file", recommended: false, - url: "https://eslint.org/docs/rules/max-classes-per-file" + url: "https://eslint.org/docs/latest/rules/max-classes-per-file" }, schema: [{ oneOf: [{ @@ -84337,7 +73610,6 @@ module.exports = { maximumExceeded: "File has too many classes ({{ classCount }}). Maximum allowed is {{ max }}." } }, - create(context) { const [option = {}] = context.options; const [ignoreExpressions, max] = typeof option === "number" ? [false, option || 1] : [option.ignoreExpressions, option.max || 1]; @@ -84346,7 +73618,6 @@ module.exports = { Program() { classCount = 0; }, - "Program:exit"(node) { if (classCount > max) { context.report({ @@ -84359,24 +73630,20 @@ module.exports = { }); } }, - "ClassDeclaration"() { classCount++; }, - "ClassExpression"() { if (!ignoreExpressions) { classCount++; } } - }; } - }; /***/ }), -/* 706 */ +/* 713 */ /***/ ((module) => { "use strict"; @@ -84384,19 +73651,21 @@ module.exports = { * @fileoverview A rule to set the maximum depth block can be nested in a function. * @author Ian Christian Myers */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce a maximum depth that blocks can be nested", recommended: false, - url: "https://eslint.org/docs/rules/max-depth" + url: "https://eslint.org/docs/latest/rules/max-depth" }, schema: [{ oneOf: [{ @@ -84421,53 +73690,47 @@ module.exports = { tooDeeply: "Blocks are nested too deeply ({{depth}}). Maximum allowed is {{maxDepth}}." } }, - create(context) { //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- - const functionStack = [], - option = context.options[0]; - let maxDepth = 4; + 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, @@ -84479,33 +73742,31 @@ module.exports = { }); } } + /** * Pop the saved block * @returns {void} * @private */ - - function popBlock() { functionStack[functionStack.length - 1]--; - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public API //-------------------------------------------------------------------------- - return { Program: startFunction, FunctionDeclaration: startFunction, FunctionExpression: startFunction, ArrowFunctionExpression: startFunction, StaticBlock: startFunction, - IfStatement(node) { if (node.parent.type !== "IfStatement") { pushBlock(node); } }, - SwitchStatement: pushBlock, TryStatement: pushBlock, DoWhileStatement: pushBlock, @@ -84530,11 +73791,10 @@ module.exports = { "Program:exit": endFunction }; } - }; /***/ }), -/* 707 */ +/* 714 */ /***/ ((module) => { "use strict"; @@ -84542,10 +73802,12 @@ module.exports = { * @fileoverview Rule to check for max length on a line. * @author Matt DuVall */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Constants //------------------------------------------------------------------------------ - const OPTIONS_SCHEMA = { type: "object", properties: { @@ -84590,19 +73852,20 @@ const OPTIONS_OR_INTEGER_SCHEMA = { type: "integer", minimum: 0 }] -}; //------------------------------------------------------------------------------ +}; + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "layout", docs: { description: "Enforce a maximum line length", recommended: false, - url: "https://eslint.org/docs/rules/max-len" + url: "https://eslint.org/docs/latest/rules/max-len" }, schema: [OPTIONS_OR_INTEGER_SCHEMA, OPTIONS_OR_INTEGER_SCHEMA, OPTIONS_SCHEMA], messages: { @@ -84610,7 +73873,6 @@ module.exports = { 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: @@ -84621,7 +73883,8 @@ module.exports = { * - We don't care about matching the entire URL, any small segment is fine */ const URL_REGEXP = /[^:/?#]:\/\/[^?#]/u; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * 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. @@ -84630,44 +73893,45 @@ module.exports = { * @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; + 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… + } + // The options object must be the last option specified… + const options = Object.assign({}, context.options[context.options.length - 1]); - const options = Object.assign({}, context.options[context.options.length - 1]); // …but max code length… - + // …but max code length… if (typeof context.options[0] === "number") { options.code = context.options[0]; - } // …and tabWidth can be optionally specified directly as integers. - + } + // …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; + 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 //-------------------------------------------------------------------------- @@ -84679,11 +73943,10 @@ module.exports = { * @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 @@ -84691,29 +73954,26 @@ module.exports = { * @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(); + 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. @@ -84721,12 +73981,11 @@ module.exports = { * @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 @@ -84735,42 +73994,37 @@ module.exports = { * @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 @@ -84778,28 +74032,23 @@ module.exports = { * @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) { @@ -84811,20 +74060,20 @@ module.exports = { }); 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 + // 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, {}); @@ -84835,36 +74084,36 @@ module.exports = { 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 + 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 - + } 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 + 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]); } @@ -84874,19 +74123,15 @@ module.exports = { } 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, @@ -84897,7 +74142,6 @@ module.exports = { column: textToMeasure.length } }; - if (commentLengthApplies) { if (lineLength > maxCommentLength) { context.report({ @@ -84922,20 +74166,20 @@ module.exports = { }); } }); - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public API //-------------------------------------------------------------------------- - return { Program: checkProgramForMaxLength }; } - }; /***/ }), -/* 708 */ +/* 715 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -84943,11 +74187,14 @@ module.exports = { * @fileoverview enforce a maximum file length * @author Alberto Rodríguez */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -84957,24 +74204,22 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @param {number} end The end of the range * @returns {number[]} The range of numbers */ - - function range(start, end) { return [...Array(end - start).keys()].map(x => x + start); -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce a maximum number of lines per file", recommended: false, - url: "https://eslint.org/docs/rules/max-lines" + url: "https://eslint.org/docs/latest/rules/max-lines" }, schema: [{ oneOf: [{ @@ -85001,96 +74246,81 @@ module.exports = { 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(); + const sourceCode = context.sourceCode; + /** * 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 range(start, end + 1); } - return []; } - return { "Program:exit"() { let lines = sourceCode.lines.map((text, i) => ({ lineNumber: i + 1, text })); + /* * If file ends with a linebreak, `sourceCode.lines` will have one extra empty line at the end. * That isn't a real line, so we shouldn't count it. */ - if (lines.length > 1 && lines[lines.length - 1].text === "") { lines.pop(); } - if (skipBlankLines) { lines = lines.filter(l => l.text.trim() !== ""); } - if (skipComments) { const comments = sourceCode.getAllComments(); const commentLines = new Set(comments.flatMap(getLinesWithoutCode)); lines = lines.filter(l => !commentLines.has(l.lineNumber)); } - if (lines.length > max) { const loc = { start: { @@ -85112,14 +74342,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 709 */ +/* 716 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -85127,19 +74355,20 @@ module.exports = { * @fileoverview A rule to set the maximum number of line of code in a function. * @author Pete Ward */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - -const astUtils = __webpack_require__(618); - +const astUtils = __webpack_require__(639); const { upperCaseFirst -} = __webpack_require__(642); //------------------------------------------------------------------------------ +} = __webpack_require__(663); + +//------------------------------------------------------------------------------ // Constants //------------------------------------------------------------------------------ - const OPTIONS_SCHEMA = { type: "object", properties: { @@ -85165,12 +74394,12 @@ const OPTIONS_OR_INTEGER_SCHEMA = { 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 => { @@ -85179,36 +74408,34 @@ function getCommentLineNumbers(comments) { } }); return map; -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce a maximum number of lines of code in a function", recommended: false, - url: "https://eslint.org/docs/rules/max-lines-per-function" + url: "https://eslint.org/docs/latest/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 sourceCode = context.sourceCode; 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; @@ -85217,8 +74444,9 @@ module.exports = { } else if (typeof option === "number") { maxLines = option; } + const commentLineNumbers = getCommentLineNumbers(sourceCode.getAllComments()); - const commentLineNumbers = getCommentLineNumbers(sourceCode.getAllComments()); //-------------------------------------------------------------------------- + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -85229,85 +74457,70 @@ module.exports = { * @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(); + 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 = upperCaseFirst(astUtils.getFunctionNameWithKind(funcNode)); context.report({ @@ -85320,22 +74533,22 @@ module.exports = { } }); } - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public API //-------------------------------------------------------------------------- - return { FunctionDeclaration: processFunction, FunctionExpression: processFunction, ArrowFunctionExpression: processFunction }; } - }; /***/ }), -/* 710 */ +/* 717 */ /***/ ((module) => { "use strict"; @@ -85343,19 +74556,21 @@ module.exports = { * @fileoverview Rule to enforce a maximum number of nested callbacks. * @author Ian Christian Myers */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce a maximum depth that callbacks can be nested", recommended: false, - url: "https://eslint.org/docs/rules/max-nested-callbacks" + url: "https://eslint.org/docs/latest/rules/max-nested-callbacks" }, schema: [{ oneOf: [{ @@ -85380,38 +74595,35 @@ module.exports = { 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, @@ -85424,20 +74636,20 @@ module.exports = { }); } } + /** * Pops the call stack. * @returns {void} * @private */ - - function popStack() { callbackStack.pop(); - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public API //-------------------------------------------------------------------------- - return { ArrowFunctionExpression: checkFunction, "ArrowFunctionExpression:exit": popStack, @@ -85445,11 +74657,10 @@ module.exports = { "FunctionExpression:exit": popStack }; } - }; /***/ }), -/* 711 */ +/* 718 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -85457,28 +74668,29 @@ module.exports = { * @fileoverview Rule to flag when a function has too many parameters * @author Ilya Volodin */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - -const astUtils = __webpack_require__(618); - +const astUtils = __webpack_require__(639); const { upperCaseFirst -} = __webpack_require__(642); //------------------------------------------------------------------------------ +} = __webpack_require__(663); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce a maximum number of parameters in function definitions", recommended: false, - url: "https://eslint.org/docs/rules/max-params" + url: "https://eslint.org/docs/latest/rules/max-params" }, schema: [{ oneOf: [{ @@ -85503,27 +74715,23 @@ module.exports = { exceed: "{{name}} has too many parameters ({{count}}). Maximum allowed is {{max}}." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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({ @@ -85538,18 +74746,16 @@ module.exports = { }); } } - return { FunctionDeclaration: checkFunction, ArrowFunctionExpression: checkFunction, FunctionExpression: checkFunction }; } - }; /***/ }), -/* 712 */ +/* 719 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -85557,28 +74763,29 @@ module.exports = { * @fileoverview A rule to set the maximum number of statements in a function. * @author Ian Christian Myers */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - -const astUtils = __webpack_require__(618); - +const astUtils = __webpack_require__(639); const { upperCaseFirst -} = __webpack_require__(642); //------------------------------------------------------------------------------ +} = __webpack_require__(663); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce a maximum number of statements allowed in function blocks", recommended: false, - url: "https://eslint.org/docs/rules/max-statements" + url: "https://eslint.org/docs/latest/rules/max-statements" }, schema: [{ oneOf: [{ @@ -85611,22 +74818,22 @@ module.exports = { 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; + 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 @@ -85635,8 +74842,6 @@ module.exports = { * @returns {void} * @private */ - - function reportIfTooManyStatements(node, count, max) { if (count > max) { const name = upperCaseFirst(astUtils.getFunctionNameWithKind(node)); @@ -85651,35 +74856,32 @@ module.exports = { }); } } + /** * 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(); + /* * This rule does not apply to class static blocks, but we have to track them so * that statements in them do not count as statements in the enclosing function. */ - if (node.type === "StaticBlock") { return; } - if (ignoreTopLevelFunctions && functionStack.length === 0) { topLevelFunctions.push({ node, @@ -85689,21 +74891,21 @@ module.exports = { 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, @@ -85714,26 +74916,22 @@ module.exports = { "FunctionExpression:exit": endFunction, "ArrowFunctionExpression:exit": endFunction, "StaticBlock:exit": endFunction, - "Program:exit"() { if (topLevelFunctions.length === 1) { return; } - topLevelFunctions.forEach(element => { const count = element.count; const node = element.node; reportIfTooManyStatements(node, count, maxStatements); }); } - }; } - }; /***/ }), -/* 713 */ +/* 720 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -85741,24 +74939,25 @@ module.exports = { * @fileoverview Specify the maximum number of statements allowed per line. * @author Kenneth Williams */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce a maximum number of statements allowed per line", recommended: false, - url: "https://eslint.org/docs/rules/max-statements-per-line" + url: "https://eslint.org/docs/latest/rules/max-statements-per-line" }, schema: [{ type: "object", @@ -85775,23 +74974,24 @@ module.exports = { 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; + const sourceCode = context.sourceCode, + options = context.options[0] || {}, + maxStatementsPerLine = typeof options.max !== "undefined" ? options.max : 1; let lastStatementLine = 0, - numberOfStatementsOnThisLine = 0, - firstExtraStatement; //-------------------------------------------------------------------------- + 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({ @@ -85804,73 +75004,71 @@ module.exports = { } }); } - 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. - + } + // Update state. if (line === lastStatementLine) { numberOfStatementsOnThisLine += 1; } else { reportFirstExtraStatementAndClear(); numberOfStatementsOnThisLine = 1; lastStatementLine = line; - } // Reports if the node violated this rule. - + } + // 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. + const line = getActualLastToken(node).loc.end.line; + // Update state. if (line !== lastStatementLine) { reportFirstExtraStatementAndClear(); numberOfStatementsOnThisLine = 1; lastStatementLine = line; } - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public API //-------------------------------------------------------------------------- - return { BreakStatement: enterStatement, ClassDeclaration: enterStatement, @@ -85921,11 +75119,10 @@ module.exports = { "Program:exit": reportFirstExtraStatementAndClear }; } - }; /***/ }), -/* 714 */ +/* 721 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -85935,25 +75132,45 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce a particular style for multiline comments", recommended: false, - url: "https://eslint.org/docs/rules/multiline-comment-style" + url: "https://eslint.org/docs/latest/rules/multiline-comment-style" }, fixable: "whitespace", - schema: [{ - enum: ["starred-block", "separate-lines", "bare-block"] - }], + schema: { + anyOf: [{ + type: "array", + items: [{ + enum: ["starred-block", "bare-block"] + }], + additionalItems: false + }, { + type: "array", + items: [{ + enum: ["separate-lines"] + }, { + type: "object", + properties: { + checkJSDoc: { + type: "boolean" + } + }, + additionalProperties: false + }], + additionalItems: false + }] + }, messages: { expectedBlock: "Expected a block comment instead of consecutive line comments.", expectedBareBlock: "Expected a block comment without padding stars.", @@ -85964,10 +75181,13 @@ module.exports = { expectedLines: "Expected multiple line comments instead of a block comment." } }, - create(context) { - const sourceCode = context.getSourceCode(); - const option = context.options[0] || "starred-block"; //---------------------------------------------------------------------- + const sourceCode = context.sourceCode; + const option = context.options[0] || "starred-block"; + const params = context.options[1] || {}; + const checkJSDoc = !!params.checkJSDoc; + + //---------------------------------------------------------------------- // Helpers //---------------------------------------------------------------------- @@ -85976,52 +75196,45 @@ module.exports = { * @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(_ref) { let [firstComment] = _ref; - if (firstComment.type !== "Block") { return false; } + const lines = firstComment.value.split(astUtils.LINEBREAK_MATCHER); - const lines = firstComment.value.split(astUtils.LINEBREAK_MATCHER); // The first and last lines can only contain whitespace. - + // 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(_ref2) { let [firstComment] = _ref2; - 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(_ref3 => { let { @@ -86036,146 +75249,126 @@ module.exports = { return 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: { @@ -86183,18 +75376,15 @@ module.exports = { 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({ @@ -86209,7 +75399,6 @@ module.exports = { fix: fixer => fixer.insertTextAfterRange([start, start + 2], `\n${expectedLinePrefix}`) }); } - if (!/^\s*$/u.test(lines[lines.length - 1])) { context.report({ loc: { @@ -86223,11 +75412,9 @@ module.exports = { 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: { @@ -86241,64 +75428,54 @@ module.exports = { } }, 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)) { + const isJSDoc = isJSDocComment(commentGroup); + if (firstComment.type !== "Block" || !checkJSDoc && isJSDoc) { return; } - - const commentLines = getCommentLines(commentGroup); + let commentLines = getCommentLines(commentGroup); + if (isJSDoc) { + commentLines = commentLines.slice(1, commentLines.length - 1); + } 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, @@ -86308,22 +75485,19 @@ module.exports = { } }, 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. + 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: { @@ -86331,15 +75505,13 @@ module.exports = { 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. - + } + // Prohibits block comments from having a * at the beginning of each line. if (isStarredBlockComment(commentGroup)) { context.report({ loc: { @@ -86350,16 +75522,15 @@ module.exports = { } }, messageId: "expectedBareBlock", - fix(fixer) { return fixer.replaceText(firstComment, convertToBlock(firstComment, commentLines)); } - }); } } + }; - }; //---------------------------------------------------------------------- + //---------------------------------------------------------------------- // Public //---------------------------------------------------------------------- @@ -86374,24 +75545,20 @@ module.exports = { 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]); } - }; } - }; /***/ }), -/* 715 */ +/* 722 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -86401,20 +75568,21 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce newlines between operands of ternary expressions", recommended: false, - url: "https://eslint.org/docs/rules/multiline-ternary" + url: "https://eslint.org/docs/latest/rules/multiline-ternary" }, schema: [{ enum: ["always", "always-multiline", "never"] @@ -86427,12 +75595,13 @@ module.exports = { }, fixable: "whitespace" }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const option = context.options[0]; const multiline = option !== "never"; - const allowSingleLine = option === "always-multiline"; //-------------------------------------------------------------------------- + const allowSingleLine = option === "always-multiline"; + + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- @@ -86448,7 +75617,6 @@ module.exports = { const areTestAndConsequentOnSameLine = astUtils.isTokenOnSameLine(lastTokenOfTest, firstTokenOfConsequent); const areConsequentAndAlternateOnSameLine = astUtils.isTokenOnSameLine(lastTokenOfConsequent, firstTokenOfAlternate); const hasComments = !!sourceCode.getCommentsInside(node).length; - if (!multiline) { if (!areTestAndConsequentOnSameLine) { context.report({ @@ -86458,28 +75626,23 @@ module.exports = { end: lastTokenOfTest.loc.end }, messageId: "unexpectedTestCons", - fix: fixer => { + fix(fixer) { if (hasComments) { return null; } - const fixers = []; const areTestAndQuestionOnSameLine = astUtils.isTokenOnSameLine(lastTokenOfTest, questionToken); const areQuestionAndConsOnSameLine = astUtils.isTokenOnSameLine(questionToken, firstTokenOfConsequent); - if (!areTestAndQuestionOnSameLine) { fixers.push(fixer.removeRange([lastTokenOfTest.range[1], questionToken.range[0]])); } - if (!areQuestionAndConsOnSameLine) { fixers.push(fixer.removeRange([questionToken.range[1], firstTokenOfConsequent.range[0]])); } - return fixers; } }); } - if (!areConsequentAndAlternateOnSameLine) { context.report({ node: node.consequent, @@ -86488,23 +75651,19 @@ module.exports = { end: lastTokenOfConsequent.loc.end }, messageId: "unexpectedConsAlt", - fix: fixer => { + fix(fixer) { if (hasComments) { return null; } - const fixers = []; const areConsAndColonOnSameLine = astUtils.isTokenOnSameLine(lastTokenOfConsequent, colonToken); const areColonAndAltOnSameLine = astUtils.isTokenOnSameLine(colonToken, firstTokenOfAlternate); - if (!areConsAndColonOnSameLine) { fixers.push(fixer.removeRange([lastTokenOfConsequent.range[1], colonToken.range[0]])); } - if (!areColonAndAltOnSameLine) { fixers.push(fixer.removeRange([colonToken.range[1], firstTokenOfAlternate.range[0]])); } - return fixers; } }); @@ -86513,7 +75672,6 @@ module.exports = { if (allowSingleLine && node.loc.start.line === node.loc.end.line) { return; } - if (areTestAndConsequentOnSameLine) { context.report({ node: node.test, @@ -86525,7 +75683,6 @@ module.exports = { fix: fixer => hasComments ? null : fixer.replaceTextRange([lastTokenOfTest.range[1], questionToken.range[0]], "\n") }); } - if (areConsequentAndAlternateOnSameLine) { context.report({ node: node.consequent, @@ -86539,14 +75696,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 716 */ +/* 723 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -86554,16 +75709,20 @@ module.exports = { * @fileoverview Rule to flag use of constructors without capital letters * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // 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`. @@ -86572,58 +75731,50 @@ const CAPS_ALLOWED = ["Array", "Boolean", "Date", "Error", "Function", "Number", * @throws {TypeError} If key is not an own array type property of `obj`. * @returns {string[]} Returns obj[key] if it's an Array, otherwise `fallback` */ - function checkArray(obj, key, fallback) { /* c8 ignore start */ if (Object.prototype.hasOwnProperty.call(obj, key) && !Array.isArray(obj[key])) { throw new TypeError(`${key}, if provided, must be an Array`); - } - /* c8 ignore stop */ - - + } /* c8 ignore stop */ 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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Require constructor names to begin with a capital letter", recommended: false, - url: "https://eslint.org/docs/rules/new-cap" + url: "https://eslint.org/docs/latest/rules/new-cap" }, schema: [{ type: "object", @@ -86666,7 +75817,6 @@ module.exports = { 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; @@ -86677,7 +75827,9 @@ module.exports = { const capIsNewExceptions = calculateCapIsNewExceptions(config); const capIsNewExceptionPattern = config.capIsNewExceptionPattern ? new RegExp(config.capIsNewExceptionPattern, "u") : null; const listeners = {}; - const sourceCode = context.getSourceCode(); //-------------------------------------------------------------------------- + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -86686,34 +75838,30 @@ module.exports = { * @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 @@ -86722,90 +75870,74 @@ module.exports = { * @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; } - }; /***/ }), -/* 717 */ +/* 724 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -86813,50 +75945,45 @@ module.exports = { * @fileoverview Rule to flag when using constructor without parentheses * @author Ilya Volodin */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce or disallow parentheses when invoking a constructor with no arguments", recommended: false, - url: "https://eslint.org/docs/rules/new-parens" + url: "https://eslint.org/docs/latest/rules/new-parens" }, fixable: "code", - schema: { - anyOf: [{ - type: "array", - items: [{ - enum: ["always", "never"] - }], - minItems: 0, - maxItems: 1 - }] - }, + schema: [{ + enum: ["always", "never"] + }], 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(); + const sourceCode = context.sourceCode; return { NewExpression(node) { if (node.arguments.length !== 0) { @@ -86864,10 +75991,10 @@ module.exports = { } 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 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({ @@ -86886,14 +76013,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 718 */ +/* 725 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -86902,24 +76027,26 @@ module.exports = { * @author Gopal Venkatesan * @deprecated in ESLint v4.0.0 */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Require or disallow an empty line after variable declarations", recommended: false, - url: "https://eslint.org/docs/rules/newline-after-var" + url: "https://eslint.org/docs/latest/rules/newline-after-var" }, schema: [{ enum: ["never", "always"] @@ -86932,16 +76059,19 @@ module.exports = { deprecated: true, replacedBy: ["padding-line-between-statements"] }, - create(context) { - const sourceCode = context.getSourceCode(); // Default `mode` to "always". + const sourceCode = context.sourceCode; - const mode = context.options[0] === "never" ? "never" : "always"; // Cache starting and ending line numbers of comments for faster lookup + // 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 //-------------------------------------------------------------------------- @@ -86961,87 +76091,78 @@ module.exports = { * @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 @@ -87050,54 +76171,50 @@ module.exports = { * @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; - /* - * 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 - + // Ignore if there is no following statement if (!nextToken) { return; - } // Ignore if parent of node is a for variant - + } + // Ignore if parent of node is a for variant if (isForTypeSpecifier(node.parent.type)) { return; - } // Ignore if parent of node is an export specifier - + } + // 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 - + } + // Ignore if it is last statement in a block if (isLastNode(node)) { return; - } // Next statement is not a `var`... - + } + // 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, @@ -87105,16 +76222,14 @@ module.exports = { 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 - + } + // Token on the next line, or comment without blank line if (mode === "always" && (!noNextLineToken || hasNextLineComment && !hasBlankLineAfterComment(nextToken, nextLineNum))) { context.report({ node, @@ -87122,31 +76237,28 @@ module.exports = { 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 }; } - }; /***/ }), -/* 719 */ +/* 726 */ /***/ ((module) => { "use strict"; @@ -87155,19 +76267,20 @@ module.exports = { * @author Kai Cataldo * @deprecated in ESLint v4.0.0 */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "layout", docs: { description: "Require an empty line before `return` statements", recommended: false, - url: "https://eslint.org/docs/rules/newline-before-return" + url: "https://eslint.org/docs/latest/rules/newline-before-return" }, fixable: "whitespace", schema: [], @@ -87177,9 +76290,10 @@ module.exports = { deprecated: true, replacedBy: ["padding-line-between-statements"] }, - create(context) { - const sourceCode = context.getSourceCode(); //-------------------------------------------------------------------------- + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -87190,40 +76304,34 @@ module.exports = { * @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.includes(tokenBefore.value); } + /** * 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 @@ -87231,45 +76339,39 @@ module.exports = { * @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 - + } + // 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 @@ -87278,7 +76380,6 @@ module.exports = { * Setting lineNumTokenBefore to zero in that case results in the * desired behavior. */ - if (tokenBefore) { lineNumTokenBefore = tokenBefore.loc.end.line; } else { @@ -87287,20 +76388,20 @@ module.exports = { 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. * @@ -87311,16 +76412,14 @@ module.exports = { * @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. @@ -87330,46 +76429,39 @@ module.exports = { * 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; } - }); } } - }; } - }; /***/ }), -/* 720 */ +/* 727 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -87380,20 +76472,21 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Require a newline after each call in a method chain", recommended: false, - url: "https://eslint.org/docs/rules/newline-per-chained-call" + url: "https://eslint.org/docs/latest/rules/newline-per-chained-call" }, fixable: "whitespace", schema: [{ @@ -87412,11 +76505,11 @@ module.exports = { expected: "Expected line break before `{{callee}}`." } }, - create(context) { const options = context.options[0] || {}, - ignoreChainWithDepth = options.ignoreChainWithDepth || 2; - const sourceCode = context.getSourceCode(); + ignoreChainWithDepth = options.ignoreChainWithDepth || 2; + const sourceCode = context.sourceCode; + /** * Get the prefix of a given MemberExpression node. * If the MemberExpression node is a computed value it returns a @@ -87424,53 +76517,43 @@ module.exports = { * @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({ @@ -87483,22 +76566,18 @@ module.exports = { data: { callee: getPropertyText(callee) }, - fix(fixer) { return fixer.insertTextBefore(firstTokenAfterObject, "\n"); } - }); } } - }; } - }; /***/ }), -/* 721 */ +/* 728 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -87506,15 +76585,18 @@ module.exports = { * @fileoverview Rule to flag use of alert, confirm, prompt * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - const { getStaticPropertyName: getPropertyName, getVariableByName, skipChainExpression -} = __webpack_require__(618); //------------------------------------------------------------------------------ +} = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -87523,88 +76605,79 @@ const { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow the use of `alert`, `confirm`, and `prompt`", recommended: false, - url: "https://eslint.org/docs/rules/no-alert" + url: "https://eslint.org/docs/latest/rules/no-alert" }, schema: [], messages: { unexpected: "Unexpected {{name}}." } }, - create(context) { + const sourceCode = context.sourceCode; return { CallExpression(node) { const callee = skipChainExpression(node.callee), - currentScope = context.getScope(); // without window. + currentScope = sourceCode.getScope(node); + // without window. if (callee.type === "Identifier") { const name = callee.name; - if (!isShadowed(currentScope, callee) && isProhibitedIdentifier(callee.name)) { context.report({ node, @@ -87616,7 +76689,6 @@ module.exports = { } } else if (callee.type === "MemberExpression" && isGlobalThisReferenceOrGlobalWindow(currentScope, callee.object)) { const name = getPropertyName(callee); - if (isProhibitedIdentifier(name)) { context.report({ node, @@ -87628,14 +76700,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 722 */ +/* 729 */ /***/ ((module) => { "use strict"; @@ -87643,26 +76713,27 @@ module.exports = { * @fileoverview Disallow construction of dense arrays using the Array constructor * @author Matt DuVall */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow `Array` constructors", recommended: false, - url: "https://eslint.org/docs/rules/no-array-constructor" + url: "https://eslint.org/docs/latest/rules/no-array-constructor" }, schema: [], messages: { preferLiteral: "The array literal notation [] is preferable." } }, - create(context) { /** * Disallow construction of dense arrays using the Array constructor @@ -87678,17 +76749,15 @@ module.exports = { }); } } - return { CallExpression: check, NewExpression: check }; } - }; /***/ }), -/* 723 */ +/* 730 */ /***/ ((module) => { "use strict"; @@ -87696,19 +76765,20 @@ module.exports = { * @fileoverview disallow using an async function as a Promise executor * @author Teddy Katz */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow using an async function as a Promise executor", recommended: true, - url: "https://eslint.org/docs/rules/no-async-promise-executor" + url: "https://eslint.org/docs/latest/rules/no-async-promise-executor" }, fixable: null, schema: [], @@ -87716,23 +76786,20 @@ module.exports = { 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"), + node: context.sourceCode.getFirstToken(node.arguments[0], token => token.value === "async"), messageId: "async" }); } - }; } - }; /***/ }), -/* 724 */ +/* 731 */ /***/ ((module) => { "use strict"; @@ -87741,12 +76808,12 @@ module.exports = { * @author Nat Mote (nmote) */ + /** * 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" || @@ -87756,48 +76823,42 @@ function isBoundary(node) { */ 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; } } + /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow `await` inside of loops", recommended: false, - url: "https://eslint.org/docs/rules/no-await-in-loop" + url: "https://eslint.org/docs/latest/rules/no-await-in-loop" }, schema: [], messages: { unexpectedAwait: "Unexpected `await` inside a loop." } }, - create(context) { /** * Validate an await expression. @@ -87808,10 +76869,8 @@ module.exports = { if (awaitNode.type === "ForOfStatement" && !awaitNode.await) { return; } - let node = awaitNode; let parent = node.parent; - while (parent && !isBoundary(parent)) { if (isLooped(node, parent)) { context.report({ @@ -87820,22 +76879,19 @@ module.exports = { }); return; } - node = parent; parent = parent.parent; } } - return { AwaitExpression: validate, ForOfStatement: validate }; } - }; /***/ }), -/* 725 */ +/* 732 */ /***/ ((module) => { "use strict"; @@ -87844,25 +76900,27 @@ module.exports = { * @author Nicholas C. Zakas */ + + /* * * Set of bitwise operators. * */ +const BITWISE_OPERATORS = ["^", "|", "&", "<<", ">>", ">>>", "^=", "|=", "&=", "<<=", ">>=", ">>>=", "~"]; -const BITWISE_OPERATORS = ["^", "|", "&", "<<", ">>", ">>>", "^=", "|=", "&=", "<<=", ">>=", ">>>=", "~"]; //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow bitwise operators", recommended: false, - url: "https://eslint.org/docs/rules/no-bitwise" + url: "https://eslint.org/docs/latest/rules/no-bitwise" }, schema: [{ type: "object", @@ -87885,17 +76943,16 @@ module.exports = { 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, @@ -87905,60 +76962,54 @@ module.exports = { } }); } + /** * 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.includes(node.operator); } + /** * 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.includes(node.operator); } + /** * 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 }; } - }; /***/ }), -/* 726 */ +/* 733 */ /***/ ((module) => { "use strict"; @@ -87967,12 +77018,13 @@ module.exports = { * @author Teddy Katz * @deprecated in ESLint v7.0.0 */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { deprecated: true, @@ -87981,18 +77033,18 @@ module.exports = { docs: { description: "Disallow use of the `Buffer()` constructor", recommended: false, - url: "https://eslint.org/docs/rules/no-buffer-constructor" + url: "https://eslint.org/docs/latest/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({ @@ -88003,14 +77055,12 @@ module.exports = { } }); } - }; } - }; /***/ }), -/* 727 */ +/* 734 */ /***/ ((module) => { "use strict"; @@ -88018,32 +77068,32 @@ module.exports = { * @fileoverview Rule to flag use of arguments.callee and arguments.caller. * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow the use of `arguments.caller` or `arguments.callee`", recommended: false, - url: "https://eslint.org/docs/rules/no-caller" + url: "https://eslint.org/docs/latest/rules/no-caller" }, schema: [], messages: { unexpected: "Avoid arguments.{{prop}}." } }, - create(context) { return { MemberExpression(node) { const objectName = node.object.name, - propertyName = node.property.name; - + propertyName = node.property.name; if (objectName === "arguments" && !node.computed && propertyName && propertyName.match(/^calle[er]$/u)) { context.report({ node, @@ -88054,14 +77104,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 728 */ +/* 735 */ /***/ ((module) => { "use strict"; @@ -88069,26 +77117,26 @@ module.exports = { * @fileoverview Rule to flag use of an lexical declarations inside a case clause * @author Erik Arvidsson */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow lexical declarations in case clauses", recommended: true, - url: "https://eslint.org/docs/rules/no-case-declarations" + url: "https://eslint.org/docs/latest/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. @@ -88100,20 +77148,16 @@ module.exports = { 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, @@ -88122,14 +77166,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 729 */ +/* 736 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -88138,24 +77180,26 @@ module.exports = { * @author Ian Christian Myers * @deprecated in ESLint v5.1.0 */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow `catch` clause parameters from shadowing variables in the outer scope", recommended: false, - url: "https://eslint.org/docs/rules/no-catch-shadow" + url: "https://eslint.org/docs/latest/rules/no-catch-shadow" }, replacedBy: ["no-shadow"], deprecated: true, @@ -88164,8 +77208,9 @@ module.exports = { mutable: "Value of '{{name}}' may be overwritten in IE 8 and earlier." } }, - create(context) { + const sourceCode = context.sourceCode; + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -88178,23 +77223,23 @@ module.exports = { */ function paramIsShadowing(scope, name) { return astUtils.getVariableByName(scope, name) !== null; - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public API //-------------------------------------------------------------------------- - return { "CatchClause[param!=null]"(node) { - let scope = context.getScope(); + let scope = sourceCode.getScope(node); + /* * 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, @@ -88205,14 +77250,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 730 */ +/* 737 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -88222,28 +77265,30 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow reassigning class members", recommended: true, - url: "https://eslint.org/docs/rules/no-class-assign" + url: "https://eslint.org/docs/latest/rules/no-class-assign" }, schema: [], messages: { class: "'{{name}}' is a class." } }, - create(context) { + const sourceCode = context.sourceCode; + /** * Finds and reports references that are non initializer and writable. * @param {Variable} variable A variable to check. @@ -88260,27 +77305,24 @@ module.exports = { }); }); } + /** * 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); + sourceCode.getDeclaredVariables(node).forEach(checkVariable); } - return { ClassDeclaration: checkForClass, ClassExpression: checkForClass }; } - }; /***/ }), -/* 731 */ +/* 738 */ /***/ ((module) => { "use strict"; @@ -88288,19 +77330,20 @@ module.exports = { * @fileoverview The rule should warn against code that tries to compare against -0. * @author Aladdin-ADD */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow comparing against -0", recommended: true, - url: "https://eslint.org/docs/rules/no-compare-neg-zero" + url: "https://eslint.org/docs/latest/rules/no-compare-neg-zero" }, fixable: null, schema: [], @@ -88308,7 +77351,6 @@ module.exports = { unexpected: "Do not use the '{{operator}}' operator to compare against -0." } }, - create(context) { //-------------------------------------------------------------------------- // Helpers @@ -88322,7 +77364,6 @@ module.exports = { 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) { @@ -88338,14 +77379,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 732 */ +/* 739 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -88353,34 +77392,38 @@ module.exports = { * @fileoverview Rule to flag assignment in a conditional statement's test expression * @author Stephen Murray */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // 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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow assignment operators in conditional expressions", recommended: true, - url: "https://eslint.org/docs/rules/no-cond-assign" + url: "https://eslint.org/docs/latest/rules/no-cond-assign" }, schema: [{ enum: ["except-parens", "always"] @@ -88391,56 +77434,50 @@ module.exports = { missing: "Expected a conditional expression and instead saw an assignment." } }, - create(context) { const prohibitAssign = context.options[0] || "except-parens"; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * 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); + 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({ @@ -88449,16 +77486,14 @@ module.exports = { }); } } + /** * 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, @@ -88469,13 +77504,11 @@ module.exports = { }); } } - if (prohibitAssign === "always") { return { AssignmentExpression: testForConditionalAncestor }; } - return { DoWhileStatement: testForAssign, ForStatement: testForAssign, @@ -88484,11 +77517,10 @@ module.exports = { ConditionalExpression: testForAssign }; } - }; /***/ }), -/* 733 */ +/* 740 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -88499,7 +77531,10 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -88508,24 +77543,22 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow arrow functions where they could be confused with comparisons", recommended: false, - url: "https://eslint.org/docs/rules/no-confusing-arrow" + url: "https://eslint.org/docs/latest/rules/no-confusing-arrow" }, fixable: "code", schema: [{ @@ -88546,44 +77579,38 @@ module.exports = { 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 onlyOneSimpleParam = config.onlyOneSimpleParam; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * 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)) && !(onlyOneSimpleParam && !(node.params.length === 1 && node.params[0].type === "Identifier"))) { 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 }; } - }; /***/ }), -/* 734 */ +/* 741 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -88591,24 +77618,26 @@ module.exports = { * @fileoverview Rule to flag use of console object * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow the use of `console`", recommended: false, - url: "https://eslint.org/docs/rules/no-console" + url: "https://eslint.org/docs/latest/rules/no-console" }, schema: [{ type: "object", @@ -88628,32 +77657,32 @@ module.exports = { unexpected: "Unexpected console statement." } }, - create(context) { const options = context.options[0] || {}; const allowed = options.allow || []; + const sourceCode = context.sourceCode; + /** * 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.includes(propertyName); } + /** * Checks whether the given reference is a member access which is not * allowed by options or not. @@ -88661,20 +77690,17 @@ module.exports = { * @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({ @@ -88683,32 +77709,28 @@ module.exports = { messageId: "unexpected" }); } - return { - "Program:exit"() { - const scope = context.getScope(); + "Program:exit"(node) { + const scope = sourceCode.getScope(node); 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); } } - }; } - }; /***/ }), -/* 735 */ +/* 742 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -88718,28 +77740,30 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow reassigning `const` variables", recommended: true, - url: "https://eslint.org/docs/rules/no-const-assign" + url: "https://eslint.org/docs/latest/rules/no-const-assign" }, schema: [], messages: { const: "'{{name}}' is constant." } }, - create(context) { + const sourceCode = context.sourceCode; + /** * Finds and reports references that are non initializer and writable. * @param {Variable} variable A variable to check. @@ -88756,21 +77780,18 @@ module.exports = { }); }); } - return { VariableDeclaration(node) { if (node.kind === "const") { - context.getDeclaredVariables(node).forEach(checkVariable); + sourceCode.getDeclaredVariables(node).forEach(checkVariable); } } - }; } - }; /***/ }), -/* 736 */ +/* 743 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -88780,19 +77801,33 @@ module.exports = { */ -const globals = __webpack_require__(563); +const globals = __webpack_require__(586); const { isNullLiteral, isConstant, isReferenceToGlobalVariable, isLogicalAssignmentOperator -} = __webpack_require__(618); +} = __webpack_require__(639); +const NUMERIC_OR_STRING_BINARY_OPERATORS = new Set(["+", "-", "*", "/", "%", "|", "^", "&", "**", "<<", ">>", ">>>"]); -const NUMERIC_OR_STRING_BINARY_OPERATORS = new Set(["+", "-", "*", "/", "%", "|", "^", "&", "**", "<<", ">>", ">>>"]); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ +/** + * Checks whether or not a node is `null` or `undefined`. Similar to the one + * found in ast-utils.js, but this one correctly handles the edge case that + * `undefined` has been redefined. + * @param {Scope} scope Scope in which the expression was found. + * @param {ASTNode} node A node to check. + * @returns {boolean} Whether or not the node is a `null` or `undefined`. + * @public + */ +function isNullOrUndefined(scope, node) { + return isNullLiteral(node) || node.type === "Identifier" && node.name === "undefined" && isReferenceToGlobalVariable(scope, node) || node.type === "UnaryExpression" && node.operator === "void"; +} + /** * Test if an AST node has a statically knowable constant nullishness. Meaning, * it will always resolve to a constant value of either: `null`, `undefined` @@ -88800,65 +77835,58 @@ const NUMERIC_OR_STRING_BINARY_OPERATORS = new Set(["+", "-", "*", "/", "%", "|" * three states at runtime would return `false`. * @param {Scope} scope The scope in which the node was found. * @param {ASTNode} node The AST node being tested. + * @param {boolean} nonNullish if `true` then nullish values are not considered constant. * @returns {boolean} Does `node` have constant nullishness? */ - -function hasConstantNullishness(scope, node) { +function hasConstantNullishness(scope, node, nonNullish) { + if (nonNullish && isNullOrUndefined(scope, node)) { + return false; + } switch (node.type) { case "ObjectExpression": // Objects are never nullish - case "ArrayExpression": // Arrays are never nullish - case "ArrowFunctionExpression": // Functions never nullish - case "FunctionExpression": // Functions are never nullish - case "ClassExpression": // Classes are never nullish - case "NewExpression": // Objects are never nullish - case "Literal": // Nullish, or non-nullish, literals never change - case "TemplateLiteral": // A string is never nullish - case "UpdateExpression": // Numbers are never nullish - case "BinaryExpression": // Numbers, strings, or booleans are never nullish return true; - case "CallExpression": { if (node.callee.type !== "Identifier") { return false; } - const functionName = node.callee.name; return (functionName === "Boolean" || functionName === "String" || functionName === "Number") && isReferenceToGlobalVariable(scope, node.callee); } - + case "LogicalExpression": + { + return node.operator === "??" && hasConstantNullishness(scope, node.right, true); + } case "AssignmentExpression": if (node.operator === "=") { - return hasConstantNullishness(scope, node.right); + return hasConstantNullishness(scope, node.right, nonNullish); } + /* * Handling short-circuiting assignment operators would require * walking the scope. We won't attempt that (for now...) / */ - - if (isLogicalAssignmentOperator(node.operator)) { return false; } + /* * The remaining assignment expressions all result in a numeric or * string (non-nullish) value: * "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "|=", "^=", "&=" */ - return true; - case "UnaryExpression": /* * "void" Always returns `undefined` @@ -88868,26 +77896,23 @@ function hasConstantNullishness(scope, node) { * Math operators always return numbers or strings, neither of which * are non-nullish "+", "-", "~" */ - return true; + return true; case "SequenceExpression": { const last = node.expressions[node.expressions.length - 1]; - return hasConstantNullishness(scope, last); + return hasConstantNullishness(scope, last, nonNullish); } - case "Identifier": return node.name === "undefined" && isReferenceToGlobalVariable(scope, node); - case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior. - case "JSXFragment": return false; - default: return false; } } + /** * Test if an AST node is a boolean value that never changes. Specifically we * test for: @@ -88898,23 +77923,19 @@ function hasConstantNullishness(scope, node) { * @param {ASTNode} node The node to test * @returns {boolean} Is `node` guaranteed to be a boolean? */ - - function isStaticBoolean(scope, node) { switch (node.type) { case "Literal": return typeof node.value === "boolean"; - case "CallExpression": return node.callee.type === "Identifier" && node.callee.name === "Boolean" && isReferenceToGlobalVariable(scope, node.callee) && (node.arguments.length === 0 || isConstant(scope, node.arguments[0], true)); - case "UnaryExpression": return node.operator === "!" && isConstant(scope, node.argument, true); - default: return false; } } + /** * Test if an AST node will always give the same result when compared to a * boolean value. Note that comparison to boolean values is different than @@ -88927,8 +77948,6 @@ function isStaticBoolean(scope, node) { * @param {ASTNode} node The node to test. * @returns {boolean} Will `node` always coerce to the same boolean value? */ - - function hasConstantLooseBooleanComparison(scope, node) { switch (node.type) { case "ObjectExpression": @@ -88948,65 +77967,56 @@ function hasConstantLooseBooleanComparison(scope, node) { * false, but it's an edge case we've opted not to handle. */ return true; - case "ArrayExpression": { - const nonSpreadElements = node.elements.filter(e => // Elements can be `null` in sparse arrays: `[,,]`; + const nonSpreadElements = node.elements.filter(e => + // Elements can be `null` in sparse arrays: `[,,]`; e !== null && e.type !== "SpreadElement"); + /* * Possible future direction if needed: We could check if the * single value would result in variable boolean comparison. * For now we will err on the side of caution since `[x]` could * evaluate to `[0]` or `[1]`. */ - return node.elements.length === 0 || nonSpreadElements.length > 1; } - case "ArrowFunctionExpression": case "FunctionExpression": return true; - case "UnaryExpression": - if (node.operator === "void" || // Always returns `undefined` + if (node.operator === "void" || + // Always returns `undefined` node.operator === "typeof" // All `typeof` strings, when coerced to number, are not 0 or 1. ) { return true; } - if (node.operator === "!") { return isConstant(scope, node.argument, true); } + /* * We won't try to reason about +, -, ~, or delete * In theory, for the mathematical operators, we could look at the * argument and try to determine if it coerces to a constant numeric * value. */ - - return false; - case "NewExpression": // Objects might have custom `.valueOf` or `.toString`. return false; - case "CallExpression": { if (node.callee.type === "Identifier" && node.callee.name === "Boolean" && isReferenceToGlobalVariable(scope, node.callee)) { return node.arguments.length === 0 || isConstant(scope, node.arguments[0], true); } - return false; } - case "Literal": // True or false, literals never change return true; - case "Identifier": return node.name === "undefined" && isReferenceToGlobalVariable(scope, node); - case "TemplateLiteral": /* * In theory we could try to check if the quasi are sufficient to @@ -89014,11 +78024,11 @@ function hasConstantLooseBooleanComparison(scope, node) { * tricky to get right. For example: `000.${foo}000` */ return node.expressions.length === 0; - case "AssignmentExpression": if (node.operator === "=") { return hasConstantLooseBooleanComparison(scope, node.right); } + /* * Handling short-circuiting assignment operators would require * walking the scope. We won't attempt that (for now...) @@ -89027,25 +78037,20 @@ function hasConstantLooseBooleanComparison(scope, node) { * string (non-nullish) values which could be truthy or falsy: * "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "|=", "^=", "&=" */ - - return false; - case "SequenceExpression": { const last = node.expressions[node.expressions.length - 1]; return hasConstantLooseBooleanComparison(scope, last); } - case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior. - case "JSXFragment": return false; - default: return false; } } + /** * Test if an AST node will always give the same result when _strictly_ compared * to a boolean value. This can happen if the expression can never be boolean, or @@ -89055,116 +78060,89 @@ function hasConstantLooseBooleanComparison(scope, node) { * @returns {boolean} Will `node` always give the same result when compared to a * static boolean value? */ - - function hasConstantStrictBooleanComparison(scope, node) { switch (node.type) { case "ObjectExpression": // Objects are not booleans - case "ArrayExpression": // Arrays are not booleans - case "ArrowFunctionExpression": // Functions are not booleans - case "FunctionExpression": case "ClassExpression": // Classes are not booleans - case "NewExpression": // Objects are not booleans - case "TemplateLiteral": // Strings are not booleans - case "Literal": // True, false, or not boolean, literals never change. - case "UpdateExpression": // Numbers are not booleans return true; - case "BinaryExpression": return NUMERIC_OR_STRING_BINARY_OPERATORS.has(node.operator); - case "UnaryExpression": { if (node.operator === "delete") { return false; } - if (node.operator === "!") { return isConstant(scope, node.argument, true); } + /* * The remaining operators return either strings or numbers, neither * of which are boolean. */ - - return true; } - case "SequenceExpression": { const last = node.expressions[node.expressions.length - 1]; return hasConstantStrictBooleanComparison(scope, last); } - case "Identifier": return node.name === "undefined" && isReferenceToGlobalVariable(scope, node); - case "AssignmentExpression": if (node.operator === "=") { return hasConstantStrictBooleanComparison(scope, node.right); } + /* * Handling short-circuiting assignment operators would require * walking the scope. We won't attempt that (for now...) */ - - if (isLogicalAssignmentOperator(node.operator)) { return false; } + /* * The remaining assignment expressions all result in either a number * or a string, neither of which can ever be boolean. */ - - return true; - case "CallExpression": { if (node.callee.type !== "Identifier") { return false; } - const functionName = node.callee.name; - if ((functionName === "String" || functionName === "Number") && isReferenceToGlobalVariable(scope, node.callee)) { return true; } - if (functionName === "Boolean" && isReferenceToGlobalVariable(scope, node.callee)) { return node.arguments.length === 0 || isConstant(scope, node.arguments[0], true); } - return false; } - case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior. - case "JSXFragment": return false; - default: return false; } } + /** * Test if an AST node will always result in a newly constructed object * @param {Scope} scope The scope in which the node was found. * @param {ASTNode} node The node to test * @returns {boolean} Will `node` always be new? */ - - function isAlwaysNew(scope, node) { switch (node.type) { case "ObjectExpression": @@ -89173,68 +78151,45 @@ function isAlwaysNew(scope, node) { case "FunctionExpression": case "ClassExpression": return true; - case "NewExpression": { if (node.callee.type !== "Identifier") { return false; } + /* * All the built-in constructors are always new, but * user-defined constructors could return a sentinel * object. * - * Catching these is especially useful for primitive constructures + * Catching these is especially useful for primitive constructors * which return boxed values, a surprising gotcha' in JavaScript. */ - - return Object.hasOwnProperty.call(globals.builtin, node.callee.name) && isReferenceToGlobalVariable(scope, node.callee); } - case "Literal": // Regular expressions are objects, and thus always new return typeof node.regex === "object"; - case "SequenceExpression": { const last = node.expressions[node.expressions.length - 1]; return isAlwaysNew(scope, last); } - case "AssignmentExpression": if (node.operator === "=") { return isAlwaysNew(scope, node.right); } - return false; - case "ConditionalExpression": return isAlwaysNew(scope, node.consequent) && isAlwaysNew(scope, node.alternate); - case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior. - case "JSXFragment": return false; - default: return false; } } -/** - * Checks whether or not a node is `null` or `undefined`. Similar to the one - * found in ast-utils.js, but this one correctly handles the edge case that - * `undefined` has been redefined. - * @param {Scope} scope Scope in which the expression was found. - * @param {ASTNode} node A node to check. - * @returns {boolean} Whether or not the node is a `null` or `undefined`. - * @public - */ - -function isNullOrUndefined(scope, node) { - return isNullLiteral(node) || node.type === "Identifier" && node.name === "undefined" && isReferenceToGlobalVariable(scope, node) || node.type === "UnaryExpression" && node.operator === "void"; -} /** * Checks if one operand will cause the result to be constant. * @param {Scope} scope Scope in which the expression was found. @@ -89243,34 +78198,31 @@ function isNullOrUndefined(scope, node) { * @param {string} operator The binary expression operator * @returns {ASTNode | null} The node which will cause the expression to have a constant result. */ - - function findBinaryExpressionConstantOperand(scope, a, b, operator) { if (operator === "==" || operator === "!=") { - if (isNullOrUndefined(scope, a) && hasConstantNullishness(scope, b) || isStaticBoolean(scope, a) && hasConstantLooseBooleanComparison(scope, b)) { + if (isNullOrUndefined(scope, a) && hasConstantNullishness(scope, b, false) || isStaticBoolean(scope, a) && hasConstantLooseBooleanComparison(scope, b)) { return b; } } else if (operator === "===" || operator === "!==") { - if (isNullOrUndefined(scope, a) && hasConstantNullishness(scope, b) || isStaticBoolean(scope, a) && hasConstantStrictBooleanComparison(scope, b)) { + if (isNullOrUndefined(scope, a) && hasConstantNullishness(scope, b, false) || isStaticBoolean(scope, a) && hasConstantStrictBooleanComparison(scope, b)) { return b; } } - return null; -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow expressions where the operation doesn't affect the value", recommended: false, - url: "https://eslint.org/docs/rules/no-constant-binary-expression" + url: "https://eslint.org/docs/latest/rules/no-constant-binary-expression" }, schema: [], messages: { @@ -89280,16 +78232,15 @@ module.exports = { bothAlwaysNew: "Unexpected comparison of two newly constructed objects. These two values can never be equal." } }, - create(context) { + const sourceCode = context.sourceCode; return { LogicalExpression(node) { const { operator, left } = node; - const scope = context.getScope(); - + const scope = sourceCode.getScope(node); if ((operator === "&&" || operator === "||") && isConstant(scope, left, true)) { context.report({ node: left, @@ -89299,7 +78250,7 @@ module.exports = { operator } }); - } else if (operator === "??" && hasConstantNullishness(scope, left)) { + } else if (operator === "??" && hasConstantNullishness(scope, left, false)) { context.report({ node: left, messageId: "constantShortCircuit", @@ -89310,9 +78261,8 @@ module.exports = { }); } }, - BinaryExpression(node) { - const scope = context.getScope(); + const scope = sourceCode.getScope(node); const { right, left, @@ -89320,7 +78270,6 @@ module.exports = { } = node; const rightConstantOperand = findBinaryExpressionConstantOperand(scope, left, right, operator); const leftConstantOperand = findBinaryExpressionConstantOperand(scope, right, left, operator); - if (rightConstantOperand) { context.report({ node: rightConstantOperand, @@ -89365,6 +78314,7 @@ module.exports = { } } } + /* * In theory we could handle short-circuiting assignment operators, * for some constant values, but that would require walking the @@ -89373,15 +78323,12 @@ module.exports = { * * AssignmentExpression() {}, */ - - }; } - }; /***/ }), -/* 737 */ +/* 744 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -89391,25 +78338,27 @@ module.exports = { */ + const { isConstant -} = __webpack_require__(618); //------------------------------------------------------------------------------ +} = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow constant expressions in conditions", recommended: true, - url: "https://eslint.org/docs/rules/no-constant-condition" + url: "https://eslint.org/docs/latest/rules/no-constant-condition" }, schema: [{ type: "object", @@ -89425,12 +78374,14 @@ module.exports = { unexpected: "Unexpected constant condition." } }, - create(context) { const options = context.options[0] || {}, - checkLoops = options.checkLoops !== false, - loopSetStack = []; - let loopsInCurrentScope = new Set(); //-------------------------------------------------------------------------- + checkLoops = options.checkLoops !== false, + loopSetStack = []; + const sourceCode = context.sourceCode; + let loopsInCurrentScope = new Set(); + + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -89440,20 +78391,18 @@ module.exports = { * @returns {void} * @private */ - function trackConstantConditionLoop(node) { - if (node.test && isConstant(context.getScope(), node.test, true)) { + if (node.test && isConstant(sourceCode.getScope(node), 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); @@ -89463,61 +78412,58 @@ module.exports = { }); } } + /** * 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(context.getScope(), node.test, true)) { + if (node.test && isConstant(sourceCode.getScope(node), 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, @@ -89535,11 +78481,10 @@ module.exports = { YieldExpression: () => loopsInCurrentScope.clear() }; } - }; /***/ }), -/* 738 */ +/* 745 */ /***/ ((module) => { "use strict"; @@ -89547,19 +78492,21 @@ module.exports = { * @fileoverview Rule to disallow returning value from constructor. * @author Pig Fang */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow returning value from constructor", recommended: false, - url: "https://eslint.org/docs/rules/no-constructor-return" + url: "https://eslint.org/docs/latest/rules/no-constructor-return" }, schema: {}, fixable: null, @@ -89567,25 +78514,20 @@ module.exports = { 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, @@ -89593,14 +78535,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 739 */ +/* 746 */ /***/ ((module) => { "use strict"; @@ -89608,26 +78548,27 @@ module.exports = { * @fileoverview Rule to flag use of continue statement * @author Borislav Zhivkov */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow `continue` statements", recommended: false, - url: "https://eslint.org/docs/rules/no-continue" + url: "https://eslint.org/docs/latest/rules/no-continue" }, schema: [], messages: { unexpected: "Unexpected use of continue statement." } }, - create(context) { return { ContinueStatement(node) { @@ -89636,14 +78577,12 @@ module.exports = { messageId: "unexpected" }); } - }; } - }; /***/ }), -/* 740 */ +/* 747 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -89653,59 +78592,53 @@ module.exports = { */ -const RegExpValidator = (__webpack_require__(741).RegExpValidator); +const RegExpValidator = (__webpack_require__(748).RegExpValidator); const collector = new class { constructor() { 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, flags) { const uFlag = typeof flags === "string" && flags.includes("u"); - try { this._source = regexpStr; - this._validator.validatePattern(regexpStr, void 0, void 0, uFlag); // Call onCharacter hook + } catch { - } catch {// Ignore syntax errors in RegExp. + // Ignore syntax errors in RegExp. } - return this._controlChars; } +}(); -}(); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow control characters in regular expressions", recommended: true, - url: "https://eslint.org/docs/rules/no-control-regex" + url: "https://eslint.org/docs/latest/rules/no-control-regex" }, schema: [], messages: { unexpected: "Unexpected control character(s) in regular expression: {{controlChars}}." } }, - create(context) { /** * Get the regex expression @@ -89719,7 +78652,6 @@ module.exports = { if (node.regex) { return node.regex; } - 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) { const pattern = node.value; const flags = node.parent.arguments.length > 1 && node.parent.arguments[1].type === "Literal" && typeof node.parent.arguments[1].value === "string" ? node.parent.arguments[1].value : null; @@ -89728,21 +78660,17 @@ module.exports = { flags }; } - return null; } - return { Literal(node) { const regExp = getRegExp(node); - if (regExp) { const { pattern, flags } = regExp; const controlCharacters = collector.collectControlChars(pattern, flags); - if (controlCharacters.length > 0) { context.report({ node, @@ -89754,27 +78682,25 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 741 */ +/* 748 */ /***/ ((__unused_webpack_module, exports) => { "use strict"; -/*! @author Toru Nagashima */ Object.defineProperty(exports, "__esModule", ({ value: true })); -var ast = /*#__PURE__*/Object.freeze({}); +var ast = /*#__PURE__*/Object.freeze({ + __proto__: null +}); let largeIdStartRanges = undefined; let largeIdContinueRanges = undefined; - function isIdStart(cp) { if (cp < 0x41) return false; if (cp < 0x5b) return true; @@ -89782,7 +78708,6 @@ function isIdStart(cp) { if (cp < 0x7b) return true; return isLargeIdStart(cp); } - function isIdContinue(cp) { if (cp < 0x30) return false; if (cp < 0x3a) return true; @@ -89793,35 +78718,28 @@ function isIdContinue(cp) { if (cp < 0x7b) return true; return isLargeIdStart(cp) || isLargeIdContinue(cp); } - function isLargeIdStart(cp) { - return isInRange(cp, largeIdStartRanges || (largeIdStartRanges = initLargeIdStartRanges())); + return isInRange(cp, largeIdStartRanges !== null && largeIdStartRanges !== void 0 ? largeIdStartRanges : largeIdStartRanges = initLargeIdStartRanges()); } - function isLargeIdContinue(cp) { - return isInRange(cp, largeIdContinueRanges || (largeIdContinueRanges = initLargeIdContinueRanges())); + return isInRange(cp, largeIdContinueRanges !== null && largeIdContinueRanges !== void 0 ? largeIdContinueRanges : largeIdContinueRanges = initLargeIdContinueRanges()); } - function initLargeIdStartRanges() { - return restoreRanges("4q 0 b 0 5 0 6 m 2 u 2 cp 5 b f 4 8 0 2 0 3m 4 2 1 3 3 2 0 7 0 2 2 2 0 2 j 2 2a 2 3u 9 4l 2 11 3 0 7 14 20 q 5 3 1a 16 10 1 2 2q 2 0 g 1 8 1 b 2 3 0 h 0 2 t u 2g c 0 p w a 1 5 0 6 l 5 0 a 0 4 0 o o 8 a 1i k 2 h 1p 1h 4 0 j 0 8 9 g f 5 7 3 1 3 l 2 6 2 0 4 3 4 0 h 0 e 1 2 2 f 1 b 0 9 5 5 1 3 l 2 6 2 1 2 1 2 1 w 3 2 0 k 2 h 8 2 2 2 l 2 6 2 1 2 4 4 0 j 0 g 1 o 0 c 7 3 1 3 l 2 6 2 1 2 4 4 0 v 1 2 2 g 0 i 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 b n 0 1h 7 2 2 2 m 2 f 4 0 r 2 6 1 v 0 5 7 2 2 2 m 2 9 2 4 4 0 x 0 2 1 g 1 i 8 2 2 2 14 3 0 h 0 6 2 9 2 p 5 6 h 4 n 2 8 2 0 3 6 1n 1b 2 1 d 6 1n 1 2 0 2 4 2 n 2 0 2 9 2 1 a 0 3 4 2 0 m 3 x 0 1s 7 2 z s 4 38 16 l 0 h 5 5 3 4 0 4 1 8 2 5 c d 0 i 11 2 0 6 0 3 16 2 98 2 3 3 6 2 0 2 3 3 14 2 3 3 w 2 3 3 6 2 0 2 3 3 e 2 1k 2 3 3 1u 12 f h 2d 3 5 4 h7 3 g 2 p 6 22 4 a 8 c 2 3 f h f h f c 2 2 g 1f 10 0 5 0 1w 2g 8 14 2 0 6 1x b u 1e t 3 4 c 17 5 p 1j m a 1g 2b 0 2m 1a i 6 1k t e 1 b 17 r z 16 2 b z 3 8 8 16 3 2 16 3 2 5 2 1 4 0 6 5b 1t 7p 3 5 3 11 3 5 3 7 2 0 2 0 2 0 2 u 3 1g 2 6 2 0 4 2 2 6 4 3 3 5 5 c 6 2 2 6 39 0 e 0 h c 2u 0 5 0 3 9 2 0 3 5 7 0 2 0 2 0 2 f 3 3 6 4 5 0 i 14 22g 1a 2 1a 2 3o 7 3 4 1 d 11 2 0 6 0 3 1j 8 0 h m a 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 fb 2 q 8 8 4 3 4 5 2d 5 4 2 2h 2 3 6 16 2 2l i v 1d f e9 533 1t g70 4 wc 1w 19 3 7g 4 f b 1 l 1a h u 3 27 14 8 3 2u 3 1g 3 8 17 c 2 2 2 3 2 m u 1f f 1d 1r 5 4 0 2 1 c r b m q s 8 1a t 0 h 4 2 9 b 4 2 14 o 2 2 7 l m 4 0 4 1d 2 0 4 1 3 4 3 0 2 0 p 2 3 a 8 2 d 5 3 5 3 5 a 6 2 6 2 16 2 d 7 36 u 8mb d m 5 1c 6it a5 3 2x 13 6 d 4 6 0 2 9 2 c 2 4 2 0 2 1 2 1 2 2z y a2 j 1r 3 1h 15 b 39 4 2 3q 11 p 7 p c 2g 4 5 3 5 3 5 3 2 10 b 2 p 2 i 2 1 2 e 3 d z 3e 1y 1g 7g s 4 1c 1c v e t 6 11 b t 3 z 5 7 2 4 17 4d j z 5 z 5 13 9 1f 4d 8m a l b 7 49 5 3 0 2 17 2 1 4 0 3 m b m a u 1u i 2 1 b l b p 1z 1j 7 1 1t 0 g 3 2 2 2 s 17 s 4 s 10 7 2 r s 1h b l b i e h 33 20 1k 1e e 1e e z 9p 15 7 1 27 s b 0 9 l 2z k s m d 1g 24 18 x o r z u 0 3 0 9 y 4 0 d 1b f 3 m 0 2 0 10 h 2 o 2d 6 2 0 2 3 2 e 2 9 8 1a 13 7 3 1 3 l 2 6 2 1 2 4 4 0 j 0 d 4 4f 1g j 3 l 2 v 1b l 1 2 0 55 1a 16 3 11 1b l 0 1o 16 e 0 20 q 6e 17 39 1r w 7 3 0 3 7 2 1 2 n g 0 2 0 2n 7 3 12 h 0 2 0 t 0 b 13 8 0 m 0 c 19 k 0 z 1k 7c 8 2 10 i 0 1e t 35 6 2 1 2 11 m 0 q 5 2 1 2 v f 0 94 i 5a 0 28 pl 2v 32 i 5f 24d tq 34i g6 6nu fs 8 u 36 t j 1b h 3 w k 6 i j5 1r 3l 22 6 0 1v c 1t 1 2 0 t 4qf 9 yd 17 8 6wo 7y 1e 2 i 3 9 az 1s5 2y 6 c 4 8 8 9 4mf 2c 2 1y 2 1 3 0 3 1 3 3 2 b 2 0 2 6 2 1s 2 3 3 7 2 6 2 r 2 3 2 4 2 0 4 6 2 9f 3 o 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 7 1th 18 b 6 h 0 aa 17 105 5g 1o 1v 8 0 xh 3 2 q 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 g 6 2 2 4 2 g 3et wyl z 378 c 65 3 4g1 f 5rk 2e8 f1 15v 3t6"); + return restoreRanges("4q 0 b 0 5 0 6 m 2 u 2 cp 5 b f 4 8 0 2 0 3m 4 2 1 3 3 2 0 7 0 2 2 2 0 2 j 2 2a 2 3u 9 4l 2 11 3 0 7 14 20 q 5 3 1a 16 10 1 2 2q 2 0 g 1 8 1 b 2 3 0 h 0 2 t u 2g c 0 p w a 1 5 0 6 l 5 0 a 0 4 0 o o 8 a 6 n 2 5 i 15 1n 1h 4 0 j 0 8 9 g f 5 7 3 1 3 l 2 6 2 0 4 3 4 0 h 0 e 1 2 2 f 1 b 0 9 5 5 1 3 l 2 6 2 1 2 1 2 1 w 3 2 0 k 2 h 8 2 2 2 l 2 6 2 1 2 4 4 0 j 0 g 1 o 0 c 7 3 1 3 l 2 6 2 1 2 4 4 0 v 1 2 2 g 0 i 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 b n 0 1h 7 2 2 2 m 2 f 4 0 r 2 3 0 3 1 v 0 5 7 2 2 2 m 2 9 2 4 4 0 w 1 2 1 g 1 i 8 2 2 2 14 3 0 h 0 6 2 9 2 p 5 6 h 4 n 2 8 2 0 3 6 1n 1b 2 1 d 6 1n 1 2 0 2 4 2 n 2 0 2 9 2 1 a 0 3 4 2 0 m 3 x 0 1s 7 2 z s 4 38 16 l 0 h 5 5 3 4 0 4 1 8 2 5 c d 0 i 11 2 0 6 0 3 16 2 98 2 3 3 6 2 0 2 3 3 14 2 3 3 w 2 3 3 6 2 0 2 3 3 e 2 1k 2 3 3 1u 12 f h 2d 3 5 4 h7 3 g 2 p 6 22 4 a 8 h e i f h f c 2 2 g 1f 10 0 5 0 1w 2g 8 14 2 0 6 1x b u 1e t 3 4 c 17 5 p 1j m a 1g 2b 0 2m 1a i 7 1j t e 1 b 17 r z 16 2 b z 3 8 8 16 3 2 16 3 2 5 2 1 4 0 6 5b 1t 7p 3 5 3 11 3 5 3 7 2 0 2 0 2 0 2 u 3 1g 2 6 2 0 4 2 2 6 4 3 3 5 5 c 6 2 2 6 39 0 e 0 h c 2u 0 5 0 3 9 2 0 3 5 7 0 2 0 2 0 2 f 3 3 6 4 5 0 i 14 22g 6c 7 3 4 1 d 11 2 0 6 0 3 1j 8 0 h m a 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 fb 2 q 8 8 4 3 4 5 2d 5 4 2 2h 2 3 6 16 2 2l i v 1d f e9 533 1t h3g 1w 19 3 7g 4 f b 1 l 1a h u 3 27 14 8 3 2u 3 1r 6 1 2 0 2 4 p f 2 2 2 3 2 m u 1f f 1d 1r 5 4 0 2 1 c r b m q s 8 1a t 0 h 4 2 9 b 4 2 14 o 2 2 7 l m 4 0 4 1d 2 0 4 1 3 4 3 0 2 0 p 2 3 a 8 2 d 5 3 5 3 5 a 6 2 6 2 16 2 d 7 36 u 8mb d m 5 1c 6it a5 3 2x 13 6 d 4 6 0 2 9 2 c 2 4 2 0 2 1 2 1 2 2z y a2 j 1r 3 1h 15 b 39 4 2 3q 11 p 7 p c 2g 4 5 3 5 3 5 3 2 10 b 2 p 2 i 2 1 2 e 3 d z 3e 1y 1g 7g s 4 1c 1c v e t 6 11 b t 3 z 5 7 2 4 17 4d j z 5 z 5 13 9 1f d a 2 e 2 6 2 1 2 a 2 e 2 6 2 1 1w 8m a l b 7 p 5 2 15 2 8 1y 5 3 0 2 17 2 1 4 0 3 m b m a u 1u i 2 1 b l b p 1z 1j 7 1 1t 0 g 3 2 2 2 s 17 s 4 s 10 7 2 r s 1h b l b i e h 33 20 1k 1e e 1e e z 9p 15 7 1 27 s b 0 9 l 17 h 1b k s m d 1g 1m 1 3 0 e 18 x o r z u 0 3 0 9 y 4 0 d 1b f 3 m 0 2 0 10 h 2 o k 1 1s 6 2 0 2 3 2 e 2 9 8 1a 13 7 3 1 3 l 2 6 2 1 2 4 4 0 j 0 d 4 4f 1g j 3 l 2 v 1b l 1 2 0 55 1a 16 3 11 1b l 0 1o 16 e 0 20 q 12 6 56 17 39 1r w 7 3 0 3 7 2 1 2 n g 0 2 0 2n 7 3 12 h 0 2 0 t 0 b 13 8 0 m 0 c 19 k 0 j 20 7c 8 2 10 i 0 1e t 35 6 2 1 2 11 m 0 q 5 2 1 2 v f 0 94 i g 0 2 c 2 x 3h 0 28 pl 2v 32 i 5f 219 2o g tr i 5 33u g6 6nu fs 8 u i 26 i t j 1b h 3 w k 6 i j5 1r 3l 22 6 0 1v c 1t 1 2 0 t 4qf 9 yd 17 8 6w8 3 2 6 2 1 2 82 g 0 u 2 3 0 f 3 9 az 1s5 2y 6 c 4 8 8 9 4mf 2c 2 1y 2 1 3 0 3 1 3 3 2 b 2 0 2 6 2 1s 2 3 3 7 2 6 2 r 2 3 2 4 2 0 4 6 2 9f 3 o 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 7 1f9 u 7 5 7a 1p 43 18 b 6 h 0 8y t j 17 dh r l1 6 2 3 2 1 2 e 2 5g 1o 1v 8 0 xh 3 2 q 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 g 6 2 2 4 2 g 3et wyn x 37d 7 65 3 4g1 f 5rk 2e8 f1 15v 3t6 6 38f"); } - function initLargeIdContinueRanges() { - return restoreRanges("53 0 g9 33 o 0 70 4 7e 18 2 0 2 1 2 1 2 0 21 a 1d u 7 0 2u 6 3 5 3 1 2 3 3 9 o 0 v q 2k a g 9 y 8 a 0 p 3 2 8 2 2 2 4 18 2 3c e 2 w 1j 2 2 h 2 6 b 1 3 9 i 2 1l 0 2 6 3 1 3 2 a 0 b 1 3 9 f 0 3 2 1l 0 2 4 5 1 3 2 4 0 l b 4 0 c 2 1l 0 2 7 2 2 2 2 l 1 3 9 b 5 2 2 1l 0 2 6 3 1 3 2 8 2 b 1 3 9 j 0 1o 4 4 2 2 3 a 0 f 9 h 4 1m 6 2 2 2 3 8 1 c 1 3 9 i 2 1l 0 2 6 2 2 2 3 8 1 c 1 3 9 h 3 1k 1 2 6 2 2 2 3 a 0 b 1 3 9 i 2 1z 0 5 5 2 0 2 7 7 9 3 1 1q 0 3 6 d 7 2 9 2g 0 3 8 c 5 3 9 1r 1 7 9 c 0 2 0 2 0 5 1 1e j 2 1 6 a 2 z a 0 2t j 2 9 d 3 5 2 2 2 3 6 4 3 e b 2 e jk 2 a 8 pt 2 u 2 u 1 v 1 1t v a 0 3 9 y 2 3 9 40 0 3b b 5 b b 9 3l a 1p 4 1m 9 2 s 3 a 7 9 n d 2 1 1s 4 1c g c 9 i 8 d 2 v c 3 9 19 d 1d j 9 9 7 9 3b 2 2 k 5 0 7 0 3 2 5j 1l 2 4 g0 1 k 0 3g c 5 0 4 b 2db 2 3y 0 2p v ff 5 2y 1 n7q 9 1y 0 5 9 x 1 29 1 7l 0 4 0 5 0 o 4 5 0 2c 1 1f h b 9 7 h e a t 7 q c 19 3 1c d g 9 c 0 b 9 1c d d 0 9 1 3 9 y 2 1f 0 2 2 3 1 6 1 2 0 16 4 6 1 6l 7 2 1 3 9 fmt 0 ki f h f 4 1 p 2 5d 9 12 0 ji 0 6b 0 46 4 86 9 120 2 2 1 6 3 15 2 5 0 4m 1 fy 3 9 9 aa 1 4a a 4w 2 1i e w 9 g 3 1a a 1i 9 7 2 11 d 2 9 6 1 19 0 d 2 1d d 9 3 2 b 2b b 7 0 4h b 6 9 7 3 1k 1 2 6 3 1 3 2 a 0 b 1 3 6 4 4 5d h a 9 5 0 2a j d 9 5y 6 3 8 s 1 2b g g 9 2a c 9 9 2c e 5 9 6r e 4m 9 1z 5 2 1 3 3 2 0 2 1 d 9 3c 6 3 6 4 0 t 9 15 6 2 3 9 0 a a 1b f ba 7 2 7 h 9 1l l 2 d 3f 5 4 0 2 1 2 6 2 0 9 9 1d 4 2 1 2 4 9 9 96 3 ewa 9 3r 4 1o 6 q 9 s6 0 2 1i 8 3 2a 0 c 1 f58 1 43r 4 4 5 9 7 3 6 v 3 45 2 13e 1d e9 1i 5 1d 9 0 f 0 n 4 2 e 11t 6 2 g 3 6 2 1 2 4 7a 6 a 9 bn d 15j 6 32 6 6 9 3o7 9 gvt3 6n"); + return restoreRanges("53 0 g9 33 o 0 70 4 7e 18 2 0 2 1 2 1 2 0 21 a 1d u 7 0 2u 6 3 5 3 1 2 3 3 9 o 0 v q 2k a g 9 y 8 a 0 p 3 2 8 2 2 2 4 18 2 1p 7 17 n 2 w 1j 2 2 h 2 6 b 1 3 9 i 2 1l 0 2 6 3 1 3 2 a 0 b 1 3 9 f 0 3 2 1l 0 2 4 5 1 3 2 4 0 l b 4 0 c 2 1l 0 2 7 2 2 2 2 l 1 3 9 b 5 2 2 1l 0 2 6 3 1 3 2 8 2 b 1 3 9 j 0 1o 4 4 2 2 3 a 0 f 9 h 4 1k 0 2 6 2 2 2 3 8 1 c 1 3 9 i 2 1l 0 2 6 2 2 2 3 8 1 c 1 3 9 4 0 d 3 1k 1 2 6 2 2 2 3 a 0 b 1 3 9 i 2 1z 0 5 5 2 0 2 7 7 9 3 1 1q 0 3 6 d 7 2 9 2g 0 3 8 c 6 2 9 1r 1 7 9 c 0 2 0 2 0 5 1 1e j 2 1 6 a 2 z a 0 2t j 2 9 d 3 5 2 2 2 3 6 4 3 e b 2 e jk 2 a 8 pt 3 t 2 u 1 v 1 1t v a 0 3 9 y 2 2 a 40 0 3b b 5 b b 9 3l a 1p 4 1m 9 2 s 3 a 7 9 n d 2 f 1e 4 1c g c 9 i 8 d 2 v c 3 9 19 d 1d j 9 9 7 9 3b 2 2 k 5 0 7 0 3 2 5j 1r g0 1 k 0 3g c 5 0 4 b 2db 2 3y 0 2p v ff 5 2y 1 n7q 9 1y 0 5 9 x 1 29 1 7l 0 4 0 5 0 o 4 5 0 2c 1 1f h b 9 7 h e a t 7 q c 19 3 1c d g 9 c 0 b 9 1c d d 0 9 1 3 9 y 2 1f 0 2 2 3 1 6 1 2 0 16 4 6 1 6l 7 2 1 3 9 fmt 0 ki f h f 4 1 p 2 5d 9 12 0 ji 0 6b 0 46 4 86 9 120 2 2 1 6 3 15 2 5 0 4m 1 fy 3 9 9 aa 1 29 2 1z a 1e 3 3f 2 1i e w a 3 1 b 3 1a a 8 0 1a 9 7 2 11 d 2 9 6 1 19 0 d 2 1d d 9 3 2 b 2b b 7 0 3 0 4e b 6 9 7 3 1k 1 2 6 3 1 3 2 a 0 b 1 3 6 4 4 5d h a 9 5 0 2a j d 9 5y 6 3 8 s 1 2b g g 9 2a c 9 9 2c e 5 9 6r e 4m 9 1z 5 2 1 3 3 2 0 2 1 d 9 3c 6 3 6 4 0 t 9 15 6 2 3 9 0 a a 1b f ba 7 2 7 h 9 1l l 2 d 3f 5 4 0 2 1 2 6 2 0 9 9 1d 4 2 1 2 4 9 9 96 3 a 1 2 0 1d 6 4 4 e 9 44n 0 7 e aob 9 2f 9 13 4 1o 6 q 9 s6 0 2 1i 8 3 2a 0 c 1 f58 1 3mq 19 3 m f3 4 4 5 9 7 3 6 v 3 45 2 13e 1d e9 1i 5 1d 9 0 f 0 n 4 2 e 11t 6 2 g 3 6 2 1 2 4 2t 0 4h 6 a 9 9x 0 1q d dv d rb 6 32 6 6 9 3o7 9 gvt3 6n"); } - function isInRange(cp, ranges) { let l = 0, - r = ranges.length / 2 | 0, - i = 0, - min = 0, - max = 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) { @@ -89830,200 +78748,187 @@ function isInRange(cp, ranges) { return true; } } - return false; } - function restoreRanges(data) { let last = 0; return data.split(" ").map(s => last += parseInt(s, 36) | 0); } - class DataSet { - constructor(raw2018, raw2019, raw2020, raw2021) { + constructor(raw2018, raw2019, raw2020, raw2021, raw2022, raw2023, raw2024) { this._raw2018 = raw2018; this._raw2019 = raw2019; this._raw2020 = raw2020; this._raw2021 = raw2021; + this._raw2022 = raw2022; + this._raw2023 = raw2023; + this._raw2024 = raw2024; } - get es2018() { - return this._set2018 || (this._set2018 = new Set(this._raw2018.split(" "))); + var _a; + return (_a = this._set2018) !== null && _a !== void 0 ? _a : this._set2018 = new Set(this._raw2018.split(" ")); } - get es2019() { - return this._set2019 || (this._set2019 = new Set(this._raw2019.split(" "))); + var _a; + return (_a = this._set2019) !== null && _a !== void 0 ? _a : this._set2019 = new Set(this._raw2019.split(" ")); } - get es2020() { - return this._set2020 || (this._set2020 = new Set(this._raw2020.split(" "))); + var _a; + return (_a = this._set2020) !== null && _a !== void 0 ? _a : this._set2020 = new Set(this._raw2020.split(" ")); } - get es2021() { - return this._set2021 || (this._set2021 = new Set(this._raw2021.split(" "))); + var _a; + return (_a = this._set2021) !== null && _a !== void 0 ? _a : this._set2021 = new Set(this._raw2021.split(" ")); + } + get es2022() { + var _a; + return (_a = this._set2022) !== null && _a !== void 0 ? _a : this._set2022 = new Set(this._raw2022.split(" ")); + } + get es2023() { + var _a; + return (_a = this._set2023) !== null && _a !== void 0 ? _a : this._set2023 = new Set(this._raw2023.split(" ")); + } + get es2024() { + var _a; + return (_a = this._set2024) !== null && _a !== void 0 ? _a : this._set2024 = new Set(this._raw2024.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", "Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"); -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", "", "EBase EComp EMod EPres ExtPict"); - +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", "Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", "Cpmn Cypro_Minoan Old_Uyghur Ougr Tangsa Tnsa Toto Vith Vithkuqi", "Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz", ""); +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", "", "EBase EComp EMod EPres ExtPict", "", "", ""); 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) || version >= 2021 && scValueSets.es2021.has(value); + return version >= 2018 && scValueSets.es2018.has(value) || version >= 2019 && scValueSets.es2019.has(value) || version >= 2020 && scValueSets.es2020.has(value) || version >= 2021 && scValueSets.es2021.has(value) || version >= 2022 && scValueSets.es2022.has(value) || version >= 2023 && scValueSets.es2023.has(value); } - return false; } - function isValidLoneUnicodeProperty(version, value) { return version >= 2018 && binPropertySets.es2018.has(value) || version >= 2019 && binPropertySets.es2019.has(value) || version >= 2021 && binPropertySets.es2021.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; - +const BACKSPACE = 0x08; +const CHARACTER_TABULATION = 0x09; +const LINE_FEED = 0x0a; +const LINE_TABULATION = 0x0b; +const FORM_FEED = 0x0c; +const CARRIAGE_RETURN = 0x0d; +const EXCLAMATION_MARK = 0x21; +const DOLLAR_SIGN = 0x24; +const LEFT_PARENTHESIS = 0x28; +const RIGHT_PARENTHESIS = 0x29; +const ASTERISK = 0x2a; +const PLUS_SIGN = 0x2b; +const COMMA = 0x2c; +const HYPHEN_MINUS = 0x2d; +const FULL_STOP = 0x2e; +const SOLIDUS = 0x2f; +const DIGIT_ZERO = 0x30; +const DIGIT_ONE = 0x31; +const DIGIT_SEVEN = 0x37; +const DIGIT_NINE = 0x39; +const COLON = 0x3a; +const LESS_THAN_SIGN = 0x3c; +const EQUALS_SIGN = 0x3d; +const GREATER_THAN_SIGN = 0x3e; +const QUESTION_MARK = 0x3f; +const LATIN_CAPITAL_LETTER_A = 0x41; +const LATIN_CAPITAL_LETTER_B = 0x42; +const LATIN_CAPITAL_LETTER_D = 0x44; +const LATIN_CAPITAL_LETTER_F = 0x46; +const LATIN_CAPITAL_LETTER_P = 0x50; +const LATIN_CAPITAL_LETTER_S = 0x53; +const LATIN_CAPITAL_LETTER_W = 0x57; +const LATIN_CAPITAL_LETTER_Z = 0x5a; +const LOW_LINE = 0x5f; +const LATIN_SMALL_LETTER_A = 0x61; +const LATIN_SMALL_LETTER_B = 0x62; +const LATIN_SMALL_LETTER_C = 0x63; +const LATIN_SMALL_LETTER_D = 0x64; +const LATIN_SMALL_LETTER_F = 0x66; +const LATIN_SMALL_LETTER_G = 0x67; +const LATIN_SMALL_LETTER_I = 0x69; +const LATIN_SMALL_LETTER_K = 0x6b; +const LATIN_SMALL_LETTER_M = 0x6d; +const LATIN_SMALL_LETTER_N = 0x6e; +const LATIN_SMALL_LETTER_P = 0x70; +const LATIN_SMALL_LETTER_R = 0x72; +const LATIN_SMALL_LETTER_S = 0x73; +const LATIN_SMALL_LETTER_T = 0x74; +const LATIN_SMALL_LETTER_U = 0x75; +const LATIN_SMALL_LETTER_V = 0x76; +const LATIN_SMALL_LETTER_W = 0x77; +const LATIN_SMALL_LETTER_X = 0x78; +const LATIN_SMALL_LETTER_Y = 0x79; +const LATIN_SMALL_LETTER_Z = 0x7a; +const LEFT_SQUARE_BRACKET = 0x5b; +const REVERSE_SOLIDUS = 0x5c; +const RIGHT_SQUARE_BRACKET = 0x5d; +const CIRCUMFLEX_ACCENT = 0x5e; +const LEFT_CURLY_BRACKET = 0x7b; +const VERTICAL_LINE = 0x7c; +const RIGHT_CURLY_BRACKET = 0x7d; +const ZERO_WIDTH_NON_JOINER = 0x200c; +const ZERO_WIDTH_JOINER = 0x200d; +const LINE_SEPARATOR = 0x2028; +const PARAGRAPH_SEPARATOR = 0x2029; +const MIN_CODE_POINT = 0x00; +const MAX_CODE_POINT = 0x10ffff; function isLatinLetter(code) { - return code >= LatinCapitalLetterA && code <= LatinCapitalLetterZ || code >= LatinSmallLetterA && code <= LatinSmallLetterZ; + return code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_Z || code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_Z; } - function isDecimalDigit(code) { - return code >= DigitZero && code <= DigitNine; + return code >= DIGIT_ZERO && code <= DIGIT_NINE; } - function isOctalDigit(code) { - return code >= DigitZero && code <= DigitSeven; + return code >= DIGIT_ZERO && code <= DIGIT_SEVEN; } - function isHexDigit(code) { - return code >= DigitZero && code <= DigitNine || code >= LatinCapitalLetterA && code <= LatinCapitalLetterF || code >= LatinSmallLetterA && code <= LatinSmallLetterF; + return code >= DIGIT_ZERO && code <= DIGIT_NINE || code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_F || code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_F; } - function isLineTerminator(code) { - return code === LineFeed || code === CarriageReturn || code === LineSeparator || code === ParagraphSeparator; + return code === LINE_FEED || code === CARRIAGE_RETURN || code === LINE_SEPARATOR || code === PARAGRAPH_SEPARATOR; } - function isValidUnicode(code) { - return code >= MinCodePoint && code <= MaxCodePoint; + return code >= MIN_CODE_POINT && code <= MAX_CODE_POINT; } - function digitToInt(code) { - if (code >= LatinSmallLetterA && code <= LatinSmallLetterF) { - return code - LatinSmallLetterA + 10; + if (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_F) { + return code - LATIN_SMALL_LETTER_A + 10; } - - if (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) { - return code - LatinCapitalLetterA + 10; + if (code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_F) { + return code - LATIN_CAPITAL_LETTER_A + 10; } - - return code - DigitZero; + return code - DIGIT_ZERO; } - 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; @@ -90038,38 +78943,30 @@ class Reader { 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; @@ -90081,7 +78978,6 @@ class Reader { 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; @@ -90095,26 +78991,21 @@ class Reader { 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(); @@ -90122,48 +79013,36 @@ class Reader { 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; + return cp === CIRCUMFLEX_ACCENT || cp === DOLLAR_SIGN || cp === REVERSE_SOLIDUS || cp === FULL_STOP || cp === ASTERISK || cp === PLUS_SIGN || cp === QUESTION_MARK || cp === LEFT_PARENTHESIS || cp === RIGHT_PARENTHESIS || cp === LEFT_SQUARE_BRACKET || cp === RIGHT_SQUARE_BRACKET || cp === LEFT_CURLY_BRACKET || cp === RIGHT_CURLY_BRACKET || cp === VERTICAL_LINE; } - function isRegExpIdentifierStart(cp) { - return isIdStart(cp) || cp === DollarSign || cp === LowLine; + return isIdStart(cp) || cp === DOLLAR_SIGN || cp === LOW_LINE; } - function isRegExpIdentifierPart(cp) { - return isIdContinue(cp) || cp === DollarSign || cp === LowLine || cp === ZeroWidthNonJoiner || cp === ZeroWidthJoiner; + return isIdContinue(cp) || cp === DOLLAR_SIGN || cp === LOW_LINE || cp === ZERO_WIDTH_NON_JOINER || cp === ZERO_WIDTH_JOINER; } - function isUnicodePropertyNameCharacter(cp) { - return isLatinLetter(cp) || cp === LowLine; + return isLatinLetter(cp) || cp === LOW_LINE; } - function isUnicodePropertyValueCharacter(cp) { return isUnicodePropertyNameCharacter(cp) || isDecimalDigit(cp); } - class RegExpValidator { constructor(options) { this._reader = new Reader(); @@ -90179,17 +79058,15 @@ class RegExpValidator { this._numCapturingParens = 0; this._groupNames = new Set(); this._backreferenceNames = new Set(); - this._options = options || {}; + this._options = options !== null && options !== void 0 ? options : {}; } - validateLiteral(source) { let start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; let end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : source.length; this._uFlag = this._nFlag = false; this.reset(source, start, end); this.onLiteralEnter(start); - - if (this.eat(Solidus) && this.eatRegExpBody() && this.eat(Solidus)) { + if (this.eat(SOLIDUS) && this.eatRegExpBody() && this.eat(SOLIDUS)) { const flagStart = this.index; const uFlag = source.includes("u", flagStart); this.validateFlags(source, flagStart, end); @@ -90200,10 +79077,8 @@ class RegExpValidator { const c = String.fromCodePoint(this.currentCodePoint); this.raise(`Unexpected character '${c}'`); } - this.onLiteralLeave(start, end); } - validateFlags(source) { let start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; let end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : source.length; @@ -90215,470 +79090,390 @@ class RegExpValidator { let unicode = false; let dotAll = false; let hasIndices = 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) { + if (flag === LATIN_SMALL_LETTER_G) { global = true; - } else if (flag === LatinSmallLetterI) { + } else if (flag === LATIN_SMALL_LETTER_I) { ignoreCase = true; - } else if (flag === LatinSmallLetterM) { + } else if (flag === LATIN_SMALL_LETTER_M) { multiline = true; - } else if (flag === LatinSmallLetterU && this.ecmaVersion >= 2015) { + } else if (flag === LATIN_SMALL_LETTER_U && this.ecmaVersion >= 2015) { unicode = true; - } else if (flag === LatinSmallLetterY && this.ecmaVersion >= 2015) { + } else if (flag === LATIN_SMALL_LETTER_Y && this.ecmaVersion >= 2015) { sticky = true; - } else if (flag === LatinSmallLetterS && this.ecmaVersion >= 2018) { + } else if (flag === LATIN_SMALL_LETTER_S && this.ecmaVersion >= 2018) { dotAll = true; - } else if (flag === LatinSmallLetterD && this.ecmaVersion >= 2022) { + } else if (flag === LATIN_SMALL_LETTER_D && this.ecmaVersion >= 2022) { hasIndices = true; } else { this.raise(`Invalid flag '${source[i]}'`); } } - - this.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices); + this.onRegExpFlags(start, end, { + global, + ignoreCase, + multiline, + unicode, + sticky, + dotAll, + hasIndices + }); } - validatePattern(source) { let start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; let end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : source.length; let uFlag = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; this._uFlag = uFlag && this.ecmaVersion >= 2015; - this._nFlag = uFlag && this.ecmaVersion >= 2018; + this._nFlag = uFlag && this.ecmaVersion >= 2018 || Boolean(this._options.strict && this.ecmaVersion >= 2023); 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); + return Boolean(this._options.strict) || this._uFlag; } - get ecmaVersion() { - return this._options.ecmaVersion || 2022; + var _a; + return (_a = this._options.ecmaVersion) !== null && _a !== void 0 ? _a : 2023; } - 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, hasIndices) { + onRegExpFlags(start, end, flags) { + if (this._options.onRegExpFlags) { + this._options.onRegExpFlags(start, end, flags); + } if (this._options.onFlags) { - this._options.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices); + this._options.onFlags(start, end, flags.global, flags.ignoreCase, flags.multiline, flags.unicode, flags.sticky, flags.dotAll, flags.hasIndices); } } - 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) { + } else if (cp === REVERSE_SOLIDUS) { escaped = true; - } else if (cp === LeftSquareBracket) { + } else if (cp === LEFT_SQUARE_BRACKET) { inClass = true; - } else if (cp === RightSquareBracket) { + } else if (cp === RIGHT_SQUARE_BRACKET) { inClass = false; - } else if (cp === Solidus && !inClass || cp === Asterisk && this.index === start) { + } 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) { + if (cp === RIGHT_PARENTHESIS) { this.raise("Unmatched ')'"); } - - if (cp === ReverseSolidus) { + if (cp === REVERSE_SOLIDUS) { this.raise("\\ at end of pattern"); } - - if (cp === RightSquareBracket || cp === RightCurlyBracket) { + if (cp === RIGHT_SQUARE_BRACKET || cp === RIGHT_CURLY_BRACKET) { 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) { + } else if (cp === REVERSE_SOLIDUS) { escaped = true; - } else if (cp === LeftSquareBracket) { + } else if (cp === LEFT_SQUARE_BRACKET) { inClass = true; - } else if (cp === RightSquareBracket) { + } else if (cp === RIGHT_SQUARE_BRACKET) { inClass = false; - } else if (cp === LeftParenthesis && !inClass && (this.nextCodePoint !== QuestionMark || this.nextCodePoint2 === LessThanSign && this.nextCodePoint3 !== EqualsSign && this.nextCodePoint3 !== ExclamationMark)) { + } else if (cp === LEFT_PARENTHESIS && !inClass && (this.nextCodePoint !== QUESTION_MARK || this.nextCodePoint2 === LESS_THAN_SIGN && this.nextCodePoint3 !== EQUALS_SIGN && this.nextCodePoint3 !== EXCLAMATION_MARK)) { 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)); - + } while (this.eat(VERTICAL_LINE)); if (this.consumeQuantifier(true)) { this.raise("Nothing to repeat"); } - - if (this.eat(LeftCurlyBracket)) { + if (this.eat(LEFT_CURLY_BRACKET)) { 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)) { + if (this.eat(CIRCUMFLEX_ACCENT)) { this.onEdgeAssertion(start, this.index, "start"); return true; } - - if (this.eat(DollarSign)) { + if (this.eat(DOLLAR_SIGN)) { this.onEdgeAssertion(start, this.index, "end"); return true; } - - if (this.eat2(ReverseSolidus, LatinCapitalLetterB)) { + if (this.eat2(REVERSE_SOLIDUS, LATIN_CAPITAL_LETTER_B)) { this.onWordBoundaryAssertion(start, this.index, "word", true); return true; } - - if (this.eat2(ReverseSolidus, LatinSmallLetterB)) { + if (this.eat2(REVERSE_SOLIDUS, LATIN_SMALL_LETTER_B)) { this.onWordBoundaryAssertion(start, this.index, "word", false); return true; } - - if (this.eat2(LeftParenthesis, QuestionMark)) { - const lookbehind = this.ecmaVersion >= 2018 && this.eat(LessThanSign); + if (this.eat2(LEFT_PARENTHESIS, QUESTION_MARK)) { + const lookbehind = this.ecmaVersion >= 2018 && this.eat(LESS_THAN_SIGN); let negate = false; - - if (this.eat(EqualsSign) || (negate = this.eat(ExclamationMark))) { + if (this.eat(EQUALS_SIGN) || (negate = this.eat(EXCLAMATION_MARK))) { const kind = lookbehind ? "lookbehind" : "lookahead"; this.onLookaroundAssertionEnter(start, kind, negate); this.consumeDisjunction(); - - if (!this.eat(RightParenthesis)) { + if (!this.eat(RIGHT_PARENTHESIS)) { this.raise("Unterminated group"); } - this._lastAssertionIsQuantifiable = !lookbehind && !this.strict; this.onLookaroundAssertionLeave(start, this.index, kind, negate); return true; } - this.rewind(start); } - return false; } - consumeQuantifier() { let noConsume = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; const start = this.index; let min = 0; let max = 0; let greedy = false; - - if (this.eat(Asterisk)) { + if (this.eat(ASTERISK)) { min = 0; max = Number.POSITIVE_INFINITY; - } else if (this.eat(PlusSign)) { + } else if (this.eat(PLUS_SIGN)) { min = 1; max = Number.POSITIVE_INFINITY; - } else if (this.eat(QuestionMark)) { + } else if (this.eat(QUESTION_MARK)) { min = 0; max = 1; } else if (this.eatBracedQuantifier(noConsume)) { @@ -90687,784 +79482,586 @@ class RegExpValidator { } else { return false; } - - greedy = !this.eat(QuestionMark); - + greedy = !this.eat(QUESTION_MARK); if (!noConsume) { this.onQuantifier(start, this.index, min, max, greedy); } - return true; } - eatBracedQuantifier(noError) { const start = this.index; - - if (this.eat(LeftCurlyBracket)) { + if (this.eat(LEFT_CURLY_BRACKET)) { this._lastMinValue = 0; this._lastMaxValue = Number.POSITIVE_INFINITY; - if (this.eatDecimalDigits()) { this._lastMinValue = this._lastMaxValue = this._lastIntValue; - - if (this.eat(Comma)) { + if (this.eat(COMMA)) { this._lastMaxValue = this.eatDecimalDigits() ? this._lastIntValue : Number.POSITIVE_INFINITY; } - - if (this.eat(RightCurlyBracket)) { + if (this.eat(RIGHT_CURLY_BRACKET)) { 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)) { + if (this.eat(FULL_STOP)) { this.onAnyCharacterSet(this.index - 1, this.index, "any"); return true; } - return false; } - consumeReverseSolidusAtomEscape() { const start = this.index; - - if (this.eat(ReverseSolidus)) { + if (this.eat(REVERSE_SOLIDUS)) { if (this.consumeAtomEscape()) { return true; } - this.rewind(start); } - return false; } - consumeUncapturingGroup() { const start = this.index; - - if (this.eat3(LeftParenthesis, QuestionMark, Colon)) { + if (this.eat3(LEFT_PARENTHESIS, QUESTION_MARK, COLON)) { this.onGroupEnter(start); this.consumeDisjunction(); - - if (!this.eat(RightParenthesis)) { + if (!this.eat(RIGHT_PARENTHESIS)) { this.raise("Unterminated group"); } - this.onGroupLeave(start, this.index); return true; } - return false; } - consumeCapturingGroup() { const start = this.index; - - if (this.eat(LeftParenthesis)) { + if (this.eat(LEFT_PARENTHESIS)) { let name = null; - if (this.ecmaVersion >= 2018) { if (this.consumeGroupSpecifier()) { name = this._lastStrValue; } - } else if (this.currentCodePoint === QuestionMark) { + } else if (this.currentCodePoint === QUESTION_MARK) { this.raise("Invalid group"); } - this.onCapturingGroupEnter(start, name); this.consumeDisjunction(); - - if (!this.eat(RightParenthesis)) { + if (!this.eat(RIGHT_PARENTHESIS)) { 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) { + if (this.currentCodePoint === REVERSE_SOLIDUS && this.nextCodePoint === LATIN_SMALL_LETTER_C) { this._lastIntValue = this.currentCodePoint; this.advance(); - this.onCharacter(start, this.index, ReverseSolidus); + this.onCharacter(start, this.index, REVERSE_SOLIDUS); 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) { + if (cp !== -1 && cp !== CIRCUMFLEX_ACCENT && cp !== DOLLAR_SIGN && cp !== REVERSE_SOLIDUS && cp !== FULL_STOP && cp !== ASTERISK && cp !== PLUS_SIGN && cp !== QUESTION_MARK && cp !== LEFT_PARENTHESIS && cp !== RIGHT_PARENTHESIS && cp !== LEFT_SQUARE_BRACKET && cp !== VERTICAL_LINE) { this.advance(); this.onCharacter(start, this.index, cp); return true; } - return false; } - consumeGroupSpecifier() { - if (this.eat(QuestionMark)) { + if (this.eat(QUESTION_MARK)) { 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)) { + if (this.eat(LATIN_SMALL_LETTER_D)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "digit", false); return true; } - - if (this.eat(LatinCapitalLetterD)) { + if (this.eat(LATIN_CAPITAL_LETTER_D)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "digit", true); return true; } - - if (this.eat(LatinSmallLetterS)) { + if (this.eat(LATIN_SMALL_LETTER_S)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "space", false); return true; } - - if (this.eat(LatinCapitalLetterS)) { + if (this.eat(LATIN_CAPITAL_LETTER_S)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "space", true); return true; } - - if (this.eat(LatinSmallLetterW)) { + if (this.eat(LATIN_SMALL_LETTER_W)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "word", false); return true; } - - if (this.eat(LatinCapitalLetterW)) { + if (this.eat(LATIN_CAPITAL_LETTER_W)) { 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)))) { + if (this._uFlag && this.ecmaVersion >= 2018 && (this.eat(LATIN_SMALL_LETTER_P) || (negate = this.eat(LATIN_CAPITAL_LETTER_P)))) { this._lastIntValue = -1; - - if (this.eat(LeftCurlyBracket) && this.eatUnicodePropertyValueExpression() && this.eat(RightCurlyBracket)) { + if (this.eat(LEFT_CURLY_BRACKET) && this.eatUnicodePropertyValueExpression() && this.eat(RIGHT_CURLY_BRACKET)) { 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.eat(LATIN_SMALL_LETTER_K)) { 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); + if (this.eat(LEFT_SQUARE_BRACKET)) { + const negate = this.eat(CIRCUMFLEX_ACCENT); this.onCharacterClassEnter(start, negate); this.consumeClassRanges(); - - if (!this.eat(RightSquareBracket)) { + if (!this.eat(RIGHT_SQUARE_BRACKET)) { 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)) { + if (!this.eat(HYPHEN_MINUS)) { continue; } - - this.onCharacter(this.index - 1, this.index, HyphenMinus); - + this.onCharacter(this.index - 1, this.index, HYPHEN_MINUS); 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) { + if (cp !== -1 && cp !== REVERSE_SOLIDUS && cp !== RIGHT_SQUARE_BRACKET) { this.advance(); this._lastIntValue = cp; this.onCharacter(start, this.index, this._lastIntValue); return true; } - - if (this.eat(ReverseSolidus)) { + if (this.eat(REVERSE_SOLIDUS)) { if (this.consumeClassEscape()) { return true; } - - if (!this.strict && this.currentCodePoint === LatinSmallLetterC) { - this._lastIntValue = ReverseSolidus; + if (!this.strict && this.currentCodePoint === LATIN_SMALL_LETTER_C) { + this._lastIntValue = REVERSE_SOLIDUS; 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; + if (this.eat(LATIN_SMALL_LETTER_B)) { + this._lastIntValue = BACKSPACE; this.onCharacter(start - 1, this.index, this._lastIntValue); return true; } - - if (this._uFlag && this.eat(HyphenMinus)) { - this._lastIntValue = HyphenMinus; + if (this._uFlag && this.eat(HYPHEN_MINUS)) { + this._lastIntValue = HYPHEN_MINUS; 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)) { + if (!this.strict && !this._uFlag && this.currentCodePoint === LATIN_SMALL_LETTER_C && (isDecimalDigit(cp = this.nextCodePoint) || cp === LOW_LINE)) { 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)) { + if (this.eat(LESS_THAN_SIGN)) { + if (this.eatRegExpIdentifierName() && this.eat(GREATER_THAN_SIGN)) { 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)) { + if (cp === REVERSE_SOLIDUS && 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)) { + if (cp === REVERSE_SOLIDUS && 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.eat(LATIN_SMALL_LETTER_C)) { if (this.eatControlLetter()) { return true; } - this.rewind(start); } - return false; } - eatZero() { - if (this.currentCodePoint === DigitZero && !isDecimalDigit(this.nextCodePoint)) { + if (this.currentCodePoint === DIGIT_ZERO && !isDecimalDigit(this.nextCodePoint)) { this._lastIntValue = 0; this.advance(); return true; } - return false; } - eatControlEscape() { - if (this.eat(LatinSmallLetterF)) { - this._lastIntValue = FormFeed; + if (this.eat(LATIN_SMALL_LETTER_F)) { + this._lastIntValue = FORM_FEED; return true; } - - if (this.eat(LatinSmallLetterN)) { - this._lastIntValue = LineFeed; + if (this.eat(LATIN_SMALL_LETTER_N)) { + this._lastIntValue = LINE_FEED; return true; } - - if (this.eat(LatinSmallLetterR)) { - this._lastIntValue = CarriageReturn; + if (this.eat(LATIN_SMALL_LETTER_R)) { + this._lastIntValue = CARRIAGE_RETURN; return true; } - - if (this.eat(LatinSmallLetterT)) { - this._lastIntValue = CharacterTabulation; + if (this.eat(LATIN_SMALL_LETTER_T)) { + this._lastIntValue = CHARACTER_TABULATION; return true; } - - if (this.eat(LatinSmallLetterV)) { - this._lastIntValue = LineTabulation; + if (this.eat(LATIN_SMALL_LETTER_V)) { + this._lastIntValue = LINE_TABULATION; return true; } - return false; } - eatControlLetter() { const cp = this.currentCodePoint; - if (isLatinLetter(cp)) { this.advance(); this._lastIntValue = cp % 0x20; return true; } - return false; } - eatRegExpUnicodeEscapeSequence() { let forceUFlag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; const start = this.index; const uFlag = forceUFlag || this._uFlag; - - if (this.eat(LatinSmallLetterU)) { + if (this.eat(LATIN_SMALL_LETTER_U)) { 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)) { + if (isLeadSurrogate(lead) && this.eat(REVERSE_SOLIDUS) && this.eat(LATIN_SMALL_LETTER_U) && 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)) { + if (this.eat(LEFT_CURLY_BRACKET) && this.eatHexDigits() && this.eat(RIGHT_CURLY_BRACKET) && 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; + return isSyntaxCharacter(cp) || cp === SOLIDUS; } - if (this.strict) { return !isIdContinue(cp); } - if (this._nFlag) { - return !(cp === LatinSmallLetterC || cp === LatinSmallLetterK); + return !(cp === LATIN_SMALL_LETTER_C || cp === LATIN_SMALL_LETTER_K); } - - return cp !== LatinSmallLetterC; + return cp !== LATIN_SMALL_LETTER_C; } - eatDecimalEscape() { this._lastIntValue = 0; let cp = this.currentCodePoint; - - if (cp >= DigitOne && cp <= DigitNine) { + if (cp >= DIGIT_ONE && cp <= DIGIT_NINE) { do { - this._lastIntValue = 10 * this._lastIntValue + (cp - DigitZero); + this._lastIntValue = 10 * this._lastIntValue + (cp - DIGIT_ZERO); this.advance(); - } while ((cp = this.currentCodePoint) >= DigitZero && cp <= DigitNine); - + } while ((cp = this.currentCodePoint) >= DIGIT_ZERO && cp <= DIGIT_NINE); return true; } - return false; } - eatUnicodePropertyValueExpression() { const start = this.index; - - if (this.eatUnicodePropertyName() && this.eat(EqualsSign)) { + if (this.eatUnicodePropertyName() && this.eat(EQUALS_SIGN)) { 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.eat(LATIN_SMALL_LETTER_X)) { 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 { @@ -91473,79 +80070,71 @@ class RegExpValidator { } else { this._lastIntValue = n1; } - return true; } - return false; } - eatOctalDigit() { const cp = this.currentCodePoint; - if (isOctalDigit(cp)) { this.advance(); - this._lastIntValue = cp - DigitZero; + this._lastIntValue = cp - DIGIT_ZERO; 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 = {}; - +const DUMMY_PATTERN = {}; +const DUMMY_FLAGS = {}; +const DUMMY_CAPTURING_GROUP = {}; class RegExpParserState { constructor(options) { - this._node = DummyPattern; - this._flags = DummyFlags; + var _a; + this._node = DUMMY_PATTERN; + this._flags = DUMMY_FLAGS; this._backreferences = []; this._capturingGroups = []; this.source = ""; - this.strict = Boolean(options && options.strict); - this.ecmaVersion = options && options.ecmaVersion || 2022; + this.strict = Boolean(options === null || options === void 0 ? void 0 : options.strict); + this.ecmaVersion = (_a = options === null || options === void 0 ? void 0 : options.ecmaVersion) !== null && _a !== void 0 ? _a : 2023; } - 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, hasIndices) { + onRegExpFlags(start, end, _ref) { + let { + global, + ignoreCase, + multiline, + unicode, + sticky, + dotAll, + hasIndices + } = _ref; this._flags = { type: "Flags", parent: null, @@ -91561,7 +80150,6 @@ class RegExpParserState { hasIndices }; } - onPatternEnter(start) { this._node = { type: "Pattern", @@ -91574,11 +80162,9 @@ class RegExpParserState { 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); @@ -91586,14 +80172,11 @@ class RegExpParserState { 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, @@ -91604,26 +80187,20 @@ class RegExpParserState { }; 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, @@ -91634,26 +80211,20 @@ class RegExpParserState { }; 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, @@ -91665,35 +80236,26 @@ class RegExpParserState { 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, @@ -91708,14 +80270,11 @@ class RegExpParserState { 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, @@ -91728,26 +80287,20 @@ class RegExpParserState { }; 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, @@ -91757,14 +80310,11 @@ class RegExpParserState { kind }); } - onWordBoundaryAssertion(start, end, kind, negate) { const parent = this._node; - if (parent.type !== "Alternative") { throw new Error("UnknownError"); } - parent.elements.push({ type: "Assertion", parent, @@ -91775,14 +80325,11 @@ class RegExpParserState { negate }); } - onAnyCharacterSet(start, end, kind) { const parent = this._node; - if (parent.type !== "Alternative") { throw new Error("UnknownError"); } - parent.elements.push({ type: "CharacterSet", parent, @@ -91792,14 +80339,11 @@ class RegExpParserState { 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, @@ -91810,14 +80354,11 @@ class RegExpParserState { 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, @@ -91830,14 +80371,11 @@ class RegExpParserState { 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, @@ -91847,14 +80385,11 @@ class RegExpParserState { value }); } - onBackreference(start, end, ref) { const parent = this._node; - if (parent.type !== "Alternative") { throw new Error("UnknownError"); } - const node = { type: "Backreference", parent, @@ -91862,20 +80397,16 @@ class RegExpParserState { end, raw: this.source.slice(start, end), ref, - resolved: DummyCapturingGroup + resolved: DUMMY_CAPTURING_GROUP }; 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, @@ -91887,35 +80418,27 @@ class RegExpParserState { }; 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) { + if (!min || !max || !hyphen || min.type !== "Character" || max.type !== "Character" || hyphen.type !== "Character" || hyphen.value !== HYPHEN_MINUS) { throw new Error("UnknownError"); } - const node = { type: "CharacterClassRange", parent, @@ -91929,22 +80452,17 @@ class RegExpParserState { max.parent = node; elements.push(node); } - } - class RegExpParser { constructor(options) { this._state = new RegExpParserState(options); this._validator = new RegExpValidator(this._state); } - parseLiteral(source) { let start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; let end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : source.length; this._state.source = source; - this._validator.validateLiteral(source, start, end); - const pattern = this._state.pattern; const flags = this._state.flags; const literal = { @@ -91960,260 +80478,198 @@ class RegExpParser { flags.parent = literal; return literal; } - parseFlags(source) { let start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; let end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : source.length; this._state.source = source; - this._validator.validateFlags(source, start, end); - return this._state.flags; } - parsePattern(source) { let start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; let end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : source.length; let uFlag = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 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); + new RegExpValidator(options).validateLiteral(source); } - function visitRegExpAST(node, handlers) { new RegExpVisitor(handlers).visit(node); } - exports.AST = ast; exports.RegExpParser = RegExpParser; exports.RegExpValidator = RegExpValidator; @@ -92222,7 +80678,7 @@ exports.validateRegExpLiteral = validateRegExpLiteral; exports.visitRegExpAST = visitRegExpAST; /***/ }), -/* 742 */ +/* 749 */ /***/ ((module) => { "use strict"; @@ -92230,19 +80686,21 @@ exports.visitRegExpAST = visitRegExpAST; * @fileoverview Rule to flag use of a debugger statement * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow the use of `debugger`", recommended: true, - url: "https://eslint.org/docs/rules/no-debugger" + url: "https://eslint.org/docs/latest/rules/no-debugger" }, fixable: null, schema: [], @@ -92250,7 +80708,6 @@ module.exports = { unexpected: "Unexpected 'debugger' statement." } }, - create(context) { return { DebuggerStatement(node) { @@ -92259,14 +80716,12 @@ module.exports = { messageId: "unexpected" }); } - }; } - }; /***/ }), -/* 743 */ +/* 750 */ /***/ ((module) => { "use strict"; @@ -92274,26 +80729,27 @@ module.exports = { * @fileoverview Rule to flag when deleting variables * @author Ilya Volodin */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow deleting variables", recommended: true, - url: "https://eslint.org/docs/rules/no-delete-var" + url: "https://eslint.org/docs/latest/rules/no-delete-var" }, schema: [], messages: { unexpected: "Variables should not be deleted." } }, - create(context) { return { UnaryExpression(node) { @@ -92304,14 +80760,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 744 */ +/* 751 */ /***/ ((module) => { "use strict"; @@ -92319,19 +80773,21 @@ module.exports = { * @fileoverview Rule to check for ambiguous div operator in regexes * @author Matt DuVall */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { - description: "Disallow division operators explicitly at the beginning of regular expressions", + description: "Disallow equal signs explicitly at the beginning of regular expressions", recommended: false, - url: "https://eslint.org/docs/rules/no-div-regex" + url: "https://eslint.org/docs/latest/rules/no-div-regex" }, fixable: "code", schema: [], @@ -92339,33 +80795,27 @@ module.exports = { unexpected: "A regular expression literal can be confused with '/='." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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], "[=]"); } - }); } } - }; } - }; /***/ }), -/* 745 */ +/* 752 */ /***/ ((module) => { "use strict"; @@ -92373,27 +80823,30 @@ module.exports = { * @fileoverview Rule to flag duplicate arguments * @author Jamund Ferguson */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow duplicate arguments in `function` definitions", recommended: true, - url: "https://eslint.org/docs/rules/no-dupe-args" + url: "https://eslint.org/docs/latest/rules/no-dupe-args" }, schema: [], messages: { unexpected: "Duplicate param '{{name}}'." } }, - create(context) { + const sourceCode = context.sourceCode; + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -92406,22 +80859,20 @@ module.exports = { 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); - + const variables = sourceCode.getDeclaredVariables(node); for (let i = 0; i < variables.length; ++i) { - const variable = variables[i]; // Checks and reports duplications. + const variable = variables[i]; + // Checks and reports duplications. const defs = variable.defs.filter(isParameter); - if (defs.length >= 2) { context.report({ node, @@ -92432,21 +80883,21 @@ module.exports = { }); } } - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public API //-------------------------------------------------------------------------- - return { FunctionDeclaration: checkParams, FunctionExpression: checkParams }; } - }; /***/ }), -/* 746 */ +/* 753 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -92456,29 +80907,30 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow duplicate class members", recommended: true, - url: "https://eslint.org/docs/rules/no-dupe-class-members" + url: "https://eslint.org/docs/latest/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. @@ -92488,7 +80940,6 @@ module.exports = { * - 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__". @@ -92507,38 +80958,30 @@ module.exports = { } }; } - 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, PropertyDefinition"(node) { const name = astUtils.getStaticPropertyName(node); const kind = node.type === "MethodDefinition" ? node.kind : "field"; - if (name === null || kind === "constructor") { return; } - const state = getState(name, node.static); let isDuplicate = false; - if (kind === "get") { isDuplicate = state.init || state.get; state.get = true; @@ -92549,7 +80992,6 @@ module.exports = { isDuplicate = state.init || state.get || state.set; state.init = true; } - if (isDuplicate) { context.report({ node, @@ -92560,14 +81002,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 747 */ +/* 754 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -92575,11 +81015,15 @@ module.exports = { * @fileoverview Rule to disallow duplicate conditions in if-else-if chains * @author Milos Djermanovic */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -92590,50 +81034,46 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @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, "&&"); //------------------------------------------------------------------------------ +const splitByAnd = splitByLogicalOperator.bind(null, "&&"); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow duplicate conditions in if-else-if chains", recommended: true, - url: "https://eslint.org/docs/rules/no-dupe-else-if" + url: "https://eslint.org/docs/latest/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(); + const sourceCode = context.sourceCode; + /** * 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. @@ -92641,32 +81081,26 @@ module.exports = { * @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]; + conditionsToCheck = test.type === "LogicalExpression" && test.operator === "&&" ? [test, ...splitByAnd(test)] : [test]; let current = node, - listToCheck = conditionsToCheck.map(c => splitByOr(c).map(splitByAnd)); - + 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, @@ -92676,14 +81110,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 748 */ +/* 755 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -92691,21 +81123,24 @@ module.exports = { * @fileoverview Rule to flag use of duplicate keys in an object. * @author Ian Christian Myers */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - const GET_KIND = /^(?:init|get)$/u; const SET_KIND = /^(?:init|set)$/u; + /** * The class which stores properties' information of an object. */ - class ObjectInfo { /** * @param {ObjectInfo|null} upper The information of the outer object. @@ -92716,100 +81151,90 @@ class ObjectInfo { 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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow duplicate keys in object literals", recommended: true, - url: "https://eslint.org/docs/rules/no-dupe-keys" + url: "https://eslint.org/docs/latest/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. + const name = astUtils.getStaticPropertyName(node); + // Skip destructuring. if (node.parent.type !== "ObjectExpression") { return; - } // Skip if the name is not static. - + } + // Skip if the name is not static. if (name === null) { return; - } // Reports if the name is defined already. - + } + // Reports if the name is defined already. if (info.isPropertyDefined(node)) { context.report({ node: info.node, @@ -92819,19 +81244,17 @@ module.exports = { name } }); - } // Update info. - + } + // Update info. info.defineProperty(node); } - }; } - }; /***/ }), -/* 749 */ +/* 756 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -92840,56 +81263,53 @@ module.exports = { * @author Dieter Oberkofler * @author Burak Yigit Kaya */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow duplicate case labels", recommended: true, - url: "https://eslint.org/docs/rules/no-duplicate-case" + url: "https://eslint.org/docs/latest/rules/no-duplicate-case" }, schema: [], messages: { unexpected: "Duplicate case label." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * 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, @@ -92901,14 +81321,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 750 */ +/* 757 */ /***/ ((module) => { "use strict"; @@ -92916,12 +81334,15 @@ module.exports = { * @fileoverview Restrict usage of duplicate imports. * @author Simen Bekkhus */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - const NAMED_TYPES = ["ImportSpecifier", "ExportSpecifier"]; -const NAMESPACE_TYPES = ["ImportNamespaceSpecifier", "ExportNamespaceSpecifier"]; //------------------------------------------------------------------------------ +const NAMESPACE_TYPES = ["ImportNamespaceSpecifier", "ExportNamespaceSpecifier"]; + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -92931,18 +81352,16 @@ const NAMESPACE_TYPES = ["ImportNamespaceSpecifier", "ExportNamespaceSpecifier"] * @param {string} type Can be "named" or "namespace" * @returns {boolean} True if import/export type belongs to (ImportSpecifier|ExportSpecifier) or (ImportNamespaceSpecifier|ExportNamespaceSpecifier) and false if it doesn't. */ - function isImportExportSpecifier(importExportType, type) { const arrayToCheck = type === "named" ? NAMED_TYPES : NAMESPACE_TYPES; return arrayToCheck.includes(importExportType); } + /** * Return the type of (import|export). * @param {ASTNode} node A node to get. * @returns {string} The type of the (import|export). */ - - function getImportExportType(node) { if (node.specifiers && node.specifiers.length > 0) { const nodeSpecifiers = node.specifiers; @@ -92955,68 +81374,56 @@ function getImportExportType(node) { const i = index > -1 ? index : 0; return nodeSpecifiers[i].type; } - if (node.type === "ExportAllDeclaration") { if (node.exported) { return "ExportNamespaceSpecifier"; } - return "ExportAll"; } - return "SideEffectImport"; } + /** * Returns a boolean indicates if two (import|export) can be merged * @param {ASTNode} node1 A node to check. * @param {ASTNode} node2 A node to check. * @returns {boolean} True if two (import|export) can be merged, false if they can't. */ - - function isImportExportCanBeMerged(node1, node2) { const importExportType1 = getImportExportType(node1); const importExportType2 = getImportExportType(node2); - if (importExportType1 === "ExportAll" && importExportType2 !== "ExportAll" && importExportType2 !== "SideEffectImport" || importExportType1 !== "ExportAll" && importExportType1 !== "SideEffectImport" && importExportType2 === "ExportAll") { return false; } - if (isImportExportSpecifier(importExportType1, "namespace") && isImportExportSpecifier(importExportType2, "named") || isImportExportSpecifier(importExportType2, "namespace") && isImportExportSpecifier(importExportType1, "named")) { return false; } - return true; } + /** * Returns a boolean if we should report (import|export). * @param {ASTNode} node A node to be reported or not. * @param {[ASTNode]} previousNodes An array contains previous nodes of the module imported or exported. * @returns {boolean} True if the (import|export) should be reported. */ - - function shouldReportImportExport(node, previousNodes) { let i = 0; - while (i < previousNodes.length) { if (isImportExportCanBeMerged(node, previousNodes[i])) { return true; } - i++; } - return false; } + /** * Returns array contains only nodes with declarations types equal to type. * @param {[{node: ASTNode, declarationType: string}]} nodes An array contains objects, each object contains a node and a declaration type. * @param {string} type Declaration type. * @returns {[ASTNode]} An array contains only nodes with declarations types equal to type. */ - - function getNodesByDeclarationType(nodes, type) { return nodes.filter(_ref2 => { let { @@ -93030,20 +81437,19 @@ function getNodesByDeclarationType(nodes, type) { return node; }); } + /** * 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 getModule(node) { if (node && node.source && node.source.value) { return node.source.value.trim(); } - return ""; } + /** * Checks if the (import|export) can be merged with at least one import or one export, and reports if so. * @param {RuleContext} context The ESLint rule context object. @@ -93053,26 +81459,20 @@ function getModule(node) { * @param {boolean} includeExports Whether or not to check for exports in addition to imports. * @returns {void} No return value. */ - - function checkAndReport(context, node, modules, declarationType, includeExports) { const module = getModule(node); - if (modules.has(module)) { const previousNodes = modules.get(module); const messagesIds = []; const importNodes = getNodesByDeclarationType(previousNodes, "import"); let exportNodes; - if (includeExports) { exportNodes = getNodesByDeclarationType(previousNodes, "export"); } - if (declarationType === "import") { if (shouldReportImportExport(node, importNodes)) { messagesIds.push("import"); } - if (includeExports) { if (shouldReportImportExport(node, exportNodes)) { messagesIds.push("importAs"); @@ -93082,12 +81482,10 @@ function checkAndReport(context, node, modules, declarationType, includeExports) if (shouldReportImportExport(node, exportNodes)) { messagesIds.push("export"); } - if (shouldReportImportExport(node, importNodes)) { messagesIds.push("exportAs"); } } - messagesIds.forEach(messageId => context.report({ node, messageId, @@ -93097,6 +81495,7 @@ function checkAndReport(context, node, modules, declarationType, includeExports) })); } } + /** * @callback nodeCallback * @param {ASTNode} node A node to handle. @@ -93110,12 +81509,9 @@ function checkAndReport(context, node, modules, declarationType, includeExports) * @param {boolean} includeExports Whether or not to check for exports in addition to imports. * @returns {nodeCallback} A function passed to ESLint to handle the statement. */ - - function handleImportsExports(context, modules, declarationType, includeExports) { return function (node) { const module = getModule(node); - if (module) { checkAndReport(context, node, modules, declarationType, includeExports); const currentNode = { @@ -93123,26 +81519,23 @@ function handleImportsExports(context, modules, declarationType, includeExports) declarationType }; let nodes = [currentNode]; - if (modules.has(module)) { const previousNodes = modules.get(module); nodes = [...previousNodes, currentNode]; } - modules.set(module, nodes); } }; } + /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow duplicate module imports", recommended: false, - url: "https://eslint.org/docs/rules/no-duplicate-imports" + url: "https://eslint.org/docs/latest/rules/no-duplicate-imports" }, schema: [{ type: "object", @@ -93161,26 +81554,22 @@ module.exports = { exportAs: "'{{module}}' export is duplicated as import." } }, - create(context) { const includeExports = (context.options[0] || {}).includeExports, - modules = new Map(); + modules = new Map(); const handlers = { ImportDeclaration: handleImportsExports(context, modules, "import", includeExports) }; - if (includeExports) { handlers.ExportNamedDeclaration = handleImportsExports(context, modules, "export", includeExports); handlers.ExportAllDeclaration = handleImportsExports(context, modules, "export", includeExports); } - return handlers; } - }; /***/ }), -/* 751 */ +/* 758 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -93188,26 +81577,27 @@ module.exports = { * @fileoverview Rule to flag `else` after a `return` in `if` * @author Ian Christian Myers */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); +const FixTracker = __webpack_require__(759); -const astUtils = __webpack_require__(618); - -const FixTracker = __webpack_require__(752); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow `else` blocks after `return` statements in `if` statements", recommended: false, - url: "https://eslint.org/docs/rules/no-else-return" + url: "https://eslint.org/docs/latest/rules/no-else-return" }, schema: [{ type: "object", @@ -93224,8 +81614,9 @@ module.exports = { unexpected: "Unnecessary 'else' after 'return'." } }, - create(context) { + const sourceCode = context.sourceCode; + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -93245,8 +81636,8 @@ module.exports = { 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. @@ -93254,14 +81645,12 @@ module.exports = { * * Redeclaring any of these would cause a syntax error, except for the implicit variables. */ - const declaredVariables = scope.variables.filter(_ref => { let { defs } = _ref; return defs.length > 0; }); - if (declaredVariables.some(_ref2 => { let { name @@ -93269,9 +81658,9 @@ module.exports = { return names.includes(name); })) { return false; - } // Redeclaring a catch variable would also cause a syntax error. - + } + // Redeclaring a catch variable would also cause a syntax error. if (scope !== functionScope && scope.upper.type === "catch") { if (scope.upper.variables.some(_ref3 => { let { @@ -93282,13 +81671,12 @@ module.exports = { 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(_ref4 => { let { defs, @@ -93296,7 +81684,6 @@ module.exports = { } = _ref4; return defs.length === 0 && references.length > 0; }); - if (usedImplicitVariables.some(_ref5 => { let { name @@ -93305,15 +81692,15 @@ module.exports = { })) { 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. @@ -93321,8 +81708,6 @@ module.exports = { * 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(_ref6 => { @@ -93331,7 +81716,6 @@ module.exports = { } = _ref6; return names.includes(name); }); - if (variablesToCheck.some(v => v.defs.some(_ref7 => { let { node: { @@ -93343,45 +81727,39 @@ module.exports = { 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(_ref8 => { let { block } = _ref8; return 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(_ref9 => { let { name @@ -93390,74 +81768,66 @@ module.exports = { }); return isSafeToDeclare(namesToCheck, scope); } + /** * Display the context report if rule is violated - * @param {Node} node The 'else' node + * @param {Node} elseNode The 'else' node * @returns {void} */ - - - function displayReport(node) { - const currentScope = context.getScope(); + function displayReport(elseNode) { + const currentScope = sourceCode.getScope(elseNode.parent); context.report({ - node, + node: elseNode, messageId: "unexpected", - fix: fixer => { - if (!isSafeFromNameCollisions(node, currentScope)) { + fix(fixer) { + if (!isSafeFromNameCollisions(elseNode, currentScope)) { return null; } - - const sourceCode = context.getSourceCode(); - const startToken = sourceCode.getFirstToken(node); + const startToken = sourceCode.getFirstToken(elseNode); const elseToken = sourceCode.getTokenBefore(startToken); - const source = sourceCode.getText(node); + const source = sourceCode.getText(elseNode); 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 ifBlockMaybeUnsafe = elseNode.parent.consequent.type !== "BlockStatement" && lastIfToken.value !== ";"; const elseBlockUnsafe = /^[([/+`-]/u.test(firstTokenOfElseBlock.value); - if (ifBlockMaybeUnsafe && elseBlockUnsafe) { return null; } - - const endToken = sourceCode.getLastToken(node); + const endToken = sourceCode.getLastToken(elseNode); 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. @@ -93465,22 +81835,20 @@ module.exports = { * * Also, to avoid name collisions between two else blocks. */ - - - return new FixTracker(fixer, sourceCode).retainEnclosingFunction(node).replaceTextRange([elseToken.range[0], node.range[1]], fixedSource); + return new FixTracker(fixer, sourceCode).retainEnclosingFunction(elseNode).replaceTextRange([elseToken.range[0], elseNode.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 @@ -93488,28 +81856,25 @@ module.exports = { * @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]; + 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 @@ -93517,11 +81882,10 @@ module.exports = { * @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 @@ -93529,93 +81893,82 @@ module.exports = { * @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); - const allowElseIf = !(context.options[0] && context.options[0].allowElseIf === false); //-------------------------------------------------------------------------- + //-------------------------------------------------------------------------- // Public API //-------------------------------------------------------------------------- @@ -93623,11 +81976,10 @@ module.exports = { "IfStatement:exit": allowElseIf ? checkIfWithoutElse : checkIfWithElse }; } - }; /***/ }), -/* 752 */ +/* 759 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -93635,11 +81987,14 @@ module.exports = { * @fileoverview Helper class to aid in constructing fix commands. * @author Alan Pierce */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ @@ -93648,8 +82003,6 @@ const astUtils = __webpack_require__(618); //----------------------------------- * 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. @@ -93661,18 +82014,18 @@ class FixTracker { 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 @@ -93681,12 +82034,11 @@ class FixTracker { * @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 @@ -93696,13 +82048,12 @@ class FixTracker { * 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. @@ -93710,37 +82061,30 @@ class FixTracker { * @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; /***/ }), -/* 753 */ +/* 760 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -93748,24 +82092,26 @@ module.exports = FixTracker; * @fileoverview Rule to flag use of an empty block statement * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { + hasSuggestions: true, type: "suggestion", docs: { description: "Disallow empty block statements", recommended: true, - url: "https://eslint.org/docs/rules/no-empty" + url: "https://eslint.org/docs/latest/rules/no-empty" }, schema: [{ type: "object", @@ -93778,44 +82124,51 @@ module.exports = { additionalProperties: false }], messages: { - unexpected: "Empty {{type}} statement." + unexpected: "Empty {{type}} statement.", + suggestComment: "Add comment inside empty {{type}} statement." } }, - create(context) { const options = context.options[0] || {}, - allowEmptyCatch = options.allowEmptyCatch || false; - const sourceCode = context.getSourceCode(); + allowEmptyCatch = options.allowEmptyCatch || false; + const sourceCode = context.sourceCode; 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 - + } + // 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; } + // 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" - } + }, + suggest: [{ + messageId: "suggestComment", + data: { + type: "block" + }, + fix(fixer) { + const range = [node.range[0] + 1, node.range[1] - 1]; + return fixer.replaceTextRange(range, " /* empty */ "); + } + }] }); }, - SwitchStatement(node) { if (typeof node.cases === "undefined" || node.cases.length === 0) { context.report({ @@ -93827,14 +82180,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 754 */ +/* 761 */ /***/ ((module) => { "use strict"; @@ -93842,7 +82193,10 @@ module.exports = { * @fileoverview Rule to flag the use of empty character classes in regular expressions * @author Ian Christian Myers */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -93855,27 +82209,26 @@ module.exports = { * 1.2. `\[([^\\\]]|\\.)+\]`: a character class that isn't empty * 2. `$`: fix the match at the end of the string */ +const regex = /^([^\\[]|\\.|\[([^\\\]]|\\.)+\])*$/u; -const regex = /^([^\\[]|\\.|\[([^\\\]]|\\.)+\])*$/u; //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow empty character classes in regular expressions", recommended: true, - url: "https://eslint.org/docs/rules/no-empty-character-class" + url: "https://eslint.org/docs/latest/rules/no-empty-character-class" }, schema: [], messages: { unexpected: "Empty class." } }, - create(context) { return { "Literal[regex]"(node) { @@ -93886,14 +82239,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 755 */ +/* 762 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -93901,16 +82252,20 @@ module.exports = { * @fileoverview Rule to disallow empty functions. * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // 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 @@ -93921,47 +82276,39 @@ const ALLOW_OPTIONS = Object.freeze(["functions", "arrowFunctions", "generatorFu * "generatorMethods", "asyncMethods", "getters", "setters", and * "constructors". */ - function getKind(node) { const parent = node.parent; let kind = ""; - if (node.type === "ArrowFunctionExpression") { return "arrowFunctions"; - } // Detects main kind. - + } + // 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. - + } + // Detects prefix. let prefix = ""; - if (node.generator) { prefix = "generator"; } else if (node.async) { @@ -93969,22 +82316,21 @@ function getKind(node) { } else { return kind; } - return prefix + kind[0].toUpperCase() + kind.slice(1); -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow empty functions", recommended: false, - url: "https://eslint.org/docs/rules/no-empty-function" + url: "https://eslint.org/docs/latest/rules/no-empty-function" }, schema: [{ type: "object", @@ -94003,11 +82349,11 @@ module.exports = { unexpected: "Unexpected empty {{name}}." } }, - create(context) { const options = context.options[0] || {}; const allowed = options.allow || []; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * Reports a given function node if the node matches the following patterns. * @@ -94019,7 +82365,6 @@ module.exports = { * FunctionExpression. * @returns {void} */ - function reportIfEmpty(node) { const kind = getKind(node); const name = astUtils.getFunctionNameWithKind(node); @@ -94027,7 +82372,6 @@ module.exports = { includeComments: true, filter: astUtils.isCommentToken }); - if (!allowed.includes(kind) && node.body.type === "BlockStatement" && node.body.body.length === 0 && innerComments.length === 0) { context.report({ node, @@ -94039,18 +82383,16 @@ module.exports = { }); } } - return { ArrowFunctionExpression: reportIfEmpty, FunctionDeclaration: reportIfEmpty, FunctionExpression: reportIfEmpty }; } - }; /***/ }), -/* 756 */ +/* 763 */ /***/ ((module) => { "use strict"; @@ -94058,26 +82400,26 @@ module.exports = { * @fileoverview Rule to disallow an empty pattern * @author Alberto Rodríguez */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow empty destructuring patterns", recommended: true, - url: "https://eslint.org/docs/rules/no-empty-pattern" + url: "https://eslint.org/docs/latest/rules/no-empty-pattern" }, schema: [], messages: { unexpected: "Unexpected empty {{type}} pattern." } }, - create(context) { return { ObjectPattern(node) { @@ -94091,7 +82433,6 @@ module.exports = { }); } }, - ArrayPattern(node) { if (node.elements.length === 0) { context.report({ @@ -94103,14 +82444,59 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 757 */ +/* 764 */ +/***/ ((module) => { + +"use strict"; +/** + * @fileoverview Rule to disallow empty static blocks. + * @author Sosuke Suzuki + */ + + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "suggestion", + docs: { + description: "Disallow empty static blocks", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-empty-static-block" + }, + schema: [], + messages: { + unexpected: "Unexpected empty static block." + } + }, + create(context) { + const sourceCode = context.sourceCode; + return { + StaticBlock(node) { + if (node.body.length === 0) { + const closingBrace = sourceCode.getLastToken(node); + if (sourceCode.getCommentsBefore(closingBrace).length === 0) { + context.report({ + node, + messageId: "unexpected" + }); + } + } + } + }; + } +}; + +/***/ }), +/* 765 */ /***/ ((module) => { "use strict"; @@ -94119,31 +82505,31 @@ module.exports = { * operator. * @author Ian Christian Myers */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow `null` comparisons without type-checking operators", recommended: false, - url: "https://eslint.org/docs/rules/no-eq-null" + url: "https://eslint.org/docs/latest/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, @@ -94151,14 +82537,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 758 */ +/* 766 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -94166,16 +82550,20 @@ module.exports = { * @fileoverview Rule to flag use of eval() statement * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - const candidatesOfGlobalObject = Object.freeze(["global", "window", "globalThis"]); + /** * Checks a given node is a MemberExpression node which has the specified name's * property. @@ -94184,23 +82572,22 @@ const candidatesOfGlobalObject = Object.freeze(["global", "window", "globalThis" * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow the use of `eval()`", recommended: false, - url: "https://eslint.org/docs/rules/no-eval" + url: "https://eslint.org/docs/latest/rules/no-eval" }, schema: [{ type: "object", @@ -94216,13 +82603,13 @@ module.exports = { unexpected: "eval can be harmful." } }, - create(context) { const allowIndirect = Boolean(context.options[0] && context.options[0].allowIndirect); - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; let funcInfo = null; + /** - * Pushs a `this` scope (non-arrow function, class static block, or class field initializer) information to the stack. + * Pushes a `this` scope (non-arrow function, class static block, or class field initializer) information to the stack. * Top-level scopes are handled separately. * * This is used in order to check whether or not `this` binding is a @@ -94233,9 +82620,8 @@ module.exports = { * For class field initializers, this can be any node that is PropertyDefinition#value. * @returns {void} */ - function enterThisScope(node) { - const strict = context.getScope().isStrict; + const strict = sourceCode.getScope(node).isStrict; funcInfo = { upper: funcInfo, node, @@ -94245,15 +82631,15 @@ module.exports = { initialized: strict }; } + /** * Pops a variable scope from the stack. * @returns {void} */ - - function exitThisScope() { funcInfo = funcInfo.upper; } + /** * Reports a given node. * @@ -94266,8 +82652,6 @@ module.exports = { * @param {ASTNode} node A node to report. * @returns {void} */ - - function report(node) { const parent = node.parent; const locationNode = node.type === "MemberExpression" ? node.property : node; @@ -94278,99 +82662,86 @@ module.exports = { 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`. + let node = identifier.parent; + // To detect code like `window.window.eval`. while (isMember(node, name)) { node = node.parent; - } // Reports. - + } + // 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, - isTopLevelOfScript = node.sourceType !== "module" && !features.globalReturn; + const scope = sourceCode.getScope(node), + features = context.parserOptions.ecmaFeatures || {}, + strict = scope.isStrict || node.sourceType === "module" || features.globalReturn && scope.childScopes[0].isStrict, + isTopLevelOfScript = node.sourceType !== "module" && !features.globalReturn; funcInfo = { upper: null, node, @@ -94380,14 +82751,12 @@ module.exports = { initialized: true }; }, - - "Program:exit"() { - const globalScope = context.getScope(); + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); exitThisScope(); reportAccessingEval(globalScope); reportAccessingEvalViaGlobalObject(globalScope); }, - FunctionDeclaration: enterThisScope, "FunctionDeclaration:exit": exitThisScope, FunctionExpression: enterThisScope, @@ -94396,36 +82765,32 @@ module.exports = { "PropertyDefinition > *.value:exit": exitThisScope, StaticBlock: enterThisScope, "StaticBlock:exit": exitThisScope, - 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); - } // `this` at the top level of scripts always refers to the global object - + } + // `this` at the top level of scripts always refers to the global object if (funcInfo.isTopLevelOfScript || !funcInfo.strict && funcInfo.defaultThis) { // `this.eval` is possible built-in `eval`. report(node.parent); } } - }; } - }; /***/ }), -/* 759 */ +/* 767 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -94435,28 +82800,30 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow reassigning exceptions in `catch` clauses", recommended: true, - url: "https://eslint.org/docs/rules/no-ex-assign" + url: "https://eslint.org/docs/latest/rules/no-ex-assign" }, schema: [], messages: { unexpected: "Do not assign to the exception parameter." } }, - create(context) { + const sourceCode = context.sourceCode; + /** * Finds and reports references that are non initializer and writable. * @param {Variable} variable A variable to check. @@ -94470,19 +82837,16 @@ module.exports = { }); }); } - return { CatchClause(node) { - context.getDeclaredVariables(node).forEach(checkVariable); + sourceCode.getDeclaredVariables(node).forEach(checkVariable); } - }; } - }; /***/ }), -/* 760 */ +/* 768 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -94490,26 +82854,27 @@ module.exports = { * @fileoverview Rule to flag adding properties to native object's prototypes. * @author David Nelson */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); +const globals = __webpack_require__(586); -const astUtils = __webpack_require__(618); - -const globals = __webpack_require__(563); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow extending native types", recommended: false, - url: "https://eslint.org/docs/rules/no-extend-native" + url: "https://eslint.org/docs/latest/rules/no-extend-native" }, schema: [{ type: "object", @@ -94528,18 +82893,18 @@ module.exports = { unexpected: "{{builtin}} prototype is read only, properties should not be added." } }, - create(context) { const config = context.options[0] || {}; + const sourceCode = context.sourceCode; 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, @@ -94549,6 +82914,7 @@ module.exports = { } }); } + /** * Check to see if the `prototype` property of the given object * identifier node is being accessed. @@ -94558,32 +82924,29 @@ module.exports = { * 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: @@ -94595,20 +82958,16 @@ module.exports = { * 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 MemberExpression `*.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); @@ -94617,26 +82976,22 @@ module.exports = { reportNode(prototypeNode.parent, identifierNode.name); } } - return { - "Program:exit"() { - const globalScope = context.getScope(); + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); modifiedBuiltins.forEach(builtin => { const builtinVar = globalScope.set.get(builtin); - if (builtinVar && builtinVar.references) { builtinVar.references.map(ref => ref.identifier).forEach(checkAndReportPrototypeExtension); } }); } - }; } - }; /***/ }), -/* 761 */ +/* 769 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -94644,28 +82999,31 @@ module.exports = { * @fileoverview Rule to flag unnecessary bind calls * @author Bence Dányi */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ +const SIDE_EFFECT_FREE_NODE_TYPES = new Set(["Literal", "Identifier", "ThisExpression", "FunctionExpression"]); -const SIDE_EFFECT_FREE_NODE_TYPES = new Set(["Literal", "Identifier", "ThisExpression", "FunctionExpression"]); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow unnecessary calls to `.bind()`", recommended: false, - url: "https://eslint.org/docs/rules/no-extra-bind" + url: "https://eslint.org/docs/latest/rules/no-extra-bind" }, schema: [], fixable: "code", @@ -94673,10 +83031,10 @@ module.exports = { unexpected: "The function binding is unnecessary." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; let scopeInfo = null; + /** * Checks if a node is free of side effects. * @@ -94684,18 +83042,16 @@ module.exports = { * @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; @@ -94703,11 +83059,11 @@ module.exports = { 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. @@ -94716,28 +83072,28 @@ module.exports = { * 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. + 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(_ref => { let [start, end] = _ref; return fixer.removeRange([start.range[0], end.range[1]]); }); } - }); } + /** * Checks whether or not a given function node is the callee of `.bind()` * method. @@ -94747,25 +83103,22 @@ module.exports = { * 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. - + } + // 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), @@ -94773,6 +83126,7 @@ module.exports = { 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 @@ -94781,15 +83135,13 @@ module.exports = { * 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. @@ -94797,25 +83149,21 @@ module.exports = { * 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, @@ -94825,11 +83173,10 @@ module.exports = { ThisExpression: markAsThisFound }; } - }; /***/ }), -/* 762 */ +/* 770 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -94837,27 +83184,28 @@ module.exports = { * @fileoverview Rule to flag unnecessary double negation in Boolean contexts * @author Brandon Mills */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); +const eslintUtils = __webpack_require__(594); +const precedence = astUtils.getPrecedence; -const astUtils = __webpack_require__(618); - -const eslintUtils = __webpack_require__(571); - -const precedence = astUtils.getPrecedence; //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow unnecessary boolean casts", recommended: true, - url: "https://eslint.org/docs/rules/no-extra-boolean-cast" + url: "https://eslint.org/docs/latest/rules/no-extra-boolean-cast" }, schema: [{ type: "object", @@ -94875,79 +83223,76 @@ module.exports = { unexpectedNegation: "Redundant double negation." } }, - create(context) { - const sourceCode = context.getSourceCode(); // Node types which have a test which will coerce values to booleans. + const sourceCode = context.sourceCode; + // Node types which have a test which will coerce values to booleans. const BOOLEAN_NODE_TYPES = new Set(["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.has(node.parent.type) && node === node.parent.test || // ! + return isBooleanFunctionOrConstructorCall(node.parent) && node === node.parent.arguments[0] || BOOLEAN_NODE_TYPES.has(node.parent.type) && 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 + 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 @@ -94958,170 +83303,139 @@ module.exports = { * @throws {Error} (Unreachable.) * @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 - + } + // 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); /* c8 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 + 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 - + } + // two or more arguments return null; } - }); } } - }; } - }; /***/ }), -/* 763 */ +/* 771 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -95129,24 +83443,26 @@ module.exports = { * @fileoverview Rule to disallow unnecessary labels * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow unnecessary labels", recommended: false, - url: "https://eslint.org/docs/rules/no-extra-label" + url: "https://eslint.org/docs/latest/rules/no-extra-label" }, schema: [], fixable: "code", @@ -95154,16 +83470,15 @@ module.exports = { unexpected: "This label '{{name}}' is unnecessary." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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, @@ -95171,15 +83486,15 @@ module.exports = { upper: scopeInfo }; } + /** * Removes the top scope of the stack. * @returns {void} */ - - function exitBreakableStatement() { scopeInfo = scopeInfo.upper; } + /** * Creates a new scope with a labeled statement. * @@ -95188,8 +83503,6 @@ module.exports = { * @param {ASTNode} node A node to create. This is a LabeledStatement. * @returns {void} */ - - function enterLabeledStatement(node) { if (!astUtils.isBreakableStatement(node.body)) { scopeInfo = { @@ -95199,6 +83512,7 @@ module.exports = { }; } } + /** * Removes the top scope of the stack. * @@ -95207,28 +83521,23 @@ module.exports = { * @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) { @@ -95236,25 +83545,19 @@ module.exports = { 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, @@ -95274,11 +83577,10 @@ module.exports = { ContinueStatement: reportIfUnnecessary }; } - }; /***/ }), -/* 764 */ +/* 772 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -95286,25 +83588,24 @@ module.exports = { * @fileoverview Disallow parenthesising higher precedence subexpressions. * @author Michael Ficarra */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ - const { isParenthesized: isParenthesizedRaw -} = __webpack_require__(571); +} = __webpack_require__(594); +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Disallow unnecessary parentheses", recommended: false, - url: "https://eslint.org/docs/rules/no-extra-parens" + url: "https://eslint.org/docs/latest/rules/no-extra-parens" }, fixable: "code", schema: { @@ -95345,6 +83646,9 @@ module.exports = { }, enforceForFunctionPrototypeMethods: { type: "boolean" + }, + allowParensAfterCommentPattern: { + type: "string" } }, additionalProperties: false @@ -95357,9 +83661,8 @@ module.exports = { unexpected: "Unnecessary parentheses around expression." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const tokensToIgnore = new WeakSet(); const precedence = astUtils.getPrecedence; const ALL_NODES = context.options[0] !== "functions"; @@ -95371,6 +83674,7 @@ module.exports = { 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 ALLOW_PARENS_AFTER_COMMENT_PATTERN = ALL_NODES && context.options[1] && context.options[1].allowParensAfterCommentPattern; const PRECEDENCE_OF_ASSIGNMENT_EXPR = precedence({ type: "AssignmentExpression" }); @@ -95378,6 +83682,7 @@ module.exports = { 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() @@ -95385,45 +83690,41 @@ module.exports = { * @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 + // 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 + // Exclude this JSX element if it is single-line element case "single-line": return !isSingleLine; - // Nothing special to be done for JSX elements + // Nothing special to be done for JSX elements case "none": break; + // no default } } @@ -95431,46 +83732,42 @@ module.exports = { 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. @@ -95478,11 +83775,10 @@ module.exports = { * @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. @@ -95493,105 +83789,92 @@ module.exports = { * @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 + 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. @@ -95600,23 +83883,19 @@ module.exports = { * @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, { @@ -95627,14 +83906,13 @@ module.exports = { }); 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 @@ -95644,17 +83922,17 @@ module.exports = { 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, @@ -95662,53 +83940,52 @@ module.exports = { * @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; } + if (ALLOW_PARENS_AFTER_COMMENT_PATTERN) { + const commentsBeforeLeftParenToken = sourceCode.getCommentsBefore(leftParenToken); + const totalCommentsBeforeLeftParenTokenCount = commentsBeforeLeftParenToken.length; + const ignorePattern = new RegExp(ALLOW_PARENS_AFTER_COMMENT_PATTERN, "u"); + if (totalCommentsBeforeLeftParenTokenCount > 0 && ignorePattern.test(commentsBeforeLeftParenToken[totalCommentsBeforeLeftParenTokenCount - 1].value)) { + 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, @@ -95716,70 +83993,67 @@ module.exports = { }); 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))) { - if (hasDoubleExcessParens(callee) || !(isIIFE(node) || // (new A)(); new (new A)(); - callee.type === "NewExpression" && !isNewExpressionWithParens(callee) && !(node.type === "NewExpression" && !isNewExpressionWithParens(node)) || // new (a().b)(); new (a.b().c); - node.type === "NewExpression" && callee.type === "MemberExpression" && doesMemberExpressionContainCallExpression(callee) || // (a?.b)(); (a?.())(); + if (hasDoubleExcessParens(callee) || !(isIIFE(node) || + // (new A)(); new (new A)(); + + callee.type === "NewExpression" && !isNewExpressionWithParens(callee) && !(node.type === "NewExpression" && !isNewExpressionWithParens(node)) || + // new (a().b)(); new (a.b().c); + + node.type === "NewExpression" && callee.type === "MemberExpression" && doesMemberExpressionContainCallExpression(callee) || + // (a?.b)(); (a?.())(); + !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); @@ -95787,77 +84061,68 @@ module.exports = { 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 (!(["AwaitExpression", "UnaryExpression"].includes(node.left.type) && 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. @@ -95865,27 +84130,22 @@ module.exports = { * @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; - /* c8 ignore start */ + /* c8 ignore start */ if (currentNode === null) { throw new Error("Nodes are not in the ancestor-descendant relationship."); - } - /* c8 ignore stop */ - + } /* c8 ignore stop */ path.push(currentNode); } - return path; } + /** * Finds the path from the given node to the specified descendant. * @param {ASTNode} node First node in the path. @@ -95893,11 +84153,10 @@ module.exports = { * @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. @@ -95905,8 +84164,6 @@ module.exports = { * @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": @@ -95916,32 +84173,26 @@ module.exports = { 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, @@ -95949,19 +84200,17 @@ module.exports = { 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); @@ -95974,191 +84223,189 @@ module.exports = { return 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; } + /** + * Checks if the left-hand side of an assignment is an identifier, the operator is one of + * `=`, `&&=`, `||=` or `??=` and the right-hand side is an anonymous class or function. + * + * As per https://tc39.es/ecma262/#sec-assignment-operators-runtime-semantics-evaluation, an + * assignment involving one of the operators `=`, `&&=`, `||=` or `??=` where the right-hand + * side is an anonymous class or function and the left-hand side is an *unparenthesized* + * identifier has different semantics than other assignments. + * Specifically, when an expression like `foo = function () {}` is evaluated, `foo.name` + * will be set to the string "foo", i.e. the identifier name. The same thing does not happen + * when evaluating `(foo) = function () {}`. + * Since the parenthesizing of the identifier in the left-hand side is significant in this + * special case, the parentheses, if present, should not be flagged as unnecessary. + * @param {ASTNode} node an AssignmentExpression node. + * @returns {boolean} `true` if the left-hand side of the assignment is an identifier, the + * operator is one of `=`, `&&=`, `||=` or `??=` and the right-hand side is an anonymous + * class or function; otherwise, `false`. + */ + function isAnonymousFunctionAssignmentException(_ref2) { + let { + left, + operator, + right + } = _ref2; + if (left.type === "Identifier" && ["=", "&&=", "||=", "??="].includes(operator)) { + const rhsType = right.type; + if (rhsType === "ArrowFunctionExpression") { + return true; + } + if ((rhsType === "FunctionExpression" || rhsType === "ClassExpression") && !right.id) { + return true; + } + } + 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)) { + if (canBeAssignmentTarget(node.left) && hasExcessParens(node.left) && (!isAnonymousFunctionAssignmentException(node) || isParenthesisedTwice(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, - 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(node) { if (node.left.type !== "VariableDeclaration") { const firstLeftToken = sourceCode.getFirstToken(node.left, astUtils.isNotOpeningParenToken); - if (firstLeftToken.value === "let" && astUtils.isOpeningBracketToken(sourceCode.getTokenAfter(firstLeftToken, astUtils.isNotClosingParenToken))) { // ForInStatement#left expression cannot start with `let[`. tokensToIgnore.add(firstLeftToken); } } - if (hasExcessParens(node.left)) { report(node.left); } - if (hasExcessParens(node.right)) { report(node.right); } }, - ForOfStatement(node) { if (node.left.type !== "VariableDeclaration") { const firstLeftToken = sourceCode.getFirstToken(node.left, astUtils.isNotOpeningParenToken); - if (firstLeftToken.value === "let") { // ForOfStatement#left expression cannot start with `let`. tokensToIgnore.add(firstLeftToken); } } - if (hasExcessParens(node.left)) { report(node.left); } - if (hasExcessParensWithPrecedence(node.right, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { report(node.right); } }, - 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) { if (node.init.type !== "VariableDeclaration") { const firstToken = sourceCode.getFirstToken(node.init, astUtils.isNotOpeningParenToken); - if (firstToken.value === "let" && astUtils.isOpeningBracketToken(sourceCode.getTokenAfter(firstToken, astUtils.isNotClosingParenToken))) { // ForStatement#init expression cannot start with `let[`. tokensToIgnore.add(firstToken); } } - startNewReportsBuffering(); - if (hasExcessParens(node.init)) { report(node.init); } } }, - "ForStatement > *.init:exit"(node) { /* * Removing parentheses around `in` expressions might change semantics and cause errors. @@ -96168,26 +84415,24 @@ module.exports = { * 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. @@ -96195,39 +84440,36 @@ module.exports = { * The remaining pair is safely enclosing the 'in' expression. */ return; - } // Exclude the outermost node only. - + } + // 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. + } + // 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) - + } + // 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); @@ -96236,124 +84478,99 @@ module.exports = { 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) + 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); } }, - "MethodDefinition[computed=true]"(node) { if (hasExcessParensWithPrecedence(node.key, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { report(node.key); } }, - 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); } } }, - PropertyDefinition(node) { if (node.computed && hasExcessParensWithPrecedence(node.key, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { report(node.key); } - if (node.value && hasExcessParensWithPrecedence(node.value, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { report(node.value); } }, - 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) + 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(node) { if (node.prefix) { checkArgumentWithPrecedence(node); @@ -96362,7 +84579,6 @@ module.exports = { argument } = node; const operatorToken = sourceCode.getLastToken(node); - if (argument.loc.end.line === operatorToken.loc.start.line) { checkArgumentWithPrecedence(node); } else { @@ -96372,70 +84588,58 @@ module.exports = { } } }, - AwaitExpression: checkArgumentWithPrecedence, - VariableDeclarator(node) { - if (node.init && hasExcessParensWithPrecedence(node.init, PRECEDENCE_OF_ASSIGNMENT_EXPR) && // RegExp literal is allowed to have parens (#1589) + 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); } } - }; } - }; /***/ }), -/* 765 */ +/* 773 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -96443,26 +84647,27 @@ module.exports = { * @fileoverview Rule to flag use of unnecessary semicolons * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const FixTracker = __webpack_require__(759); +const astUtils = __webpack_require__(639); -const FixTracker = __webpack_require__(752); - -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow unnecessary semicolons", recommended: true, - url: "https://eslint.org/docs/rules/no-extra-semi" + url: "https://eslint.org/docs/latest/rules/no-extra-semi" }, fixable: "code", schema: [], @@ -96470,39 +84675,35 @@ module.exports = { unexpected: "Unnecessary semicolon." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * 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); + return new FixTracker(fixer, context.sourceCode).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)) { @@ -96510,7 +84711,6 @@ module.exports = { } } } - return { /** * Reports this empty statement, except if the parent node is a loop. @@ -96519,13 +84719,11 @@ module.exports = { */ EmptyStatement(node) { const parent = node.parent, - allowedParentTypes = ["ForStatement", "ForInStatement", "ForOfStatement", "WhileStatement", "DoWhileStatement", "IfStatement", "LabeledStatement", "WithStatement"]; - + allowedParentTypes = ["ForStatement", "ForInStatement", "ForOfStatement", "WhileStatement", "DoWhileStatement", "IfStatement", "LabeledStatement", "WithStatement"]; if (!allowedParentTypes.includes(parent.type)) { 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. @@ -96543,26 +84741,44 @@ module.exports = { "MethodDefinition, PropertyDefinition, StaticBlock"(node) { checkForPartOfClassBody(sourceCode.getTokenAfter(node)); } - }; } - }; /***/ }), -/* 766 */ -/***/ ((module) => { +/* 774 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /** * @fileoverview Rule to flag fall-through cases in switch statements. * @author Matt DuVall */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ +const { + directivesPattern +} = __webpack_require__(537); + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ const DEFAULT_FALLTHROUGH_COMMENT = /falls?\s?through/iu; + +/** + * Checks whether or not a given comment string is really a fallthrough comment and not an ESLint directive. + * @param {string} comment The comment string to check. + * @param {RegExp} fallthroughCommentPattern The regular expression used for checking for fallthrough comments. + * @returns {boolean} `true` if the comment string is truly a fallthrough comment. + */ +function isFallThroughComment(comment, fallthroughCommentPattern) { + return fallthroughCommentPattern.test(comment) && !directivesPattern.test(comment.trim()); +} + /** * Checks whether or not a given case has a fallthrough comment. * @param {ASTNode} caseWhichFallsThrough SwitchCase node which falls through. @@ -96571,56 +84787,50 @@ const DEFAULT_FALLTHROUGH_COMMENT = /falls?\s?through/iu; * @param {RegExp} fallthroughCommentPattern A pattern to match comment to. * @returns {boolean} `true` if the case has a valid fallthrough comment. */ - function hasFallthroughComment(caseWhichFallsThrough, subsequentCase, context, fallthroughCommentPattern) { - const sourceCode = context.getSourceCode(); - + const sourceCode = context.sourceCode; if (caseWhichFallsThrough.consequent.length === 1 && caseWhichFallsThrough.consequent[0].type === "BlockStatement") { const trailingCloseBrace = sourceCode.getLastToken(caseWhichFallsThrough.consequent[0]); const commentInBlock = sourceCode.getCommentsBefore(trailingCloseBrace).pop(); - - if (commentInBlock && fallthroughCommentPattern.test(commentInBlock.value)) { + if (commentInBlock && isFallThroughComment(commentInBlock.value, fallthroughCommentPattern)) { return true; } } - const comment = sourceCode.getCommentsBefore(subsequentCase).pop(); - return Boolean(comment && fallthroughCommentPattern.test(comment.value)); + return Boolean(comment && isFallThroughComment(comment.value, fallthroughCommentPattern)); } + /** * 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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow fallthrough of `case` statements", recommended: true, - url: "https://eslint.org/docs/rules/no-fallthrough" + url: "https://eslint.org/docs/latest/rules/no-fallthrough" }, schema: [{ type: "object", @@ -96641,70 +84851,62 @@ module.exports = { default: "Expected a 'break' statement before 'default'." } }, - create(context) { const options = context.options[0] || {}; let currentCodePath = null; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const allowEmptyCase = options.allowEmptyCase || false; + /* * 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(fallthroughCase, 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 || !allowEmptyCase && hasBlankLinesBetween(node, nextToken)) && node.parent.cases[node.parent.cases.length - 1] !== node) { fallthroughCase = node; } } - }; } - }; /***/ }), -/* 767 */ +/* 775 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -96712,24 +84914,26 @@ module.exports = { * @fileoverview Rule to flag use of a leading/trailing decimal point in a numeric literal * @author James Allardice */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow leading or trailing decimal points in numeric literals", recommended: false, - url: "https://eslint.org/docs/rules/no-floating-decimal" + url: "https://eslint.org/docs/latest/rules/no-floating-decimal" }, schema: [], fixable: "code", @@ -96738,9 +84942,8 @@ module.exports = { trailing: "A trailing decimal point can be confused with a dot." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; return { Literal(node) { if (typeof node.value === "number") { @@ -96748,16 +84951,13 @@ module.exports = { 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, @@ -96767,14 +84967,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 768 */ +/* 776 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -96784,28 +84982,30 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow reassigning `function` declarations", recommended: true, - url: "https://eslint.org/docs/rules/no-func-assign" + url: "https://eslint.org/docs/latest/rules/no-func-assign" }, schema: [], messages: { isAFunction: "'{{name}}' is a function." } }, - create(context) { + const sourceCode = context.sourceCode; + /** * Reports a reference if is non initializer and writable. * @param {References} references Collection of reference to check. @@ -96822,39 +85022,35 @@ module.exports = { }); }); } + /** * 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); + sourceCode.getDeclaredVariables(node).forEach(checkVariable); } - return { FunctionDeclaration: checkForFunction, FunctionExpression: checkForFunction }; } - }; /***/ }), -/* 769 */ +/* 777 */ /***/ ((module) => { "use strict"; @@ -96862,19 +85058,21 @@ module.exports = { * @fileoverview Rule to disallow assignments to native objects or read-only global variables * @author Ilya Volodin */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow assignments to native objects or read-only global variables", recommended: true, - url: "https://eslint.org/docs/rules/no-global-assign" + url: "https://eslint.org/docs/latest/rules/no-global-assign" }, schema: [{ type: "object", @@ -96893,10 +85091,11 @@ module.exports = { globalShouldNotBeModified: "Read-only global '{{name}}' should not be modified." } }, - create(context) { const config = context.options[0]; + const sourceCode = context.sourceCode; const exceptions = config && config.exceptions || []; + /** * Reports write references. * @param {Reference} reference A reference to check. @@ -96904,10 +85103,8 @@ module.exports = { * @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, @@ -96923,32 +85120,28 @@ module.exports = { }); } } + /** * 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.includes(variable.name)) { variable.references.forEach(checkReference); } } - return { - Program() { - const globalScope = context.getScope(); + Program(node) { + const globalScope = sourceCode.getScope(node); globalScope.variables.forEach(checkVariable); } - }; } - }; /***/ }), -/* 770 */ +/* 778 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -96958,19 +85151,21 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // 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, @@ -96980,51 +85175,59 @@ function parseOptions(options) { allow: options.allow || [] }; } + /** * Checks whether or not a node is a double logical negating. * @param {ASTNode} node An UnaryExpression node to check. * @returns {boolean} Whether or not the node is a double logical negating. */ - - 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 given node logically represents multiplication by a fraction of `1`. + * For example, `a * 1` in `a * 1 / b` is technically multiplication by `1`, but the + * whole expression can be logically interpreted as `a * (1 / b)` rather than `(a * 1) / b`. + * @param {BinaryExpression} node A BinaryExpression node to check. + * @param {SourceCode} sourceCode The source code object. + * @returns {boolean} Whether or not the node is a multiplying by a fraction of `1`. + */ +function isMultiplyByFractionOfOne(node, sourceCode) { + return node.type === "BinaryExpression" && node.operator === "*" && node.right.type === "Literal" && node.right.value === 1 && node.parent.type === "BinaryExpression" && node.parent.operator === "/" && node.parent.left === node && !astUtils.isParenthesised(sourceCode, node); +} + /** * 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 @@ -97032,86 +85235,76 @@ function isNumeric(node) { * @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; - + right = node.right; if (right.type !== "BinaryExpression" && !isNumeric(right)) { return right; } - if (left.type !== "BinaryExpression" && !isNumeric(left)) { return left; } - return null; } + /** * Checks whether an expression evaluates to a string. * @param {ASTNode} node node that represents the expression to check. * @returns {boolean} Whether or not the expression evaluates to a string. */ - - function isStringType(node) { return astUtils.isStringLiteral(node) || node.type === "CallExpression" && node.callee.type === "Identifier" && node.callee.name === "String"; } + /** * 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) && !isStringType(node.right) || isEmptyString(node.right) && !isStringType(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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow shorthand type conversions", recommended: false, - url: "https://eslint.org/docs/rules/no-implicit-coercion" + url: "https://eslint.org/docs/latest/rules/no-implicit-coercion" }, fixable: "code", schema: [{ @@ -97147,10 +85340,10 @@ module.exports = { useRecommendation: "use `{{recommendation}}` instead." } }, - create(context) { const options = parseOptions(context.options[0] || {}); - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * Reports an error and autofixes the node * @param {ASTNode} node An ast node to report the error on. @@ -97158,7 +85351,6 @@ module.exports = { * @param {bool} shouldFix Whether this report should fix the node * @returns {void} */ - function report(node, recommendation, shouldFix) { context.report({ node, @@ -97166,128 +85358,112 @@ module.exports = { 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 + let operatorAllowed; + // !!foo operatorAllowed = options.allow.includes("!!"); - if (!operatorAllowed && options.boolean && isDoubleLogicalNegating(node)) { const recommendation = `Boolean(${sourceCode.getText(node.argument.argument)})`; report(node, recommendation, true); - } // ~foo.indexOf(bar) - + } + // ~foo.indexOf(bar) operatorAllowed = options.allow.includes("~"); - 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 - + } + // +foo operatorAllowed = options.allow.includes("+"); - 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 + let operatorAllowed; + // 1 * foo operatorAllowed = options.allow.includes("*"); - const nonNumericOperand = !operatorAllowed && options.number && isMultiplyByOne(node) && getNonNumericOperand(node); - + const nonNumericOperand = !operatorAllowed && options.number && isMultiplyByOne(node) && !isMultiplyByFractionOfOne(node, sourceCode) && getNonNumericOperand(node); if (nonNumericOperand) { const recommendation = `Number(${sourceCode.getText(nonNumericOperand)})`; report(node, recommendation, true); - } // "" + foo - + } + // "" + foo operatorAllowed = options.allow.includes("+"); - if (!operatorAllowed && options.string && isConcatWithEmptyString(node)) { const recommendation = `String(${sourceCode.getText(getNonEmptyOperand(node))})`; report(node, recommendation, true); } }, - AssignmentExpression(node) { // foo += "" const operatorAllowed = options.allow.includes("+"); - if (!operatorAllowed && options.string && isAppendEmptyString(node)) { const code = sourceCode.getText(getNonEmptyOperand(node)); const recommendation = `${code} = String(${code})`; report(node, recommendation, true); } }, - TemplateLiteral(node) { if (!options.disallowTemplateShorthand) { return; - } // tag`${foo}` - + } + // tag`${foo}` if (node.parent.type === "TaggedTemplateExpression") { return; - } // `` or `${foo}${bar}` - - - if (node.expressions.length !== 1) { - return; - } // `prefix${foo}` - - - if (node.quasis[0].value.cooked !== "") { - return; - } // `${foo}postfix` - - - if (node.quasis[1].value.cooked !== "") { - return; - } // if the expression is already a string, then this isn't a coercion - - - if (isStringType(node.expressions[0])) { - return; } + // `` or `${foo}${bar}` + if (node.expressions.length !== 1) { + return; + } + + // `prefix${foo}` + if (node.quasis[0].value.cooked !== "") { + return; + } + + // `${foo}postfix` + if (node.quasis[1].value.cooked !== "") { + return; + } + + // if the expression is already a string, then this isn't a coercion + if (isStringType(node.expressions[0])) { + return; + } const code = sourceCode.getText(node.expressions[0]); const recommendation = `String(${code})`; report(node, recommendation, true); } - }; } - }; /***/ }), -/* 771 */ +/* 779 */ /***/ ((module) => { "use strict"; @@ -97295,19 +85471,21 @@ module.exports = { * @fileoverview Rule to check for implicit global variables, functions and classes. * @author Joshua Peek */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow declarations in the global scope", recommended: false, - url: "https://eslint.org/docs/rules/no-implicit-globals" + url: "https://eslint.org/docs/latest/rules/no-implicit-globals" }, schema: [{ type: "object", @@ -97327,9 +85505,10 @@ module.exports = { redeclarationOfReadonlyGlobal: "Unexpected redeclaration of read-only global variable." } }, - create(context) { const checkLexicalBindings = context.options[0] && context.options[0].lexicalBindings === true; + const sourceCode = context.sourceCode; + /** * Reports the node. * @param {ASTNode} node Node to report. @@ -97337,7 +85516,6 @@ module.exports = { * @param {string|undefined} kind Declaration kind, can be 'var', 'const', 'let', function or class. * @returns {void} */ - function report(node, messageId, kind) { context.report({ node, @@ -97347,23 +85525,24 @@ module.exports = { } }); } - return { - Program() { - const scope = context.getScope(); + Program(node) { + const scope = sourceCode.getScope(node); 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; } + // Variables exported by "exported" block comments + if (variable.eslintExported) { + 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"); @@ -97371,7 +85550,6 @@ module.exports = { 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) { @@ -97382,38 +85560,35 @@ module.exports = { } } }); - }); // Undeclared assigned variables. + }); + // 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. - + } + // def.node is an AssignmentExpression, ForInStatement or ForOfStatement. variable.defs.forEach(def => { report(def.node, messageId); }); }); } - }; } - }; /***/ }), -/* 772 */ +/* 780 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -97421,70 +85596,66 @@ module.exports = { * @fileoverview Rule to flag use of implied eval via setTimeout and setInterval * @author James Allardice */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - -const astUtils = __webpack_require__(618); - +const astUtils = __webpack_require__(639); const { getStaticValue -} = __webpack_require__(571); //------------------------------------------------------------------------------ +} = __webpack_require__(594); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow the use of `eval()`-like methods", recommended: false, - url: "https://eslint.org/docs/rules/no-implied-eval" + url: "https://eslint.org/docs/latest/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; + const sourceCode = context.sourceCode; + /** * 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 staticValue = getStaticValue(firstArgument, sourceCode.getScope(node)); const isStaticString = staticValue && typeof staticValue.value === "string"; const isString = isStaticString || isEvaluatedString(firstArgument); - if (isString) { context.report({ node, @@ -97493,13 +85664,12 @@ module.exports = { } } } + /** * Reports calls of `implied eval` via the global references. * @param {Variable} globalVar A global variable to check. * @returns {void} */ - - function reportImpliedEvalViaGlobal(globalVar) { const { references, @@ -97508,44 +85678,39 @@ module.exports = { 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(); + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); GLOBAL_CANDIDATES.map(candidate => astUtils.getVariableByName(globalScope, candidate)).filter(globalVar => !!globalVar && globalVar.defs.length === 0).forEach(reportImpliedEvalViaGlobal); } - }; } - }; /***/ }), -/* 773 */ +/* 781 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -97553,40 +85718,40 @@ module.exports = { * @fileoverview Rule to flag updates of imported bindings. * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - const { findVariable -} = __webpack_require__(571); - -const astUtils = __webpack_require__(618); - +} = __webpack_require__(594); +const astUtils = __webpack_require__(639); 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 + 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 { @@ -97594,19 +85759,19 @@ function isOperandOfMutationUnaryOperator(node) { } = 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` @@ -97622,69 +85787,59 @@ function isIterationVariable(node) { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow assigning to imported bindings", recommended: true, - url: "https://eslint.org/docs/rules/no-import-assign" + url: "https://eslint.org/docs/latest/rules/no-import-assign" }, schema: [], messages: { @@ -97692,30 +85847,26 @@ module.exports = { readonlyMember: "The members of '{{name}}' are read-only." } }, - create(context) { + const sourceCode = context.sourceCode; return { ImportDeclaration(node) { - const scope = context.getScope(); - - for (const variable of context.getDeclaredVariables(node)) { + const scope = sourceCode.getScope(node); + for (const variable of sourceCode.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), @@ -97736,14 +85887,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 774 */ +/* 782 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -97753,20 +85902,20 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow inline comments after code", recommended: false, - url: "https://eslint.org/docs/rules/no-inline-comments" + url: "https://eslint.org/docs/latest/rules/no-inline-comments" }, schema: [{ type: "object", @@ -97781,75 +85930,70 @@ module.exports = { unexpectedInlineComment: "Unexpected comment inline with code." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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 + 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; } + // 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); } - }; } - }; /***/ }), -/* 775 */ +/* 783 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -97857,54 +86001,52 @@ module.exports = { * @fileoverview Rule to enforce declarations in program or function body root. * @author Brandon Mills */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ - const validParent = new Set(["Program", "StaticBlock", "ExportNamedDeclaration", "ExportDefaultDeclaration"]); const validBlockStatementParent = new Set(["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"]); + /** * Finds the nearest enclosing context where this rule allows declarations and returns its description. * @param {ASTNode} node Node to search from. * @returns {string} Description. One of "program", "function body", "class static block body". */ - function getAllowedBodyDescription(node) { let { parent } = node; - while (parent) { if (parent.type === "StaticBlock") { return "class static block body"; } - if (astUtils.isFunction(parent)) { return "function body"; } - ({ parent } = parent); } - return "program"; } + /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow variable or `function` declarations in nested blocks", recommended: true, - url: "https://eslint.org/docs/rules/no-inner-declarations" + url: "https://eslint.org/docs/latest/rules/no-inner-declarations" }, schema: [{ enum: ["functions", "both"] @@ -97913,7 +86055,6 @@ module.exports = { moveDeclToRoot: "Move {{type}} declaration to {{body}} root." } }, - create(context) { /** * Ensure that a given node is at a program or function body's root. @@ -97922,15 +86063,12 @@ module.exports = { */ function check(node) { const parent = node.parent; - if (parent.type === "BlockStatement" && validBlockStatementParent.has(parent.parent.type)) { return; } - if (validParent.has(parent.type)) { return; } - context.report({ node, messageId: "moveDeclToRoot", @@ -97940,23 +86078,19 @@ module.exports = { } }); } - return { FunctionDeclaration: check, - VariableDeclaration(node) { if (context.options[0] === "both" && node.kind === "var") { check(node); } } - }; } - }; /***/ }), -/* 776 */ +/* 784 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -97964,27 +86098,28 @@ module.exports = { * @fileoverview Validate strings passed to the RegExp constructor * @author Michael Ficarra */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - -const RegExpValidator = (__webpack_require__(741).RegExpValidator); - +const RegExpValidator = (__webpack_require__(748).RegExpValidator); const validator = new RegExpValidator(); const validFlags = /[dgimsuy]/gu; -const undefined1 = void 0; //------------------------------------------------------------------------------ +const undefined1 = void 0; + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow invalid regular expression strings in `RegExp` constructors", recommended: true, - url: "https://eslint.org/docs/rules/no-invalid-regexp" + url: "https://eslint.org/docs/latest/rules/no-invalid-regexp" }, schema: [{ type: "object", @@ -98002,29 +86137,42 @@ module.exports = { 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"); } } + + /** + * Reports error with the provided message. + * @param {ASTNode} node The node holding the invalid RegExp + * @param {string} message The message to report. + * @returns {void} + */ + function report(node, message) { + context.report({ + node, + messageId: "regexMessage", + data: { + message + } + }); + } + /** * 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"; } + /** * Gets flags of a regular expression created by the given `RegExp()` or `new RegExp()` call * Examples: @@ -98035,27 +86183,22 @@ module.exports = { * @returns {string|null} flags if they can be determined, `null` otherwise * @private */ - - function getFlags(node) { if (node.arguments.length < 2) { return ""; } - if (isString(node.arguments[1])) { return node.arguments[1].value; } - return null; } + /** * 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); @@ -98064,14 +86207,16 @@ module.exports = { return err.message; } } + /** * Check syntax error in a given flags. - * @param {string} flags The RegExp flags to validate. + * @param {string|null} flags The RegExp flags to validate. * @returns {string|null} The syntax error. */ - - function validateRegExpFlags(flags) { + if (!flags) { + return null; + } try { validator.validateFlags(flags); return null; @@ -98079,41 +86224,37 @@ module.exports = { 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])) { + if (node.callee.type !== "Identifier" || node.callee.name !== "RegExp") { return; } - - const pattern = node.arguments[0].value; let flags = getFlags(node); - if (flags && allowedFlags) { flags = flags.replace(allowedFlags, ""); } - - const message = flags && validateRegExpFlags(flags) || ( // If flags are unknown, report the regex only if its pattern is invalid both with and without the "u" flag - flags === null ? validateRegExpPattern(pattern, true) && validateRegExpPattern(pattern, false) : validateRegExpPattern(pattern, flags.includes("u"))); - + let message = validateRegExpFlags(flags); if (message) { - context.report({ - node, - messageId: "regexMessage", - data: { - message - } - }); + report(node, message); + return; + } + if (!isString(node.arguments[0])) { + return; + } + const pattern = node.arguments[0].value; + message = + // If flags are unknown, report the regex only if its pattern is invalid both with and without the "u" flag + flags === null ? validateRegExpPattern(pattern, true) && validateRegExpPattern(pattern, false) : validateRegExpPattern(pattern, flags.includes("u")); + if (message) { + report(node, message); } } - }; } - }; /***/ }), -/* 777 */ +/* 785 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -98121,11 +86262,15 @@ module.exports = { * @fileoverview A rule to disallow `this` keywords in contexts where the value of `this` is `undefined`. * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -98136,24 +86281,22 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @param {ASTNode} node Node that started the code path. * @returns {boolean} `true` if it is a code path with lexical `this` binding. */ - - function isCodePathWithLexicalThis(codePath, node) { return codePath.origin === "function" && node.type === "ArrowFunctionExpression"; -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow use of `this` in contexts where the value of `this` is `undefined`", recommended: false, - url: "https://eslint.org/docs/rules/no-invalid-this" + url: "https://eslint.org/docs/latest/rules/no-invalid-this" }, schema: [{ type: "object", @@ -98169,12 +86312,12 @@ module.exports = { unexpectedThis: "Unexpected 'this'." } }, - create(context) { const options = context.options[0] || {}; const capIsConstructor = options.capIsConstructor !== false; const stack = [], - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; + /** * Gets the current checking context. * @@ -98183,30 +86326,26 @@ module.exports = { * @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; }; - return { onCodePathStart(codePath, node) { if (isCodePathWithLexicalThis(codePath, node)) { return; } - if (codePath.origin === "program") { - const scope = context.getScope(); - const features = context.parserOptions.ecmaFeatures || {}; // `this` at the top level of scripts always refers to the global object + const scope = sourceCode.getScope(node); + const features = context.parserOptions.ecmaFeatures || {}; + // `this` at the top level of scripts always refers to the global object stack.push({ init: true, node, @@ -98214,6 +86353,7 @@ module.exports = { }); return; } + /* * `init: false` means that `valid` isn't determined yet. * Most functions don't use `this`, and the calculation for `valid` @@ -98222,27 +86362,21 @@ module.exports = { * functions, because `this` refers to the global object and therefore is * always valid, so we can set `init: true` right away. */ - - stack.push({ - init: !context.getScope().isStrict, + init: !sourceCode.getScope(node).isStrict, node, valid: true }); }, - onCodePathEnd(codePath, node) { if (isCodePathWithLexicalThis(codePath, node)) { return; } - stack.pop(); }, - // Reports if `this` of the current context is invalid. ThisExpression(node) { const current = stack.getCurrent(); - if (current && !current.valid) { context.report({ node, @@ -98250,14 +86384,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 778 */ +/* 786 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -98266,31 +86398,35 @@ module.exports = { * @author Jonathan Kingston * @author Christophe Porteneuve */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // 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(); //------------------------------------------------------------------------------ +const LINE_BREAK = astUtils.createGlobalLinebreakMatcher(); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow irregular whitespace", recommended: true, - url: "https://eslint.org/docs/rules/no-irregular-whitespace" + url: "https://eslint.org/docs/latest/rules/no-irregular-whitespace" }, schema: [{ type: "object", @@ -98318,25 +86454,25 @@ module.exports = { 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`. + 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 sourceCode = context.sourceCode; const commentNodes = sourceCode.getAllComments(); + /** * Removes errors that occur inside the given 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; @@ -98349,18 +86485,16 @@ module.exports = { return errorLocStart.line < locStart.line || errorLocStart.line === locStart.line && errorLocStart.column < locStart.column || errorLocStart.line === locEnd.line && errorLocStart.column >= locEnd.column || errorLocStart.line > locEnd.line; }); } + /** * 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)) { @@ -98368,14 +86502,13 @@ module.exports = { } } } + /** * 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)) { @@ -98383,33 +86516,30 @@ module.exports = { } } } + /** * 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, @@ -98428,21 +86558,19 @@ module.exports = { } }); } + /** * 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); + sourceLines = sourceCode.lines, + linebreaks = source.match(LINE_BREAK); let lastLineIndex = -1, - match; - + match; while ((match = IRREGULAR_LINE_TERMINATORS.exec(source)) !== null) { const lineIndex = linebreaks.indexOf(match[0], lastLineIndex + 1) || 0; errors.push({ @@ -98462,17 +86590,14 @@ module.exports = { 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) { /* @@ -98488,31 +86613,27 @@ module.exports = { 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 - + } + // If we have any errors remaining report on them errors.forEach(error => context.report(error)); }; } else { nodes.Program = noop; } - return nodes; } - }; /***/ }), -/* 779 */ +/* 787 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -98520,33 +86641,34 @@ module.exports = { * @fileoverview Rule to flag usage of __iterator__ property * @author Ian Christian Myers */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - const { getStaticPropertyName -} = __webpack_require__(618); //------------------------------------------------------------------------------ +} = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow the use of the `__iterator__` property", recommended: false, - url: "https://eslint.org/docs/rules/no-iterator" + url: "https://eslint.org/docs/latest/rules/no-iterator" }, schema: [], messages: { noIterator: "Reserved name '__iterator__'." } }, - create(context) { return { MemberExpression(node) { @@ -98557,14 +86679,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 780 */ +/* 788 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -98572,32 +86692,35 @@ module.exports = { * @fileoverview Rule to flag labels that are the same as an identifier * @author Ian Christian Myers */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow labels that share a name with a variable", recommended: false, - url: "https://eslint.org/docs/rules/no-label-var" + url: "https://eslint.org/docs/latest/rules/no-label-var" }, schema: [], messages: { identifierClashWithLabel: "Found identifier with same name as label." } }, - create(context) { + const sourceCode = context.sourceCode; + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -98611,20 +86734,21 @@ module.exports = { */ function findIdentifier(scope, name) { return astUtils.getVariableByName(scope, name) !== null; - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public API //-------------------------------------------------------------------------- - return { LabeledStatement(node) { // Fetch the innermost scope. - const scope = context.getScope(); + const scope = sourceCode.getScope(node); + /* * Recursively find the identifier walking up the scope, starting * with the innermost scope. */ - if (findIdentifier(scope, node.label.name)) { context.report({ node, @@ -98632,14 +86756,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 781 */ +/* 789 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -98647,24 +86769,25 @@ module.exports = { * @fileoverview Disallow Labeled Statements * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow labeled statements", recommended: false, - url: "https://eslint.org/docs/rules/no-labels" + url: "https://eslint.org/docs/latest/rules/no-labels" }, schema: [{ type: "object", @@ -98686,74 +86809,65 @@ module.exports = { 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; } + /* c8 ignore next */ - - return "other"; - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- - return { LabeledStatement(node) { scopeInfo = { @@ -98762,7 +86876,6 @@ module.exports = { upper: scopeInfo }; }, - "LabeledStatement:exit"(node) { if (!isAllowed(scopeInfo.kind)) { context.report({ @@ -98770,10 +86883,8 @@ module.exports = { messageId: "unexpectedLabel" }); } - scopeInfo = scopeInfo.upper; }, - BreakStatement(node) { if (node.label && !isAllowed(getKind(node.label.name))) { context.report({ @@ -98782,7 +86893,6 @@ module.exports = { }); } }, - ContinueStatement(node) { if (node.label && !isAllowed(getKind(node.label.name))) { context.report({ @@ -98791,14 +86901,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 782 */ +/* 790 */ /***/ ((module) => { "use strict"; @@ -98806,19 +86914,21 @@ module.exports = { * @fileoverview Rule to flag blocks with no reason to exist * @author Brandon Mills */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow unnecessary nested blocks", recommended: false, - url: "https://eslint.org/docs/rules/no-lone-blocks" + url: "https://eslint.org/docs/latest/rules/no-lone-blocks" }, schema: [], messages: { @@ -98826,17 +86936,17 @@ module.exports = { redundantNestedBlock: "Nested block is redundant." } }, - create(context) { // A stack of lone blocks to be checked for block-level bindings const loneBlocks = []; let ruleDef; + const sourceCode = context.sourceCode; + /** * Reports a node as invalid. * @param {ASTNode} node The node to be reported. * @returns {void} */ - function report(node) { const messageId = node.parent.type === "BlockStatement" || node.parent.type === "StaticBlock" ? "redundantNestedBlock" : "redundantBlock"; context.report({ @@ -98844,46 +86954,44 @@ module.exports = { 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 === "StaticBlock" || node.parent.type === "Program" || // Don't report blocks in switch cases if the block is the only statement of the case. + return node.parent.type === "BlockStatement" || node.parent.type === "StaticBlock" || 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. + * @param {ASTNode} node The current node to check. * @returns {void} */ - - - function markLoneBlock() { + function markLoneBlock(node) { if (loneBlocks.length === 0) { return; } - - const block = context.getAncestors().pop(); - + const block = node.parent; if (loneBlocks[loneBlocks.length - 1] === block) { loneBlocks.pop(); } - } // Default rule definition: report all lone blocks - + } + // 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 - + // ES6: report blocks without block-level bindings, or that's only child of another block if (context.languageOptions.ecmaVersion >= 2015) { ruleDef = { BlockStatement(node) { @@ -98891,7 +86999,6 @@ module.exports = { loneBlocks.push(node); } }, - "BlockStatement:exit"(node) { if (loneBlocks.length > 0 && loneBlocks[loneBlocks.length - 1] === node) { loneBlocks.pop(); @@ -98900,31 +87007,25 @@ module.exports = { report(node); } } - }; - ruleDef.VariableDeclaration = function (node) { if (node.kind === "let" || node.kind === "const") { - markLoneBlock(); + markLoneBlock(node); } }; - - ruleDef.FunctionDeclaration = function () { - if (context.getScope().isStrict) { - markLoneBlock(); + ruleDef.FunctionDeclaration = function (node) { + if (sourceCode.getScope(node).isStrict) { + markLoneBlock(node); } }; - ruleDef.ClassDeclaration = markLoneBlock; } - return ruleDef; } - }; /***/ }), -/* 783 */ +/* 791 */ /***/ ((module) => { "use strict"; @@ -98932,19 +87033,20 @@ module.exports = { * @fileoverview Rule to disallow if as the only statement in an else block * @author Brandon Mills */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow `if` statements as the only statement in `else` blocks", recommended: false, - url: "https://eslint.org/docs/rules/no-lonely-if" + url: "https://eslint.org/docs/latest/rules/no-lonely-if" }, schema: [], fixable: "code", @@ -98952,20 +87054,16 @@ module.exports = { unexpectedLonelyIf: "Unexpected if as the only statement in an else block." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; return { IfStatement(node) { - const ancestors = context.getAncestors(), - parent = ancestors.pop(), - grandparent = ancestors.pop(); - + const parent = node.parent, + grandparent = parent.parent; 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); @@ -98973,12 +87071,10 @@ module.exports = { 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 @@ -98986,21 +87082,17 @@ module.exports = { */ return null; } - return fixer.replaceTextRange([openingElseCurly.range[0], closingElseCurly.range[1]], (elseKeyword.range[1] === openingElseCurly.range[0] ? " " : "") + sourceCode.getText(node)); } - }); } } - }; } - }; /***/ }), -/* 784 */ +/* 792 */ /***/ ((module) => { "use strict"; @@ -99008,7 +87100,10 @@ module.exports = { * @fileoverview Rule to flag creation of function inside a loop * @author Ilya Volodin */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -99021,46 +87116,38 @@ module.exports = { * @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. @@ -99069,20 +87156,17 @@ function getContainingLoopNode(node) { * 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. @@ -99090,33 +87174,31 @@ function getTopLoopNode(node, excludedNode) { * @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. + 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 @@ -99128,35 +87210,34 @@ function isSafe(loopNode, reference) { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow function declarations that contain unsafe references inside loop statements", recommended: false, - url: "https://eslint.org/docs/rules/no-loop-func" + url: "https://eslint.org/docs/latest/rules/no-loop-func" }, schema: [], messages: { unsafeRefs: "Function declared in a loop contains unsafe references to variable(s) {{ varNames }}." } }, - create(context) { + const sourceCode = context.sourceCode; + /** * Reports functions which match the following condition: * @@ -99167,14 +87248,11 @@ module.exports = { */ function checkForLoops(node) { const loopNode = getContainingLoopNode(node); - if (!loopNode) { return; } - - const references = context.getScope().through; + const references = sourceCode.getScope(node).through; const unsafeRefs = references.filter(r => !isSafe(loopNode, r)).map(r => r.identifier.name); - if (unsafeRefs.length > 0) { context.report({ node, @@ -99185,18 +87263,16 @@ module.exports = { }); } } - return { ArrowFunctionExpression: checkForLoops, FunctionExpression: checkForLoops, FunctionDeclaration: checkForLoops }; } - }; /***/ }), -/* 785 */ +/* 793 */ /***/ ((module) => { "use strict"; @@ -99204,26 +87280,27 @@ module.exports = { * @fileoverview Rule to flag numbers that will lose significant figure precision at runtime * @author Jacob Moore */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow literal numbers that lose precision", recommended: true, - url: "https://eslint.org/docs/rules/no-loss-of-precision" + url: "https://eslint.org/docs/latest/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 @@ -99233,38 +87310,34 @@ module.exports = { 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")) { @@ -99272,46 +87345,41 @@ module.exports = { } 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 integer's coefficient and order of magnitude + * Converts an integer to an object containing 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 integer's coefficient and order of magnitude */ - - function normalizeInteger(stringInteger) { const significantDigits = removeTrailingZeros(removeLeadingZeros(stringInteger)); return { @@ -99319,17 +87387,15 @@ module.exports = { coefficient: addDecimalPointToNumber(significantDigits) }; } + /** * - * Converts a float to to an object containing the floats's coefficient and order of magnitude + * Converts a float to an object containing 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 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); @@ -99338,19 +87404,17 @@ module.exports = { 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]; @@ -99359,36 +87423,31 @@ module.exports = { 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)) { @@ -99398,14 +87457,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 786 */ +/* 794 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -99415,10 +87472,13 @@ module.exports = { */ -const astUtils = __webpack_require__(618); // Maximum array length by the ECMAScript Specification. +const astUtils = __webpack_require__(639); -const MAX_ARRAY_LENGTH = 2 ** 32 - 1; //------------------------------------------------------------------------------ +// Maximum array length by the ECMAScript Specification. +const MAX_ARRAY_LENGTH = 2 ** 32 - 1; + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -99427,24 +87487,21 @@ const MAX_ARRAY_LENGTH = 2 ** 32 - 1; //---------------------------------------- * @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; } + /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow magic numbers", recommended: false, - url: "https://eslint.org/docs/rules/no-magic-numbers" + url: "https://eslint.org/docs/latest/rules/no-magic-numbers" }, schema: [{ type: "object", @@ -99476,6 +87533,10 @@ module.exports = { ignoreDefaultValues: { type: "boolean", default: false + }, + ignoreClassFieldInitialValues: { + type: "boolean", + default: false } }, additionalProperties: false @@ -99485,46 +87546,55 @@ module.exports = { noMagic: "No magic number: {{raw}}." } }, - create(context) { const config = context.options[0] || {}, - detectObjects = !!config.detectObjects, - enforceConst = !!config.enforceConst, - ignore = new Set((config.ignore || []).map(normalizeIgnoreValue)), - ignoreArrayIndexes = !!config.ignoreArrayIndexes, - ignoreDefaultValues = !!config.ignoreDefaultValues; + detectObjects = !!config.detectObjects, + enforceConst = !!config.enforceConst, + ignore = new Set((config.ignore || []).map(normalizeIgnoreValue)), + ignoreArrayIndexes = !!config.ignoreArrayIndexes, + ignoreDefaultValues = !!config.ignoreDefaultValues, + ignoreClassFieldInitialValues = !!config.ignoreClassFieldInitialValues; 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.has(value); } + /** * 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 number is the initial value of a class field. + * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node + * @returns {boolean} true if the number is the initial value of a class field. + */ + function isClassFieldInitialValue(fullNumberNode) { + const parent = fullNumberNode.parent; + return parent.type === "PropertyDefinition" && parent.value === 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. @@ -99532,11 +87602,10 @@ module.exports = { * @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". @@ -99564,23 +87633,20 @@ module.exports = { * @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 + 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; @@ -99590,13 +87656,12 @@ module.exports = { value = node.value; raw = node.raw; } + const parent = fullNumberNode.parent; - 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)) { + // Always allow radix arguments and JSX props + if (isIgnoredValue(value) || ignoreDefaultValues && isDefaultValue(fullNumberNode) || ignoreClassFieldInitialValues && isClassFieldInitialValue(fullNumberNode) || isParseIntRadix(fullNumberNode) || isJSXNumber(fullNumberNode) || ignoreArrayIndexes && isArrayIndex(fullNumberNode, value)) { return; } - if (parent.type === "VariableDeclarator") { if (enforceConst && parent.parent.kind !== "const") { context.report({ @@ -99614,14 +87679,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 787 */ +/* 795 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -99635,27 +87698,26 @@ const { CONSTRUCT, ReferenceTracker, getStringIfConstant -} = __webpack_require__(571); - +} = __webpack_require__(594); const { - RegExpValidator, RegExpParser, visitRegExpAST -} = __webpack_require__(741); - +} = __webpack_require__(748); const { isCombiningCharacter, isEmojiModifier, isRegionalIndicatorSymbol, isSurrogatePair -} = __webpack_require__(788); +} = __webpack_require__(796); +const astUtils = __webpack_require__(639); +const { + isValidWithUnicodeFlag +} = __webpack_require__(801); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - -const REGEXPP_LATEST_ECMA_VERSION = 2022; /** * Iterate character sequences of a given nodes. * @@ -99664,29 +87726,25 @@ const REGEXPP_LATEST_ECMA_VERSION = 2022; * @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 } } @@ -99695,43 +87753,38 @@ function* iterateCharacterSequence(nodes) { 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); //------------------------------------------------------------------------------ +const kinds = Object.keys(hasCharacterSequence); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow characters which are made with multiple code points in character class syntax", recommended: true, - url: "https://eslint.org/docs/rules/no-misleading-character-class" + url: "https://eslint.org/docs/latest/rules/no-misleading-character-class" }, hasSuggestions: true, schema: [], @@ -99744,10 +87797,10 @@ module.exports = { suggestUnicodeFlag: "Add unicode 'u' flag to regex." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const parser = new RegExpParser(); + /** * Verify a given regular expression. * @param {Node} node The node to report. @@ -99756,17 +87809,14 @@ module.exports = { * @param {Function} unicodeFixer Fixer for missing "u" flag. * @returns {void} */ - function verify(node, pattern, flags, unicodeFixer) { let patternNode; - try { patternNode = parser.parsePattern(pattern, 0, pattern.length, flags.includes("u")); } catch { // Ignore regular expressions with syntax errors return; } - const foundKinds = new Set(); visitRegExpAST(patternNode, { onCharacterClassEnter(ccNode) { @@ -99778,19 +87828,15 @@ module.exports = { } } } - }); - for (const kind of foundKinds) { let suggest; - if (kind === "surrogatePairWithoutUFlag") { suggest = [{ messageId: "suggestUnicodeFlag", fix: unicodeFixer }]; } - context.report({ node, messageId: kind, @@ -99798,103 +87844,62 @@ module.exports = { }); } } - /** - * Checks if the given regular expression pattern would be valid with the `u` flag. - * @param {string} pattern The regular expression pattern to verify. - * @returns {boolean} `true` if the pattern would be valid with the `u` flag. - * `false` if the pattern would be invalid with the `u` flag or the configured - * ecmaVersion doesn't support the `u` flag. - */ - - - function isValidWithUnicodeFlag(pattern) { - const { - ecmaVersion - } = context.parserOptions; // ecmaVersion is unknown or it doesn't support the 'u' flag - - if (typeof ecmaVersion !== "number" || ecmaVersion <= 5) { - return false; - } - - const validator = new RegExpValidator({ - ecmaVersion: Math.min(ecmaVersion + 2009, REGEXPP_LATEST_ECMA_VERSION) - }); - - try { - validator.validatePattern(pattern, void 0, void 0, - /* uFlag = */ - true); - } catch { - return false; - } - - return true; - } - return { "Literal[regex]"(node) { verify(node, node.regex.pattern, node.regex.flags, fixer => { - if (!isValidWithUnicodeFlag(node.regex.pattern)) { + if (!isValidWithUnicodeFlag(context.languageOptions.ecmaVersion, node.regex.pattern)) { return null; } - return fixer.insertTextAfter(node, "u"); }); }, - - "Program"() { - const scope = context.getScope(); + "Program"(node) { + const scope = sourceCode.getScope(node); 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 + node: refNode } of tracker.iterateGlobalReferences({ RegExp: { [CALL]: true, [CONSTRUCT]: true } })) { - const [patternNode, flagsNode] = node.arguments; + const [patternNode, flagsNode] = refNode.arguments; const pattern = getStringIfConstant(patternNode, scope); const flags = getStringIfConstant(flagsNode, scope); - if (typeof pattern === "string") { - verify(node, pattern, flags || "", fixer => { - if (!isValidWithUnicodeFlag(pattern)) { + verify(refNode, pattern, flags || "", fixer => { + if (!isValidWithUnicodeFlag(context.languageOptions.ecmaVersion, pattern)) { return null; } - - if (node.arguments.length === 1) { - const penultimateToken = sourceCode.getLastToken(node, { + if (refNode.arguments.length === 1) { + const penultimateToken = sourceCode.getLastToken(refNode, { skip: 1 }); // skip closing parenthesis return fixer.insertTextAfter(penultimateToken, astUtils.isCommaToken(penultimateToken) ? ' "u",' : ', "u"'); } - if (flagsNode.type === "Literal" && typeof flagsNode.value === "string" || flagsNode.type === "TemplateLiteral") { const range = [flagsNode.range[0], flagsNode.range[1] - 1]; return fixer.insertTextAfterRange(range, "u"); } - return null; }); } } } - }; } - }; /***/ }), -/* 788 */ +/* 796 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -99904,14 +87909,14 @@ module.exports = { module.exports = { - isCombiningCharacter: __webpack_require__(789), - isEmojiModifier: __webpack_require__(790), - isRegionalIndicatorSymbol: __webpack_require__(791), - isSurrogatePair: __webpack_require__(792) + isCombiningCharacter: __webpack_require__(797), + isEmojiModifier: __webpack_require__(798), + isRegionalIndicatorSymbol: __webpack_require__(799), + isSurrogatePair: __webpack_require__(800) }; /***/ }), -/* 789 */ +/* 797 */ /***/ ((module) => { "use strict"; @@ -99919,18 +87924,18 @@ module.exports = { * @author Toru Nagashima */ + /** * 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)); }; /***/ }), -/* 790 */ +/* 798 */ /***/ ((module) => { "use strict"; @@ -99938,18 +87943,18 @@ module.exports = function isCombiningCharacter(codePoint) { * @author Toru Nagashima */ + /** * 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; }; /***/ }), -/* 791 */ +/* 799 */ /***/ ((module) => { "use strict"; @@ -99957,18 +87962,18 @@ module.exports = function isEmojiModifier(code) { * @author Toru Nagashima */ + /** * 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; }; /***/ }), -/* 792 */ +/* 800 */ /***/ ((module) => { "use strict"; @@ -99976,19 +87981,65 @@ module.exports = function isRegionalIndicatorSymbol(code) { * @author Toru Nagashima */ + /** * 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; }; /***/ }), -/* 793 */ +/* 801 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +/** + * @fileoverview Common utils for regular expressions. + * @author Josh Goldberg + * @author Toru Nagashima + */ + + + +const { + RegExpValidator +} = __webpack_require__(748); +const REGEXPP_LATEST_ECMA_VERSION = 2022; + +/** + * Checks if the given regular expression pattern would be valid with the `u` flag. + * @param {number} ecmaVersion ECMAScript version to parse in. + * @param {string} pattern The regular expression pattern to verify. + * @returns {boolean} `true` if the pattern would be valid with the `u` flag. + * `false` if the pattern would be invalid with the `u` flag or the configured + * ecmaVersion doesn't support the `u` flag. + */ +function isValidWithUnicodeFlag(ecmaVersion, pattern) { + if (ecmaVersion <= 5) { + // ecmaVersion <= 5 doesn't support the 'u' flag + return false; + } + const validator = new RegExpValidator({ + ecmaVersion: Math.min(ecmaVersion, REGEXPP_LATEST_ECMA_VERSION) + }); + try { + validator.validatePattern(pattern, void 0, void 0, /* uFlag = */true); + } catch { + return false; + } + return true; +} +module.exports = { + isValidWithUnicodeFlag, + REGEXPP_LATEST_ECMA_VERSION +}; + +/***/ }), +/* 802 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -99996,15 +88047,18 @@ module.exports = function isSurrogatePair(lead, tail) { * @fileoverview Rule to disallow mixed binary operators. * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - const ARITHMETIC_OPERATORS = ["+", "-", "*", "/", "%", "**"]; const BITWISE_OPERATORS = ["&", "|", "^", "~", "<<", ">>", ">>>"]; const COMPARISON_OPERATORS = ["==", "!=", "===", "!==", ">", ">=", "<", "<="]; @@ -100015,12 +88069,12 @@ 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() { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; const hasGroups = options.groups && options.groups.length > 0; @@ -100031,6 +88085,7 @@ function normalizeOptions() { allowSamePrecedence }; } + /** * Checks whether any group which includes both given operator exists or not. * @param {Array} groups A list of groups to check. @@ -100038,11 +88093,10 @@ function normalizeOptions() { * @param {string} right Another operator. * @returns {boolean} `true` if such group existed. */ - - function includesBothInAGroup(groups, left, right) { return groups.some(group => group.includes(left) && group.includes(right)); } + /** * 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. @@ -100050,24 +88104,22 @@ function includesBothInAGroup(groups, left, right) { * , 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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow mixed binary operators", recommended: false, - url: "https://eslint.org/docs/rules/no-mixed-operators" + url: "https://eslint.org/docs/latest/rules/no-mixed-operators" }, schema: [{ type: "object", @@ -100095,10 +88147,10 @@ module.exports = { unexpectedMixedOperator: "Unexpected mix of '{{leftOperator}}' and '{{rightOperator}}'. Use parentheses to clarify the intended order of operations." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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 @@ -100106,12 +88158,12 @@ module.exports = { * 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. @@ -100120,22 +88172,20 @@ module.exports = { * them, too. * @returns {boolean} `true` if the node was mixed. */ - - function isMixedWithParent(node) { return node.operator !== node.parent.operator && !astUtils.isParenthesised(sourceCode, node); } + /** * 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. @@ -100144,8 +88194,6 @@ module.exports = { * them, too. * @returns {void} */ - - function reportBothOperators(node) { const parent = node.parent; const left = getChildNode(parent) === node ? node : parent; @@ -100167,30 +88215,27 @@ module.exports = { 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) && isMixedWithParent(node) && !shouldIgnore(node)) { reportBothOperators(node); } } - return { BinaryExpression: check, LogicalExpression: check }; } - }; /***/ }), -/* 794 */ +/* 803 */ /***/ ((module) => { "use strict"; @@ -100199,12 +88244,14 @@ module.exports = { * @author Raphael Pigulla * @deprecated in ESLint v7.0.0 */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { deprecated: true, @@ -100213,7 +88260,7 @@ module.exports = { docs: { description: "Disallow `require` calls to be mixed with regular variable declarations", recommended: false, - url: "https://eslint.org/docs/rules/no-mixed-requires" + url: "https://eslint.org/docs/latest/rules/no-mixed-requires" }, schema: [{ oneOf: [{ @@ -100236,24 +88283,21 @@ module.exports = { noMixCoreModuleFileComputed: "Do not mix core, module, file and computed requires." } }, - create(context) { const options = context.options[0]; let grouping = false, - allowCall = 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: @@ -100262,91 +88306,80 @@ module.exports = { */ 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"; + DECL_UNINITIALIZED = "uninitialized", + DECL_OTHER = "other"; const REQ_CORE = "core", - REQ_FILE = "file", - REQ_MODULE = "module", - REQ_COMPUTED = "computed"; + 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;" - + } + // "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.includes(arg.value)) { // "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');" - + } + // "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 => { @@ -100355,14 +88388,13 @@ module.exports = { }); 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 => { @@ -100372,7 +88404,6 @@ module.exports = { }); return Object.keys(found).length <= 1; } - return { VariableDeclaration(node) { if (isMixed(node.declarations)) { @@ -100387,14 +88418,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 795 */ +/* 804 */ /***/ ((module) => { "use strict"; @@ -100402,19 +88431,20 @@ module.exports = { * @fileoverview Disallow mixed spaces and tabs for indentation * @author Jary Niebur */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "layout", docs: { description: "Disallow mixed spaces and tabs for indentation", recommended: true, - url: "https://eslint.org/docs/rules/no-mixed-spaces-and-tabs" + url: "https://eslint.org/docs/latest/rules/no-mixed-spaces-and-tabs" }, schema: [{ enum: ["smart-tabs", true, false] @@ -100423,44 +88453,41 @@ module.exports = { mixedSpacesAndTabs: "Mixed spaces and tabs." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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 = 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 @@ -100468,10 +88495,8 @@ module.exports = { */ regex = /^(?=(\t*))\1(?=( +))\2\t/u; } - lines.forEach((line, i) => { const match = regex.exec(line); - if (match) { const lineNumber = i + 1; const loc = { @@ -100484,10 +88509,8 @@ module.exports = { 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, @@ -100499,14 +88522,12 @@ module.exports = { } }); } - }; } - }; /***/ }), -/* 796 */ +/* 805 */ /***/ ((module) => { "use strict"; @@ -100514,19 +88535,21 @@ module.exports = { * @fileoverview Rule to check use of chained assignment expressions * @author Stewart Rand */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow use of chained assignment expressions", recommended: false, - url: "https://eslint.org/docs/rules/no-multi-assign" + url: "https://eslint.org/docs/latest/rules/no-multi-assign" }, schema: [{ type: "object", @@ -100542,7 +88565,6 @@ module.exports = { unexpectedChain: "Unexpected chained assignment." } }, - create(context) { //-------------------------------------------------------------------------- // Public @@ -100551,11 +88573,9 @@ module.exports = { ignoreNonDeclaration: false }; const selectors = ["VariableDeclarator > AssignmentExpression.init", "PropertyDefinition > AssignmentExpression.value"]; - if (!options.ignoreNonDeclaration) { selectors.push("AssignmentExpression > AssignmentExpression.right"); } - return { [selectors](node) { context.report({ @@ -100563,14 +88583,12 @@ module.exports = { messageId: "unexpectedChain" }); } - }; } - }; /***/ }), -/* 797 */ +/* 806 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -100580,20 +88598,21 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Disallow multiple spaces", recommended: false, - url: "https://eslint.org/docs/rules/no-multi-spaces" + url: "https://eslint.org/docs/latest/rules/no-multi-spaces" }, fixable: "whitespace", schema: [{ @@ -100619,61 +88638,58 @@ module.exports = { multipleSpaces: "Multiple spaces found before '{{displayValue}}'." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const options = context.options[0] || {}; const ignoreEOLComments = options.ignoreEOLComments; const exceptions = Object.assign({ Property: true }, options.exceptions); const hasExceptions = Object.keys(exceptions).some(key => exceptions[key]); + /** * 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]; - const rightToken = tokensAndComments[leftIndex + 1]; // Ignore tokens that don't have 2 spaces between them or are on different lines - + // 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. - + } + // 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 - + } + // 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") { @@ -100681,7 +88697,6 @@ module.exports = { } else { displayValue = rightToken.value; } - context.report({ node: rightToken, loc: { @@ -100696,14 +88711,12 @@ module.exports = { }); }); } - }; } - }; /***/ }), -/* 798 */ +/* 807 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -100711,31 +88724,32 @@ module.exports = { * @fileoverview Rule to flag when using multiline strings * @author Ilya Volodin */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow multiline strings", recommended: false, - url: "https://eslint.org/docs/rules/no-multi-str" + url: "https://eslint.org/docs/latest/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. @@ -100745,11 +88759,12 @@ module.exports = { */ function isJSXElement(node) { return node.type.indexOf("JSX") === 0; - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public API //-------------------------------------------------------------------------- - return { Literal(node) { if (astUtils.LINEBREAK_MATCHER.test(node.raw) && !isJSXElement(node.parent)) { @@ -100759,14 +88774,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 799 */ +/* 808 */ /***/ ((module) => { "use strict"; @@ -100775,19 +88788,20 @@ module.exports = { * implementation adapted from the no-trailing-spaces rule. * @author Greg Cochard */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "layout", docs: { description: "Disallow multiple empty lines", recommended: false, - url: "https://eslint.org/docs/rules/no-multiple-empty-lines" + url: "https://eslint.org/docs/latest/rules/no-multiple-empty-lines" }, fixable: "whitespace", schema: [{ @@ -100815,23 +88829,23 @@ module.exports = { consecutiveBlank: "More than {{max}} blank {{pluralizedLines}} not allowed." } }, - create(context) { // Use options.max or 2 as default let max = 2, - maxEOF = max, - maxBOF = max; - + 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.sourceCode; - const sourceCode = context.getSourceCode(); // Swallow the final newline, as some editors add it automatically and we don't want it to cause an issue - + // 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(); //-------------------------------------------------------------------------- + const templateLiteralLines = new Set(); + + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- @@ -100844,20 +88858,23 @@ module.exports = { } }); }, - "Program:exit"(node) { - return allLines // Given a list of lines, first get a list of line numbers that are non-empty. + 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. + }, []) + + // 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; @@ -100868,7 +88885,6 @@ module.exports = { messageId = "consecutiveBlank"; maxAllowed = max; } - if (lineNumber - lastLineNumber - 1 > maxAllowed) { context.report({ node, @@ -100887,18 +88903,17 @@ module.exports = { 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, @@ -100906,21 +88921,17 @@ module.exports = { }) : sourceCode.text.length; return fixer.removeRange([rangeStart, rangeEnd]); } - }); } - return lineNumber; }, 0); } - }; } - }; /***/ }), -/* 800 */ +/* 809 */ /***/ ((module) => { "use strict"; @@ -100929,19 +88940,21 @@ module.exports = { * @author Ilya Volodin * @deprecated in ESLint v3.3.0 */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow assignments to native objects or read-only global variables", recommended: false, - url: "https://eslint.org/docs/rules/no-native-reassign" + url: "https://eslint.org/docs/latest/rules/no-native-reassign" }, deprecated: true, replacedBy: ["no-global-assign"], @@ -100962,10 +88975,11 @@ module.exports = { nativeReassign: "Read-only global '{{name}}' should not be modified." } }, - create(context) { const config = context.options[0]; const exceptions = config && config.exceptions || []; + const sourceCode = context.sourceCode; + /** * Reports write references. * @param {Reference} reference A reference to check. @@ -100973,10 +88987,8 @@ module.exports = { * @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, @@ -100990,32 +89002,28 @@ module.exports = { }); } } + /** * 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.includes(variable.name)) { variable.references.forEach(checkReference); } } - return { - Program() { - const globalScope = context.getScope(); + Program(node) { + const globalScope = sourceCode.getScope(node); globalScope.variables.forEach(checkVariable); } - }; } - }; /***/ }), -/* 801 */ +/* 810 */ /***/ ((module) => { "use strict"; @@ -101023,26 +89031,26 @@ module.exports = { * @fileoverview Rule to disallow a negated condition * @author Alberto Rodríguez */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow negated conditions", recommended: false, - url: "https://eslint.org/docs/rules/no-negated-condition" + url: "https://eslint.org/docs/latest/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 @@ -101053,46 +89061,41 @@ module.exports = { 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, @@ -101100,7 +89103,6 @@ module.exports = { }); } }, - ConditionalExpression(node) { if (isNegatedIf(node)) { context.report({ @@ -101109,14 +89111,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 802 */ +/* 811 */ /***/ ((module) => { "use strict"; @@ -101125,19 +89125,21 @@ module.exports = { * @author Michael Ficarra * @deprecated in ESLint v3.3.0 */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow negating the left operand in `in` expressions", recommended: false, - url: "https://eslint.org/docs/rules/no-negated-in-lhs" + url: "https://eslint.org/docs/latest/rules/no-negated-in-lhs" }, replacedBy: ["no-unsafe-negation"], deprecated: true, @@ -101146,7 +89148,6 @@ module.exports = { negatedLHS: "The 'in' expression's left operand is negated." } }, - create(context) { return { BinaryExpression(node) { @@ -101157,14 +89158,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 803 */ +/* 812 */ /***/ ((module) => { "use strict"; @@ -101172,26 +89171,27 @@ module.exports = { * @fileoverview Rule to flag nested ternary expressions * @author Ian Christian Myers */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow nested ternary expressions", recommended: false, - url: "https://eslint.org/docs/rules/no-nested-ternary" + url: "https://eslint.org/docs/latest/rules/no-nested-ternary" }, schema: [], messages: { noNestedTernary: "Do not nest ternary expressions." } }, - create(context) { return { ConditionalExpression(node) { @@ -101202,14 +89202,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 804 */ +/* 813 */ /***/ ((module) => { "use strict"; @@ -101218,26 +89216,27 @@ module.exports = { * "new" and not part of assignment * @author Ilya Volodin */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow `new` operators outside of assignments or comparisons", recommended: false, - url: "https://eslint.org/docs/rules/no-new" + url: "https://eslint.org/docs/latest/rules/no-new" }, schema: [], messages: { noNewStatement: "Do not use 'new' for side effects." } }, - create(context) { return { "ExpressionStatement > NewExpression"(node) { @@ -101246,14 +89245,12 @@ module.exports = { messageId: "noNewStatement" }); } - }; } - }; /***/ }), -/* 805 */ +/* 814 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -101261,61 +89258,61 @@ module.exports = { * @fileoverview Rule to flag when using new Function * @author Ilya Volodin */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ +const callMethods = new Set(["apply", "bind", "call"]); -const callMethods = new Set(["apply", "bind", "call"]); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow `new` operators with the `Function` object", recommended: false, - url: "https://eslint.org/docs/rules/no-new-func" + url: "https://eslint.org/docs/latest/rules/no-new-func" }, schema: [], messages: { noFunctionConstructor: "The Function constructor is eval." } }, - create(context) { + const sourceCode = context.sourceCode; return { - "Program:exit"() { - const globalScope = context.getScope(); + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); const variable = globalScope.set.get("Function"); - if (variable && variable.defs.length === 0) { variable.references.forEach(ref => { - const node = ref.identifier; + const idNode = ref.identifier; const { parent - } = node; + } = idNode; let evalNode; - if (parent) { - if (node === parent.callee && (parent.type === "NewExpression" || parent.type === "CallExpression")) { + if (idNode === parent.callee && (parent.type === "NewExpression" || parent.type === "CallExpression")) { evalNode = parent; - } else if (parent.type === "MemberExpression" && node === parent.object && callMethods.has(astUtils.getStaticPropertyName(parent))) { + } else if (parent.type === "MemberExpression" && idNode === parent.object && callMethods.has(astUtils.getStaticPropertyName(parent))) { const maybeCallee = parent.parent.type === "ChainExpression" ? parent.parent : parent; - if (maybeCallee.parent.type === "CallExpression" && maybeCallee.parent.callee === maybeCallee) { evalNode = maybeCallee.parent; } } } - if (evalNode) { context.report({ node: evalNode, @@ -101325,14 +89322,75 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 806 */ +/* 815 */ +/***/ ((module) => { + +"use strict"; +/** + * @fileoverview Rule to disallow use of the new operator with global non-constructor functions + * @author Sosuke Suzuki + */ + + + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ +const nonConstructorGlobalFunctionNames = ["Symbol", "BigInt"]; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** @type {import('../shared/types').Rule} */ +module.exports = { + meta: { + type: "problem", + docs: { + description: "Disallow `new` operators with global non-constructor functions", + recommended: false, + url: "https://eslint.org/docs/latest/rules/no-new-native-nonconstructor" + }, + schema: [], + messages: { + noNewNonconstructor: "`{{name}}` cannot be called as a constructor." + } + }, + create(context) { + const sourceCode = context.sourceCode; + return { + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); + for (const nonConstructorName of nonConstructorGlobalFunctionNames) { + const variable = globalScope.set.get(nonConstructorName); + if (variable && variable.defs.length === 0) { + variable.references.forEach(ref => { + const idNode = ref.identifier; + const parent = idNode.parent; + if (parent && parent.type === "NewExpression" && parent.callee === idNode) { + context.report({ + node: idNode, + messageId: "noNewNonconstructor", + data: { + name: nonConstructorName + } + }); + } + }); + } + } + } + }; + } +}; + +/***/ }), +/* 816 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -101340,40 +89398,40 @@ module.exports = { * @fileoverview A rule to disallow calls to the Object constructor * @author Matt DuVall */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow `Object` constructors", recommended: false, - url: "https://eslint.org/docs/rules/no-new-object" + url: "https://eslint.org/docs/latest/rules/no-new-object" }, schema: [], messages: { preferLiteral: "The object literal notation {} is preferable." } }, - create(context) { + const sourceCode = context.sourceCode; return { NewExpression(node) { - const variable = astUtils.getVariableByName(context.getScope(), node.callee.name); - + const variable = astUtils.getVariableByName(sourceCode.getScope(node), node.callee.name); if (variable && variable.identifiers.length > 0) { return; } - if (node.callee.name === "Object") { context.report({ node, @@ -101381,14 +89439,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 807 */ +/* 817 */ /***/ ((module) => { "use strict"; @@ -101397,12 +89453,14 @@ module.exports = { * @author Wil Moore III * @deprecated in ESLint v7.0.0 */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { deprecated: true, @@ -101411,14 +89469,13 @@ module.exports = { docs: { description: "Disallow `new` operators with calls to `require`", recommended: false, - url: "https://eslint.org/docs/rules/no-new-require" + url: "https://eslint.org/docs/latest/rules/no-new-require" }, schema: [], messages: { noNewRequire: "Unexpected use of new with require." } }, - create(context) { return { NewExpression(node) { @@ -101429,14 +89486,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 808 */ +/* 818 */ /***/ ((module) => { "use strict"; @@ -101444,54 +89499,52 @@ module.exports = { * @fileoverview Rule to disallow use of the new operator with the `Symbol` object * @author Alberto Rodríguez */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow `new` operators with the `Symbol` object", recommended: true, - url: "https://eslint.org/docs/rules/no-new-symbol" + url: "https://eslint.org/docs/latest/rules/no-new-symbol" }, schema: [], messages: { noNewSymbol: "`Symbol` cannot be called as a constructor." } }, - create(context) { + const sourceCode = context.sourceCode; return { - "Program:exit"() { - const globalScope = context.getScope(); + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); 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) { + const idNode = ref.identifier; + const parent = idNode.parent; + if (parent && parent.type === "NewExpression" && parent.callee === idNode) { context.report({ - node, + node: idNode, messageId: "noNewSymbol" }); } }); } } - }; } - }; /***/ }), -/* 809 */ +/* 819 */ /***/ ((module) => { "use strict"; @@ -101499,31 +89552,31 @@ module.exports = { * @fileoverview Rule to flag when using constructor for wrapper objects * @author Ilya Volodin */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow `new` operators with the `String`, `Number`, and `Boolean` objects", recommended: false, - url: "https://eslint.org/docs/rules/no-new-wrappers" + url: "https://eslint.org/docs/latest/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.includes(node.callee.name)) { context.report({ node, @@ -101534,14 +89587,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 810 */ +/* 820 */ /***/ ((module) => { "use strict"; @@ -101549,33 +89600,35 @@ module.exports = { * @fileoverview Rule to disallow `\8` and `\9` escape sequences in string literals. * @author Milos Djermanovic */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - const QUICK_TEST_REGEX = /\\[89]/u; + /** * Returns unicode escape sequence that represents the given character. * @param {string} character A single code unit. * @returns {string} "\uXXXX" sequence. */ - function getUnicodeEscape(character) { return `\\u${character.charCodeAt(0).toString(16).padStart(4, "0")}`; -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow `\\8` and `\\9` escape sequences in string literals", recommended: true, - url: "https://eslint.org/docs/rules/no-nonoctal-decimal-escape" + url: "https://eslint.org/docs/latest/rules/no-nonoctal-decimal-escape" }, hasSuggestions: true, schema: [], @@ -101586,9 +89639,9 @@ module.exports = { escapeBackslash: "Replace '{{original}}' with '{{replacement}}' to include the actual backslash character." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * Creates a new Suggestion object. * @param {string} messageId "refactor" or "escapeBackslash". @@ -101596,7 +89649,6 @@ module.exports = { * @param {string} replacement New text for the range. * @returns {Object} Suggestion */ - function createSuggestion(messageId, range, replacement) { return { messageId, @@ -101604,27 +89656,21 @@ module.exports = { original: sourceCode.getText().slice(...range), replacement }, - fix(fixer) { return fixer.replaceTextRange(range, replacement); } - }; } - return { Literal(node) { if (typeof node.value !== "string") { return; } - if (!QUICK_TEST_REGEX.test(node.raw)) { return; } - const regex = /(?:[^\\]|(?\\.))*?(?\\[89])/suy; let match; - while (match = regex.exec(node.raw)) { const { previousEscape, @@ -101633,23 +89679,27 @@ module.exports = { const decimalEscapeRangeEnd = node.range[0] + match.index + match[0].length; const decimalEscapeRangeStart = decimalEscapeRangeEnd - decimalEscape.length; const decimalEscapeRange = [decimalEscapeRangeStart, decimalEscapeRangeEnd]; - const suggest = []; // When `regex` is matched, `previousEscape` can only capture characters adjacent to `decimalEscape` + const suggest = []; + // When `regex` is matched, `previousEscape` can only capture characters adjacent to `decimalEscape` if (previousEscape === "\\0") { /* * Now we have a NULL escape "\0" immediately followed by a decimal escape, e.g.: "\0\8". * Fixing this to "\08" would turn "\0" into a legacy octal escape. To avoid producing * an octal escape while fixing a decimal escape, we provide different suggestions. */ - suggest.push(createSuggestion( // "\0\8" -> "\u00008" - "refactor", [decimalEscapeRangeStart - previousEscape.length, decimalEscapeRangeEnd], `${getUnicodeEscape("\0")}${decimalEscape[1]}`), createSuggestion( // "\8" -> "\u0038" + suggest.push(createSuggestion( + // "\0\8" -> "\u00008" + "refactor", [decimalEscapeRangeStart - previousEscape.length, decimalEscapeRangeEnd], `${getUnicodeEscape("\0")}${decimalEscape[1]}`), createSuggestion( + // "\8" -> "\u0038" "refactor", decimalEscapeRange, getUnicodeEscape(decimalEscape[1]))); } else { - suggest.push(createSuggestion( // "\8" -> "8" + suggest.push(createSuggestion( + // "\8" -> "8" "refactor", decimalEscapeRange, decimalEscape[1])); } - - suggest.push(createSuggestion( // "\8" -> "\\8" + suggest.push(createSuggestion( + // "\8" -> "\\8" "escapeBackslash", decimalEscapeRange, `\\${decimalEscape}`)); context.report({ node, @@ -101665,14 +89715,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 811 */ +/* 821 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -101680,52 +89728,52 @@ module.exports = { * @fileoverview Rule to flag use of an object property of the global object (Math and JSON) as a function * @author James Allardice */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - const { CALL, CONSTRUCT, ReferenceTracker -} = __webpack_require__(571); +} = __webpack_require__(594); +const getPropertyName = (__webpack_require__(639).getStaticPropertyName); -const getPropertyName = (__webpack_require__(618).getStaticPropertyName); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ +const nonCallableGlobals = ["Atomics", "JSON", "Math", "Reflect", "Intl"]; -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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow calling global object properties as functions", recommended: true, - url: "https://eslint.org/docs/rules/no-obj-calls" + url: "https://eslint.org/docs/latest/rules/no-obj-calls" }, schema: [], messages: { @@ -101733,30 +89781,28 @@ module.exports = { unexpectedRefCall: "'{{name}}' is reference to '{{ref}}', which is not a function." } }, - create(context) { + const sourceCode = context.sourceCode; return { - Program() { - const scope = context.getScope(); + Program(node) { + const scope = sourceCode.getScope(node); const tracker = new ReferenceTracker(scope); const traceMap = {}; - for (const g of nonCallableGlobals) { traceMap[g] = { [CALL]: true, [CONSTRUCT]: true }; } - for (const { - node, + node: refNode, path } of tracker.iterateGlobalReferences(traceMap)) { - const name = getReportNodeName(node.callee); + const name = getReportNodeName(refNode.callee); const ref = path[0]; const messageId = name === ref ? "unexpectedCall" : "unexpectedRefCall"; context.report({ - node, + node: refNode, messageId, data: { name, @@ -101765,14 +89811,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 812 */ +/* 822 */ /***/ ((module) => { "use strict"; @@ -101780,26 +89824,27 @@ module.exports = { * @fileoverview Rule to flag when initializing octal literal * @author Ilya Volodin */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow octal literals", recommended: true, - url: "https://eslint.org/docs/rules/no-octal" + url: "https://eslint.org/docs/latest/rules/no-octal" }, schema: [], messages: { noOctal: "Octal literals should not be used." } }, - create(context) { return { Literal(node) { @@ -101810,14 +89855,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 813 */ +/* 823 */ /***/ ((module) => { "use strict"; @@ -101825,36 +89868,36 @@ module.exports = { * @fileoverview Rule to flag octal escape sequences in string literals. * @author Ian Christian Myers */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow octal escape sequences in string literals", recommended: false, - url: "https://eslint.org/docs/rules/no-octal-escape" + url: "https://eslint.org/docs/latest/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. - + } + // \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, @@ -101865,14 +89908,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 814 */ +/* 824 */ /***/ ((module) => { "use strict"; @@ -101880,20 +89921,21 @@ module.exports = { * @fileoverview Disallow reassignment of function parameters. * @author Nat Burns */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ - const stopNodePattern = /(?:Statement|Declaration|Function(?:Expression)?|Program)$/u; -/** @type {import('../shared/types').Rule} */ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { description: "Disallow reassigning `function` parameters", recommended: false, - url: "https://eslint.org/docs/rules/no-param-reassign" + url: "https://eslint.org/docs/latest/rules/no-param-reassign" }, schema: [{ oneOf: [{ @@ -101933,89 +89975,84 @@ module.exports = { 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 || []; + const sourceCode = context.sourceCode; + /** * 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; + // e.g. ++foo.a; case "UpdateExpression": return true; - // e.g. delete foo.a; + // e.g. delete foo.a; case "UnaryExpression": if (parent.operator === "delete") { return true; } - break; - // e.g. for (foo.a in b) {} + // 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 - + } + // this is a stop node for parent.right and parent.body return false; - // EXCLUDES: e.g. cache.get(foo.a).b = 0; + // 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; + // EXCLUDES: e.g. cache[foo.a] = 0; case "MemberExpression": if (parent.property === node) { return false; } - break; - // EXCLUDES: e.g. ({ [foo]: a }) = bar; + // EXCLUDES: e.g. ({ [foo]: a }) = bar; case "Property": if (parent.key === node) { return false; } - break; - // EXCLUDES: e.g. (foo ? a : b).c = bar; + // 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. @@ -102024,11 +90061,10 @@ module.exports = { * 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. @@ -102036,11 +90072,8 @@ module.exports = { * @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, @@ -102066,29 +90099,26 @@ module.exports = { } } } + /** * 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); + sourceCode.getDeclaredVariables(node).forEach(checkVariable); } - return { // `:exit` is needed for the `node.parent` property of identifier nodes. "FunctionDeclaration:exit": checkForFunction, @@ -102096,11 +90126,10 @@ module.exports = { "ArrowFunctionExpression:exit": checkForFunction }; } - }; /***/ }), -/* 815 */ +/* 825 */ /***/ ((module) => { "use strict"; @@ -102109,12 +90138,13 @@ module.exports = { * @author Nicholas C. Zakas * @deprecated in ESLint v7.0.0 */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { deprecated: true, @@ -102123,24 +90153,24 @@ module.exports = { docs: { description: "Disallow string concatenation with `__dirname` and `__filename`", recommended: false, - url: "https://eslint.org/docs/rules/no-path-concat" + url: "https://eslint.org/docs/latest/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; //-------------------------------------------------------------------------- + const MATCHER = /^__(?:dir|file)name$/u; + + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- return { BinaryExpression(node) { const left = node.left, - right = node.right; - + right = node.right; if (node.operator === "+" && (left.type === "Identifier" && MATCHER.test(left.name) || right.type === "Identifier" && MATCHER.test(right.name))) { context.report({ node, @@ -102148,14 +90178,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 816 */ +/* 826 */ /***/ ((module) => { "use strict"; @@ -102164,7 +90192,10 @@ module.exports = { * @author Ian Christian Myers * @author Brody McKee (github.com/mrmckeb) */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -102173,11 +90204,11 @@ module.exports = { * @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: @@ -102188,30 +90219,26 @@ function isForStatementUpdate(node) { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow the unary operators `++` and `--`", recommended: false, - url: "https://eslint.org/docs/rules/no-plusplus" + url: "https://eslint.org/docs/latest/rules/no-plusplus" }, schema: [{ type: "object", @@ -102227,21 +90254,17 @@ module.exports = { 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", @@ -102250,14 +90273,12 @@ module.exports = { } }); } - }; } - }; /***/ }), -/* 817 */ +/* 827 */ /***/ ((module) => { "use strict"; @@ -102266,12 +90287,13 @@ module.exports = { * @author Vignesh Anand * @deprecated in ESLint v7.0.0 */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { deprecated: true, @@ -102280,20 +90302,18 @@ module.exports = { docs: { description: "Disallow the use of `process.env`", recommended: false, - url: "https://eslint.org/docs/rules/no-process-env" + url: "https://eslint.org/docs/latest/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; - + propertyName = node.property.name; if (objectName === "process" && !node.computed && propertyName && propertyName === "env") { context.report({ node, @@ -102301,14 +90321,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 818 */ +/* 828 */ /***/ ((module) => { "use strict"; @@ -102317,12 +90335,13 @@ module.exports = { * @author Nicholas C. Zakas * @deprecated in ESLint v7.0.0 */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { deprecated: true, @@ -102331,18 +90350,18 @@ module.exports = { docs: { description: "Disallow the use of `process.exit()`", recommended: false, - url: "https://eslint.org/docs/rules/no-process-exit" + url: "https://eslint.org/docs/latest/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({ @@ -102350,14 +90369,12 @@ module.exports = { messageId: "noProcessExit" }); } - }; } - }; /***/ }), -/* 819 */ +/* 829 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -102365,121 +90382,114 @@ module.exports = { * @fileoverview Rule to disallow returning values from Promise executor functions * @author Milos Djermanovic */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - const { findVariable -} = __webpack_require__(571); //------------------------------------------------------------------------------ +} = __webpack_require__(594); + +//------------------------------------------------------------------------------ // 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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow returning values from Promise executor functions", recommended: false, - url: "https://eslint.org/docs/rules/no-promise-executor-return" + url: "https://eslint.org/docs/latest/rules/no-promise-executor-return" }, schema: [], messages: { returnsValue: "Return values from promise executor functions cannot be read." } }, - create(context) { let funcInfo = null; + const sourceCode = context.sourceCode; + /** * 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()) + shouldCheck: functionTypesToCheck.has(node.type) && isPromiseExecutor(node, sourceCode.getScope(node)) }; - if (funcInfo.shouldCheck && node.type === "ArrowFunctionExpression" && node.expression) { report(node.body); } }, - onCodePathEnd() { funcInfo = funcInfo.upper; }, - ReturnStatement(node) { if (funcInfo.shouldCheck && node.argument) { report(node); } } - }; } - }; /***/ }), -/* 820 */ +/* 830 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -102487,33 +90497,34 @@ module.exports = { * @fileoverview Rule to flag usage of __proto__ property * @author Ilya Volodin */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - const { getStaticPropertyName -} = __webpack_require__(618); //------------------------------------------------------------------------------ +} = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow the use of the `__proto__` property", recommended: false, - url: "https://eslint.org/docs/rules/no-proto" + url: "https://eslint.org/docs/latest/rules/no-proto" }, schema: [], messages: { unexpectedProto: "The '__proto__' property is deprecated." } }, - create(context) { return { MemberExpression(node) { @@ -102524,14 +90535,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 821 */ +/* 831 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -102539,48 +90548,45 @@ module.exports = { * @fileoverview Rule to disallow use of Object.prototype builtins on objects * @author Andrew Levine */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow calling some `Object.prototype` methods directly on objects", recommended: true, - url: "https://eslint.org/docs/rules/no-prototype-builtins" + url: "https://eslint.org/docs/latest/rules/no-prototype-builtins" }, schema: [], messages: { prototypeBuildIn: "Do not access Object.prototype method '{{prop}}' from target object." } }, - create(context) { const DISALLOWED_PROPS = new Set(["hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable"]); + /** * Reports if a disallowed property is used in a CallExpression * @param {ASTNode} node The CallExpression node. * @returns {void} */ - function disallowBuiltIns(node) { const callee = astUtils.skipChainExpression(node.callee); - if (callee.type !== "MemberExpression") { return; } - const propName = astUtils.getStaticPropertyName(callee); - if (propName !== null && DISALLOWED_PROPS.has(propName)) { context.report({ messageId: "prototypeBuildIn", @@ -102592,16 +90598,14 @@ module.exports = { }); } } - return { CallExpression: disallowBuiltIns }; } - }; /***/ }), -/* 822 */ +/* 832 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -102609,24 +90613,26 @@ module.exports = { * @fileoverview Rule to flag when the same variable is declared more then once. * @author Ilya Volodin */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow variable redeclaration", recommended: true, - url: "https://eslint.org/docs/rules/no-redeclare" + url: "https://eslint.org/docs/latest/rules/no-redeclare" }, messages: { redeclared: "'{{id}}' is already defined.", @@ -102644,25 +90650,23 @@ module.exports = { additionalProperties: false }] }, - create(context) { const options = { builtinGlobals: Boolean(context.options.length === 0 || context.options[0].builtinGlobals) }; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * 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", @@ -102670,7 +90674,6 @@ module.exports = { loc: id.loc }; } - if (variable.eslintExplicitGlobalComments) { for (const comment of variable.eslintExplicitGlobalComments) { yield { @@ -102681,33 +90684,31 @@ module.exports = { } } } + /** * 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. + }; + // Report extra declarations. for (const { type, node, @@ -102723,37 +90724,36 @@ module.exports = { } } } + /** * 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(); + const scope = sourceCode.getScope(node); + /* * 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. + Program(node) { + const scope = sourceCode.getScope(node); + findVariablesInScope(scope); - if (scope.type === "global" && scope.childScopes[0] && // The special scope's block is the Program node. + // 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, @@ -102765,11 +90765,10 @@ module.exports = { SwitchStatement: checkForBlock }; } - }; /***/ }), -/* 823 */ +/* 833 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -102777,42 +90776,44 @@ module.exports = { * @fileoverview Rule to count multiple spaces in regular expressions * @author Matt DuVall */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); +const regexpp = __webpack_require__(748); -const astUtils = __webpack_require__(618); - -const regexpp = __webpack_require__(741); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // 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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow multiple spaces in regular expressions", recommended: true, - url: "https://eslint.org/docs/rules/no-regex-spaces" + url: "https://eslint.org/docs/latest/rules/no-regex-spaces" }, schema: [], fixable: "code", @@ -102820,8 +90821,9 @@ module.exports = { multipleSpaces: "Spaces are hard to count. Use {{{length}}}." } }, - create(context) { + const sourceCode = context.sourceCode; + /** * Validate regular expression * @param {ASTNode} nodeToReport Node to report. @@ -102837,34 +90839,30 @@ module.exports = { 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. + } = match; + // Report only consecutive spaces that are not in character classes. if (characterClassNodes.every(_ref => { let { start, @@ -102878,29 +90876,26 @@ module.exports = { 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 - + // 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; @@ -102910,21 +90905,19 @@ module.exports = { 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 scope = sourceCode.getScope(node); 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); @@ -102933,18 +90926,16 @@ module.exports = { checkRegex(node, pattern, rawPattern, rawPatternStartRange, flags); } } - return { Literal: checkLiteral, CallExpression: checkFunction, NewExpression: checkFunction }; } - }; /***/ }), -/* 824 */ +/* 834 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -102952,54 +90943,98 @@ module.exports = { * @fileoverview Rule to disallow specified names in exports * @author Milos Djermanovic */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow specified names in exports", recommended: false, - url: "https://eslint.org/docs/rules/no-restricted-exports" + url: "https://eslint.org/docs/latest/rules/no-restricted-exports" }, schema: [{ - type: "object", - properties: { - restrictedNamedExports: { - type: "array", - items: { - type: "string" + anyOf: [{ + type: "object", + properties: { + restrictedNamedExports: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + additionalProperties: false + }, { + type: "object", + properties: { + restrictedNamedExports: { + type: "array", + items: { + type: "string", + pattern: "^(?!default$)" + }, + uniqueItems: true }, - uniqueItems: true - } - }, - additionalProperties: false + restrictDefaultExports: { + type: "object", + properties: { + // Allow/Disallow `export default foo; export default 42; export default function foo() {}` format + direct: { + type: "boolean" + }, + // Allow/Disallow `export { foo as default };` declarations + named: { + type: "boolean" + }, + // Allow/Disallow `export { default } from "mod"; export { default as default } from "mod";` declarations + defaultFrom: { + type: "boolean" + }, + // Allow/Disallow `export { foo as default } from "mod";` declarations + namedFrom: { + type: "boolean" + }, + // Allow/Disallow `export * as default from "mod"`; declarations + namespaceFrom: { + type: "boolean" + } + }, + additionalProperties: false + } + }, + additionalProperties: false + }] }], messages: { - restrictedNamed: "'{{name}}' is restricted from being used as an exported name." + restrictedNamed: "'{{name}}' is restricted from being used as an exported name.", + restrictedDefault: "Exporting 'default' is restricted." } }, - create(context) { const restrictedNames = new Set(context.options[0] && context.options[0].restrictedNamedExports); + const restrictDefaultExports = context.options[0] && context.options[0].restrictDefaultExports; + const sourceCode = context.sourceCode; + /** * Checks and reports given exported name. * @param {ASTNode} node exported `Identifier` or string `Literal` node to check. * @returns {void} */ - function checkExportedName(node) { const name = astUtils.getModuleExportName(node); - if (restrictedNames.has(name)) { context.report({ node, @@ -103008,38 +91043,71 @@ module.exports = { name } }); + return; + } + if (name === "default") { + if (node.parent.type === "ExportAllDeclaration") { + if (restrictDefaultExports && restrictDefaultExports.namespaceFrom) { + context.report({ + node, + messageId: "restrictedDefault" + }); + } + } else { + // ExportSpecifier + const isSourceSpecified = !!node.parent.parent.source; + const specifierLocalName = astUtils.getModuleExportName(node.parent.local); + if (!isSourceSpecified && restrictDefaultExports && restrictDefaultExports.named) { + context.report({ + node, + messageId: "restrictedDefault" + }); + return; + } + if (isSourceSpecified && restrictDefaultExports) { + if (specifierLocalName === "default" && restrictDefaultExports.defaultFrom || specifierLocalName !== "default" && restrictDefaultExports.namedFrom) { + context.report({ + node, + messageId: "restrictedDefault" + }); + } + } + } } } - return { ExportAllDeclaration(node) { if (node.exported) { checkExportedName(node.exported); } }, - + ExportDefaultDeclaration(node) { + if (restrictDefaultExports && restrictDefaultExports.direct) { + context.report({ + node, + messageId: "restrictedDefault" + }); + } + }, 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 + sourceCode.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); } } - }; } - }; /***/ }), -/* 825 */ +/* 835 */ /***/ ((module) => { "use strict"; @@ -103047,19 +91115,20 @@ module.exports = { * @fileoverview Restrict usage of specified globals. * @author Benoît Zugmeyer */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow specified global variables", recommended: false, - url: "https://eslint.org/docs/rules/no-restricted-globals" + url: "https://eslint.org/docs/latest/rules/no-restricted-globals" }, schema: { type: "array", @@ -103089,33 +91158,32 @@ module.exports = { customMessage: "Unexpected use of '{{name}}'. {{customMessage}}" } }, - create(context) { + const sourceCode = context.sourceCode; + // 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"; + customMessage = restrictedGlobalMessages[name], + messageId = customMessage ? "customMessage" : "defaultMessage"; context.report({ node: reference.identifier, messageId, @@ -103125,42 +91193,40 @@ module.exports = { } }); } + /** * 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) + Program(node) { + const scope = sourceCode.getScope(node); + // 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 + }); + // Report variables not declared at all scope.through.forEach(reference => { if (isRestricted(reference.identifier.name)) { reportReference(reference); } }); } - }; } - }; /***/ }), -/* 826 */ +/* 836 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -103168,17 +91234,18 @@ module.exports = { * @fileoverview Restrict usage of specified node imports. * @author Guy Ellis */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ - -const ignore = __webpack_require__(827); - +const ignore = __webpack_require__(837); const arrayOfStringsOrObjects = { type: "array", items: { @@ -103249,15 +91316,15 @@ const arrayOfStringsOrObjectPatterns = { uniqueItems: true }] }; -/** @type {import('../shared/types').Rule} */ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { description: "Disallow specified modules when loaded by `import`", recommended: false, - url: "https://eslint.org/docs/rules/no-restricted-imports" + url: "https://eslint.org/docs/latest/rules/no-restricted-imports" }, messages: { path: "'{{importSource}}' import is restricted from being used.", @@ -103294,9 +91361,8 @@ module.exports = { }] } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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) || []; @@ -103311,19 +91377,20 @@ module.exports = { importNames: importSource.importNames }; } - return memo; - }, {}); // Handle patterns too, either as strings or groups + }, {}); - let restrictedPatterns = (isPathAndPatternsObject ? options[0].patterns : []) || []; // standardize to array of objects if we have an array of strings + // Handle patterns too, either as strings or groups + let restrictedPatterns = (isPathAndPatternsObject ? options[0].patterns : []) || []; + // standardize to array of objects if we have an array of strings if (restrictedPatterns.length > 0 && typeof restrictedPatterns[0] === "string") { restrictedPatterns = [{ group: restrictedPatterns }]; - } // relative paths are supported for this rule - + } + // relative paths are supported for this rule const restrictedPatternGroups = restrictedPatterns.map(_ref => { let { group, @@ -103339,11 +91406,13 @@ module.exports = { customMessage: message, importNames }; - }); // if no imports are restricted we don't need to check + }); + // if no imports are restricted we don't need to check if (Object.keys(restrictedPaths).length === 0 && restrictedPatternGroups.length === 0) { return {}; } + /** * Report a restricted path. * @param {string} importSource path of the import @@ -103352,16 +91421,12 @@ module.exports = { * @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]; @@ -103376,7 +91441,6 @@ module.exports = { } }); } - restrictedImportNames.forEach(importName => { if (importNames.has(importName)) { const specifiers = importNames.get(importName); @@ -103405,6 +91469,7 @@ module.exports = { }); } } + /** * Report a restricted path specifically for patterns. * @param {node} node representing the restricted path reference @@ -103414,17 +91479,15 @@ module.exports = { * @returns {void} * @private */ - - function reportPathForPatterns(node, group, importNames) { const importSource = node.source.value.trim(); const customMessage = group.customMessage; const restrictedImportNames = group.importNames; + /* * If we are not restricting to any specific import names and just the pattern itself, * report the error and move on */ - if (!restrictedImportNames) { context.report({ node, @@ -103436,7 +91499,6 @@ module.exports = { }); return; } - if (importNames.has("*")) { const specifierData = importNames.get("*")[0]; context.report({ @@ -103450,12 +91512,10 @@ module.exports = { } }); } - restrictedImportNames.forEach(importName => { if (!importNames.has(importName)) { return; } - const specifiers = importNames.get(importName); specifiers.forEach(specifier => { context.report({ @@ -103471,6 +91531,7 @@ module.exports = { }); }); } + /** * Check if the given importSource is restricted by a pattern. * @param {string} importSource path of the import @@ -103478,23 +91539,19 @@ module.exports = { * @returns {boolean} whether the variable is a restricted pattern or not * @private */ - - function isRestrictedPattern(importSource, group) { return group.matcher.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("*", [{ @@ -103506,7 +91563,6 @@ module.exports = { const specifierData = { loc: specifier.loc }; - if (specifier.type === "ImportDefaultSpecifier") { name = "default"; } else if (specifier.type === "ImportNamespaceSpecifier") { @@ -103516,7 +91572,6 @@ module.exports = { } else if (specifier.local) { name = astUtils.getModuleExportName(specifier.local); } - if (typeof name === "string") { if (importNames.has(name)) { importNames.get(name).push(specifierData); @@ -103526,7 +91581,6 @@ module.exports = { } } } - checkRestrictedPathAndReport(importSource, importNames, node); restrictedPatternGroups.forEach(group => { if (isRestrictedPattern(importSource, group)) { @@ -103534,70 +91588,71 @@ module.exports = { } }); } - return { ImportDeclaration: checkNode, - ExportNamedDeclaration(node) { if (node.source) { checkNode(node); } }, - ExportAllDeclaration: checkNode }; } - }; /***/ }), -/* 827 */ +/* 837 */ /***/ ((module) => { // A simple implementation of make-array function makeArray(subject) { return Array.isArray(subject) ? subject : [subject]; } - const EMPTY = ''; const SPACE = ' '; const ESCAPE = '\\'; const REGEX_TEST_BLANK_LINE = /^\s+$/; +const REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/; const REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/; const REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/; -const REGEX_SPLITALL_CRLF = /\r?\n/g; // /foo, +const REGEX_SPLITALL_CRLF = /\r?\n/g; +// /foo, // ./foo, // ../foo, // . // .. - const REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/; const SLASH = '/'; -const KEY_IGNORE = typeof Symbol !== 'undefined' ? Symbol.for('node-ignore') -/* istanbul ignore next */ -: 'node-ignore'; +// Do not use ternary expression here, since "istanbul ignore next" is buggy +let TMP_KEY_IGNORE = 'node-ignore'; +/* istanbul ignore else */ +if (typeof Symbol !== 'undefined') { + TMP_KEY_IGNORE = Symbol.for('node-ignore'); +} +const KEY_IGNORE = TMP_KEY_IGNORE; const define = (object, key, value) => Object.defineProperty(object, key, { value }); - const REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g; +const RETURN_FALSE = () => false; -const RETURN_FALSE = () => false; // Sanitize the range of a regular expression +// 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 +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. -: EMPTY); // See fixtures #59 - +: EMPTY); +// See fixtures #59 const cleanRangeBackSlash = slashes => { const { length } = slashes; return slashes.slice(0, length - length % 2); -}; // > If the pattern ends with a slash, +}; + +// > 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, @@ -103606,16 +91661,20 @@ const cleanRangeBackSlash = slashes => { // '`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 REPLACERS = [// > Trailing spaces are ignored unless they are quoted with backslash ("\") -[// (a\ ) -> (a ) +const REPLACERS = [ +// > Trailing spaces are ignored unless they are quoted with backslash ("\") +[ +// (a\ ) -> (a ) // (a ) -> (a) // (a \ ) -> (a ) -/\\?\s+$/, match => match.indexOf('\\') === 0 ? SPACE : EMPTY], // replace (\ ) with ' ' -[/\\\s/g, () => SPACE], // Escape metacharacters +/\\?\s+$/, match => match.indexOf('\\') === 0 ? SPACE : EMPTY], +// replace (\ ) with ' ' +[/\\\s/g, () => SPACE], +// 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 ^, @@ -103630,121 +91689,173 @@ const REPLACERS = [// > Trailing spaces are ignored unless they are quoted with // > - and the opening square bracket [, // > - the opening curly brace {, // > These special characters are often called "metacharacters". -[/[\\$.|*+(){^]/g, match => `\\${match}`], [// > a question mark (?) matches a single character -/(?!\\)\?/g, () => '[^/]'], // leading slash -[// > A leading slash matches the beginning of the pathname. +[/[\\$.|*+(){^]/g, match => `\\${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. +/^\//, () => '^'], +// 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' -() => '^(?:.*\\/)?'], // starting -[// there will be no leading '/' +/^\^*\\\*\\\*\\\//, +// '**/foo' <-> 'foo' +() => '^(?:.*\\/)?'], +// 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() { // If has a slash `/` at the beginning or middle - return !/\/(?!$)/.test(this) // > Prior to 2.22.1 + return !/\/(?!$)/.test(this) + // > Prior to 2.22.1 // > 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 + // After 2.22.1 (compatible but clearer) // > If there is a separator at the beginning or middle (or both) // > of the pattern, then the pattern is relative to the directory // > level of the particular .gitignore file itself. // > Otherwise the pattern may also match at any level below // > the .gitignore level. - ? '(?:^|\\/)' // > Otherwise, Git treats the pattern as a shell glob suitable for + ? '(?:^|\\/)' + + // > 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 +}], +// 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 `'/**'` -(_, index, str) => index + 6 < str.length // case: /**/ +(_, 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: /** +? '(?:\\/[^\\/]+)*' + +// case: /** // > A trailing `"/**"` matches everything inside. + // #21: everything inside but it should not include the current folder -: '\\/.+'], // intermediate wildcards -[// Never replace escaped '*' +: '\\/.+'], +// normal intermediate wildcards +[ +// Never replace escaped '*' // ignore rule '\*' will match the path '*' + // 'abc.*/' -> go -// 'abc.*' -> skip this rule -/(^|[^\\]+)\\\*(?=.+)/g, // '*.js' matches '.js' +// 'abc.*' -> skip this rule, +// coz trailing single wildcard will be handed by [trailing wildcard] +/(^|[^\\]+)(\\\*)+(?=.+)/g, +// '*.js' matches '.js' // '*.js' doesn't match 'abc' -(_, p1) => `${p1}[^\\/]*`], [// unescape, revert step 3 except for back slash +(_, p1, p2) => { + // 1. + // > An asterisk "*" matches anything except a slash. + // 2. + // > Other consecutive asterisks are considered regular asterisks + // > and will match according to the previous rules. + const unescaped = p2.replace(/\\\*/g, '[^\\/]*'); + return p1 + unescaped; +}], [ +// unescape, revert step 3 except for back slash // For example, if a user escape a '\\*', // after step 3, the result will be '\\\\\\*' -/\\\\\\(?=[$.|*+(){^])/g, () => ESCAPE], [// '\\\\' -> '\\' -/\\\\/g, () => ESCAPE], [// > The range notation, e.g. [a-zA-Z], +/\\\\\\(?=[$.|*+(){^])/g, () => ESCAPE], [ +// '\\\\' -> '\\' +/\\\\/g, () => ESCAPE], [ +// > The range notation, e.g. [a-zA-Z], // > can be used to match one of the characters in a range. + // `\` is escaped by step 3 -/(\\)?\[([^\]/]*?)(\\*)($|\])/g, (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE // '\\[bar]' -> '\\\\[bar\\]' -? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === ']' ? endEscape.length % 2 === 0 // A normal case, and it is a range notation +/(\\)?\[([^\]/]*?)(\\*)($|\])/g, (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE +// '\\[bar]' -> '\\\\[bar\\]' +? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === ']' ? endEscape.length % 2 === 0 +// A normal case, and it is a range notation // '[bar]' // '[bar\\\\]' -? `[${sanitizeRange(range)}${endEscape}]` // Invalid range notaton +? `[${sanitizeRange(range)}${endEscape}]` +// Invalid range notaton // '[bar\\]' -> '[bar\\\\]' -: '[]' : '[]'], // ending -[// 'js' will not match 'js.' +: '[]' : '[]'], +// ending +[ +// 'js' will not match 'js.' // 'ab' will not match 'abc' -/(?:[^*])$/, // WTF! +/(?:[^*])$/, +// WTF! // https://git-scm.com/docs/gitignore // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1) // which re-fixes #24, #38 + // > If there is a separator at the end of the pattern then the pattern // > will only match directories, otherwise the pattern can match both // > files and directories. + // 'js*' will not match 'a.js' // 'js/' will not match 'a.js' // 'js' will match 'a.js' and 'a.js/' -match => /\/$/.test(match) // foo/ will not match 'foo' -? `${match}$` // foo matches 'foo' and 'foo/' -: `${match}(?=$|\\/$)`], // trailing wildcard +match => /\/$/.test(match) +// foo/ will not match 'foo' +? `${match}$` +// foo matches 'foo' and 'foo/' +: `${match}(?=$|\\/$)`], +// trailing wildcard [/(\^|\\\/)?\\\*$/, (_, p1) => { - const prefix = p1 // '\^': + const prefix = p1 + // '\^': // '/*' does not match EMPTY // '/*' does not match everything + // '\\\/': // 'abc/*' does not match 'abc/' - ? `${p1}[^/]+` // 'a*' matches 'a' + ? `${p1}[^/]+` + + // 'a*' matches 'a' // 'a*' matches 'aa' : '[^/]*'; return `${prefix}(?=$|\\/$)`; -}]]; // A simple cache, because an ignore rule only has only one certain meaning +}]]; -const regexCache = Object.create(null); // @param {pattern} +// A simple cache, because an ignore rule only has only one certain meaning +const regexCache = Object.create(null); +// @param {pattern} const makeRegex = (pattern, ignoreCase) => { let source = regexCache[pattern]; - if (!source) { source = REPLACERS.reduce((prev, current) => prev.replace(current[0], current[1].bind(pattern)), pattern); regexCache[pattern] = source; } - return ignoreCase ? new RegExp(source, 'i') : new RegExp(source); }; +const isString = subject => typeof subject === 'string'; -const isString = subject => typeof subject === 'string'; // > A blank line matches no files, so it can serve as a separator for readability. +// > A blank line matches no files, so it can serve as a separator for readability. +const checkPattern = pattern => pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) - -const checkPattern = pattern => pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) // > A line starting with # serves as a comment. +// > A line starting with # serves as a comment. && pattern.indexOf('#') !== 0; - const splitPattern = pattern => pattern.split(REGEX_SPLITALL_CRLF); - class IgnoreRule { constructor(origin, pattern, negative, regex) { this.origin = origin; @@ -103752,56 +91863,49 @@ class IgnoreRule { this.negative = negative; this.regex = regex; } - } - const createRule = (pattern, ignoreCase) => { const origin = pattern; - let negative = false; // > An optional prefix "!" which negates the 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 + pattern = pattern + // > Put a backslash ("\") in front of the first "!" for patterns that // > begin with a literal "!", for example, `"\!important!.txt"`. - .replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!') // > Put a backslash ("\") in front of the first hash for patterns that + .replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!') + // > Put a backslash ("\") in front of the first hash for patterns that // > begin with a hash. .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#'); const regex = makeRegex(pattern, ignoreCase); return new IgnoreRule(origin, pattern, negative, regex); }; - const throwError = (message, Ctor) => { throw new Ctor(message); }; - const checkPath = (path, originalPath, doThrow) => { if (!isString(path)) { return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError); - } // We don't know if we should ignore EMPTY, so throw - + } + // We don't know if we should ignore EMPTY, so throw if (!path) { return doThrow(`path must not be empty`, TypeError); - } // Check if it is a relative path - + } + // Check if it is a relative path if (checkPath.isNotRelative(path)) { const r = '`path.relative()`d'; return doThrow(`path should be a ${r} string, but got "${originalPath}"`, RangeError); } - return true; }; - const isNotRelative = path => REGEX_TEST_INVALID_PATH.test(path); - checkPath.isNotRelative = isNotRelative; - checkPath.convert = p => p; - class Ignore { constructor() { let { @@ -103813,15 +91917,12 @@ class Ignore { this._rules = []; this._ignoreCase = ignoreCase; this._allowRelativePaths = allowRelativePaths; - this._initCache(); } - _initCache() { this._ignoreCache = Object.create(null); this._testCache = Object.create(null); } - _addPattern(pattern) { // #32 if (pattern && pattern[KEY_IGNORE]) { @@ -103829,152 +91930,141 @@ class Ignore { this._added = true; return; } - if (checkPattern(pattern)) { const rule = createRule(pattern, this._ignoreCase); this._added = true; - this._rules.push(rule); } - } // @param {Array | string | Ignore} pattern - + } + // @param {Array | string | Ignore} pattern add(pattern) { this._added = false; - makeArray(isString(pattern) ? splitPattern(pattern) : pattern).forEach(this._addPattern, this); // Some rules have just added to the ignore, - // making the behavior changed. + makeArray(isString(pattern) ? splitPattern(pattern) : 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 - + } + // legacy addPattern(pattern) { return this.add(pattern); - } // | ignored : unignored + } + + // | ignored : unignored // negative | 0:0 | 0:1 | 1:0 | 1:1 // -------- | ------- | ------- | ------- | -------- // 0 | TEST | TEST | SKIP | X // 1 | TESTIF | SKIP | TEST | X + // - SKIP: always skip // - TEST: always test // - TESTIF: only test if checkUnignored // - X: that never happen + // @param {boolean} whether should check if the path is unignored, // setting `checkUnignored` to `false` could reduce additional // path matching. + // @returns {TestResult} true if a file is ignored - - _testOne(path, checkUnignored) { let ignored = false; let unignored = false; - this._rules.forEach(rule => { const { negative } = rule; - if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) { return; } - const matched = rule.regex.test(path); - if (matched) { ignored = !negative; unignored = negative; } }); - return { ignored, unignored }; - } // @returns {TestResult} - + } + // @returns {TestResult} _test(originalPath, cache, checkUnignored, slices) { - const path = originalPath // Supports nullable path + const path = originalPath + // Supports nullable path && checkPath.convert(originalPath); checkPath(path, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError); return this._t(path, cache, checkUnignored, slices); } - _t(path, cache, checkUnignored, slices) { if (path in cache) { return cache[path]; } - if (!slices) { // path/to/a.js // ['path', 'to', 'a.js'] slices = path.split(SLASH); } + slices.pop(); - slices.pop(); // If the path has no parent directory, just test it - + // If the path has no parent directory, just test it if (!slices.length) { return cache[path] = this._testOne(path, checkUnignored); } + const parent = this._t(slices.join(SLASH) + SLASH, cache, checkUnignored, slices); - const parent = this._t(slices.join(SLASH) + SLASH, cache, checkUnignored, slices); // If the path contains a parent directory, check the parent first - - - return cache[path] = parent.ignored // > It is not possible to re-include a file if a parent directory of + // If the path contains a parent directory, check the parent first + return cache[path] = parent.ignored + // > It is not possible to re-include a file if a parent directory of // > that file is excluded. ? parent : this._testOne(path, checkUnignored); } - ignores(path) { return this._test(path, this._ignoreCache, false).ignored; } - createFilter() { return path => !this.ignores(path); } - filter(paths) { return makeArray(paths).filter(this.createFilter()); - } // @returns {TestResult} - + } + // @returns {TestResult} test(path) { return this._test(path, this._testCache, true); } - } - const factory = options => new Ignore(options); - const isPathValid = path => checkPath(path && checkPath.convert(path), path, RETURN_FALSE); +factory.isPathValid = isPathValid; -factory.isPathValid = isPathValid; // Fixes typescript - +// Fixes typescript factory.default = factory; -module.exports = factory; // Windows +module.exports = factory; + +// Windows // -------------------------------------------------------------- - -/* istanbul ignore if */ - -if ( // Detect `process` so that it can run in browsers. +/* 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')) { /* eslint no-control-regex: "off" */ const makePosix = str => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, '/'); + checkPath.convert = makePosix; - checkPath.convert = makePosix; // 'C:\\foo' <- 'C:\\foo' has been converted to 'C:/' + // 'C:\\foo' <- 'C:\\foo' has been converted to 'C:/' // 'd:\\foo' - const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i; - checkPath.isNotRelative = path => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path) || isNotRelative(path); } /***/ }), -/* 828 */ +/* 838 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -103983,12 +92073,12 @@ typeof process !== 'undefined' && (process.env && process.env.IGNORE_TEST_WIN32 * @author Christian Schulz * @deprecated in ESLint v7.0.0 */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ - -const ignore = __webpack_require__(827); - +const ignore = __webpack_require__(837); const arrayOfStrings = { type: "array", items: { @@ -104018,8 +92108,8 @@ const arrayOfStringsOrObjects = { }, uniqueItems: true }; -/** @type {import('../shared/types').Rule} */ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { deprecated: true, @@ -104028,7 +92118,7 @@ module.exports = { docs: { description: "Disallow specified modules when loaded by `require`", recommended: false, - url: "https://eslint.org/docs/rules/no-restricted-modules" + url: "https://eslint.org/docs/latest/rules/no-restricted-modules" }, schema: { anyOf: [arrayOfStringsOrObjects, { @@ -104051,7 +92141,6 @@ module.exports = { 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")); @@ -104063,65 +92152,61 @@ module.exports = { } else { memo[importName.name] = importName.message; } - return memo; - }, {}); // if no imports are restricted we don't need to check + }, {}); + // if no imports are restricted we don't need to check if (Object.keys(restrictedPaths).length === 0 && restrictedPatterns.length === 0) { return {}; - } // relative paths are supported for this rule - + } + // relative paths are supported for this rule const ig = ignore({ allowRelativePaths: true }).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 @@ -104129,8 +92214,6 @@ module.exports = { * @returns {void} * @private */ - - function reportPath(node, name) { const customMessage = restrictedPathMessages[name]; const messageId = customMessage ? "customMessage" : "defaultMessage"; @@ -104143,31 +92226,29 @@ module.exports = { } }); } + /** * 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 + 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, @@ -104181,14 +92262,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 829 */ +/* 839 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -104198,25 +92277,27 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow certain properties on certain objects", recommended: false, - url: "https://eslint.org/docs/rules/no-restricted-properties" + url: "https://eslint.org/docs/latest/rules/no-restricted-properties" }, schema: { type: "array", items: { - anyOf: [// `object` and `property` are both optional, but at least one of them must be provided. + anyOf: [ + // `object` and `property` are both optional, but at least one of them must be provided. { type: "object", properties: { @@ -104258,21 +92339,17 @@ module.exports = { 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 @@ -104285,12 +92362,12 @@ module.exports = { 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 @@ -104298,16 +92375,13 @@ module.exports = { * @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({ @@ -104331,17 +92405,15 @@ module.exports = { }); } } + /** * 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)); @@ -104349,16 +92421,13 @@ module.exports = { } } } - 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)); @@ -104366,16 +92435,14 @@ module.exports = { } } }, - AssignmentExpression: checkDestructuringAssignment, AssignmentPattern: checkDestructuringAssignment }; } - }; /***/ }), -/* 830 */ +/* 840 */ /***/ ((module) => { "use strict"; @@ -104383,19 +92450,20 @@ module.exports = { * @fileoverview Rule to flag use of certain node types * @author Burak Yigit Kaya */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow specified syntax", recommended: false, - url: "https://eslint.org/docs/rules/no-restricted-syntax" + url: "https://eslint.org/docs/latest/rules/no-restricted-syntax" }, schema: { type: "array", @@ -104424,7 +92492,6 @@ module.exports = { restrictedSyntax: "{{message}}" } }, - create(context) { return context.options.reduce((result, selectorOrObject) => { const isStringFormat = typeof selectorOrObject === "string"; @@ -104441,15 +92508,13 @@ module.exports = { } }); } - }); }, {}); } - }; /***/ }), -/* 831 */ +/* 841 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -104457,28 +92522,31 @@ module.exports = { * @fileoverview Rule to flag when return statement contains assignment * @author Ilya Volodin */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ +const SENTINEL_TYPE = /^(?:[a-zA-Z]+?Statement|ArrowFunctionExpression|FunctionExpression|ClassExpression)$/u; -const SENTINEL_TYPE = /^(?:[a-zA-Z]+?Statement|ArrowFunctionExpression|FunctionExpression|ClassExpression)$/u; //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow assignment operators in `return` statements", recommended: false, - url: "https://eslint.org/docs/rules/no-return-assign" + url: "https://eslint.org/docs/latest/rules/no-return-assign" }, schema: [{ enum: ["except-parens", "always"] @@ -104488,25 +92556,24 @@ module.exports = { arrowAssignment: "Arrow function should not return assignment." } }, - create(context) { const always = (context.options[0] || "except-parens") !== "except-parens"; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; return { AssignmentExpression(node) { if (!always && astUtils.isParenthesised(sourceCode, node)) { return; } - let currentChild = node; - let parent = currentChild.parent; // Find ReturnStatement or ArrowFunctionExpression in ancestors. + let parent = currentChild.parent; + // Find ReturnStatement or ArrowFunctionExpression in ancestors. while (parent && !SENTINEL_TYPE.test(parent.type)) { currentChild = parent; parent = parent.parent; - } // Reports. - + } + // Reports. if (parent && parent.type === "ReturnStatement") { context.report({ node: parent, @@ -104519,14 +92586,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 832 */ +/* 842 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -104536,28 +92601,29 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { + hasSuggestions: true, type: "suggestion", docs: { description: "Disallow unnecessary `return await`", recommended: false, - url: "https://eslint.org/docs/rules/no-return-await" + url: "https://eslint.org/docs/latest/rules/no-return-await" }, fixable: null, schema: [], messages: { + removeAwait: "Remove redundant `await`.", redundantUseOfAwait: "Redundant use of `await` on a return value." } }, - create(context) { /** * Reports a found unnecessary `await` expression. @@ -104566,11 +92632,28 @@ module.exports = { */ function reportUnnecessaryAwait(node) { context.report({ - node: context.getSourceCode().getFirstToken(node), + node: context.sourceCode.getFirstToken(node), loc: node.loc, - messageId: "redundantUseOfAwait" + messageId: "redundantUseOfAwait", + suggest: [{ + messageId: "removeAwait", + fix(fixer) { + const sourceCode = context.sourceCode; + const [awaitToken, tokenAfterAwait] = sourceCode.getFirstTokens(node, 2); + const areAwaitAndAwaitedExpressionOnTheSameLine = awaitToken.loc.start.line === tokenAfterAwait.loc.start.line; + if (!areAwaitAndAwaitedExpressionOnTheSameLine) { + return null; + } + const [startOfAwait, endOfAwait] = awaitToken.range; + const characterAfterAwait = sourceCode.text[endOfAwait]; + const trimLength = characterAfterAwait === " " ? 1 : 0; + const range = [startOfAwait, endOfAwait + trimLength]; + return fixer.removeRange(range); + } + }] }); } + /** * 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 @@ -104578,67 +92661,53 @@ module.exports = { * @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); } } - }; } - }; /***/ }), -/* 833 */ +/* 843 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -104646,31 +92715,30 @@ module.exports = { * @fileoverview Rule to flag when using javascript: urls * @author Ilya Volodin */ - /* eslint no-script-url: 0 -- Code is checking to report such URLs */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow `javascript:` urls", recommended: false, - url: "https://eslint.org/docs/rules/no-script-url" + url: "https://eslint.org/docs/latest/rules/no-script-url" }, schema: [], messages: { unexpectedScriptURL: "Script URL is a form of eval." } }, - create(context) { /** * Check whether a node's static value starts with "javascript:" or not. @@ -104680,7 +92748,6 @@ module.exports = { */ function check(node) { const value = astUtils.getStaticStringValue(node); - if (typeof value === "string" && value.toLowerCase().indexOf("javascript:") === 0) { context.report({ node, @@ -104688,27 +92755,23 @@ module.exports = { }); } } - return { Literal(node) { if (node.value && typeof node.value === "string") { check(node); } }, - TemplateLiteral(node) { if (!(node.parent && node.parent.type === "TaggedTemplateExpression")) { check(node); } } - }; } - }; /***/ }), -/* 834 */ +/* 844 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -104716,16 +92779,20 @@ module.exports = { * @fileoverview Rule to disallow assignments where both sides are exactly the same * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // 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 @@ -104736,24 +92803,25 @@ const SPACES = /\s+/gu; * @param {Function} report A callback function to report. * @returns {void} */ - function eachSelfAssignment(left, right, props, report) { - if (!left || !right) {// do nothing + 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] + 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); - eachSelfAssignment(leftElement, rightElement, props, report); // After a spread element, those indices are unknown. - + // After a spread element, those indices are unknown. if (rightElement && rightElement.type === "SpreadElement") { break; } @@ -104766,16 +92834,13 @@ function eachSelfAssignment(left, right, props, report) { * 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); @@ -104783,27 +92848,26 @@ function eachSelfAssignment(left, right, 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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow assignments where both sides are exactly the same", recommended: true, - url: "https://eslint.org/docs/rules/no-self-assign" + url: "https://eslint.org/docs/latest/rules/no-self-assign" }, schema: [{ type: "object", @@ -104819,18 +92883,17 @@ module.exports = { selfAssignment: "'{{name}}' is assigned to itself." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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, @@ -104840,21 +92903,18 @@ module.exports = { } }); } - return { AssignmentExpression(node) { if (["=", "&&=", "||=", "??="].includes(node.operator)) { eachSelfAssignment(node.left, node.right, props, report); } } - }; } - }; /***/ }), -/* 835 */ +/* 845 */ /***/ ((module) => { "use strict"; @@ -104863,45 +92923,44 @@ module.exports = { * part. * @author Ilya Volodin */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow comparisons where both sides are exactly the same", recommended: false, - url: "https://eslint.org/docs/rules/no-self-compare" + url: "https://eslint.org/docs/latest/rules/no-self-compare" }, schema: [], messages: { comparingToSelf: "Comparing to itself is potentially pointless." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * 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, @@ -104909,14 +92968,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 836 */ +/* 846 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -104924,30 +92981,34 @@ module.exports = { * @fileoverview Rule to flag use of comma operator * @author Brandon Mills */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - const DEFAULT_OPTIONS = { allowInParentheses: true -}; //------------------------------------------------------------------------------ +}; + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow comma operators", recommended: false, - url: "https://eslint.org/docs/rules/no-sequences" + url: "https://eslint.org/docs/latest/rules/no-sequences" }, schema: [{ properties: { @@ -104962,14 +93023,13 @@ module.exports = { unexpectedCommaExpression: "Unexpected use of comma operator." } }, - create(context) { const options = Object.assign({}, DEFAULT_OPTIONS, context.options[0]); - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * Parts of the grammar that are required to have parens. */ - const parenthesized = { DoWhileStatement: "test", IfStatement: "test", @@ -104977,55 +93037,52 @@ module.exports = { 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); + 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 - + } + // Wrapping a sequence in extra parens indicates intent if (options.allowInParentheses) { if (requiresExtraParens(node)) { if (isParenthesisedTwice(node)) { @@ -105037,7 +93094,6 @@ module.exports = { } } } - const firstCommaToken = sourceCode.getTokenAfter(node.expressions[0], astUtils.isCommaToken); context.report({ node, @@ -105045,14 +93101,12 @@ module.exports = { messageId: "unexpectedCommaExpression" }); } - }; } - }; /***/ }), -/* 837 */ +/* 847 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -105060,15 +93114,18 @@ module.exports = { * @fileoverview Rule to disallow returning values from setters * @author Milos Djermanovic */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - -const astUtils = __webpack_require__(618); - +const astUtils = __webpack_require__(639); const { findVariable -} = __webpack_require__(571); //------------------------------------------------------------------------------ +} = __webpack_require__(594); + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -105078,12 +93135,11 @@ const { * @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. @@ -105094,134 +93150,117 @@ function isGlobalReference(node, scope) { * @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.type === "Property" || parent.type === "MethodDefinition") && 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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow returning values from setters", recommended: true, - url: "https://eslint.org/docs/rules/no-setter-return" + url: "https://eslint.org/docs/latest/rules/no-setter-return" }, schema: [], messages: { returnsValue: "Setter cannot return a value." } }, - create(context) { let funcInfo = null; + const sourceCode = context.sourceCode; + /** * 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()); + const outerScope = getOuterScope(sourceCode.getScope(node)); 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 @@ -105232,34 +93271,28 @@ module.exports = { */ 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); } } - }; } - }; /***/ }), -/* 838 */ +/* 848 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -105267,31 +93300,35 @@ module.exports = { * @fileoverview Rule to flag on declaring variables already declared in the outer scope * @author Ilya Volodin */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - const FUNC_EXPR_NODE_TYPES = new Set(["ArrowFunctionExpression", "FunctionExpression"]); const CALL_EXPR_NODE_TYPE = new Set(["CallExpression"]); const FOR_IN_OF_TYPE = /^For(?:In|Of)Statement$/u; -const SENTINEL_TYPE = /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/u; //------------------------------------------------------------------------------ +const SENTINEL_TYPE = /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/u; + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow variable declarations from shadowing variables declared in the outer scope", recommended: false, - url: "https://eslint.org/docs/rules/no-shadow" + url: "https://eslint.org/docs/latest/rules/no-shadow" }, schema: [{ type: "object", @@ -105322,7 +93359,6 @@ module.exports = { noShadowGlobal: "'{{name}}' is already a global variable." } }, - create(context) { const options = { builtinGlobals: context.options[0] && context.options[0].builtinGlobals, @@ -105330,95 +93366,80 @@ module.exports = { allow: context.options[0] && context.options[0].allow || [], ignoreOnInitialization: context.options[0] && context.options[0].ignoreOnInitialization }; + const sourceCode = context.sourceCode; + /** * 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]; } + /** * Searches from the current node through its ancestry to find a matching node. * @param {ASTNode} node a node to get. * @param {(node: ASTNode) => boolean} match a callback that checks whether or not the node verifies its condition or not. * @returns {ASTNode|null} the matching node. */ - - function findSelfOrAncestor(node, match) { let currentNode = node; - while (currentNode && !match(currentNode)) { currentNode = currentNode.parent; } - return currentNode; } + /** * 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; } + /** * Checks if a variable and a shadowedVariable have the same init pattern ancestor. * @param {Object} variable a variable to check. * @param {Object} shadowedVariable a shadowedVariable to check. * @returns {boolean} Whether or not the variable and the shadowedVariable have the same init pattern ancestor. */ - - function isInitPatternNode(variable, shadowedVariable) { const outerDef = shadowedVariable.defs[0]; - if (!outerDef) { return false; } - const { variableScope } = variable.scope; - if (!(FUNC_EXPR_NODE_TYPES.has(variableScope.block.type) && getOuterScope(variableScope) === shadowedVariable.scope)) { return false; } - const fun = variableScope.block; const { parent } = fun; const callExpression = findSelfOrAncestor(parent, node => CALL_EXPR_NODE_TYPE.has(node.type)); - if (!callExpression) { return false; } - let node = outerDef.name; const location = callExpression.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)) { @@ -105427,22 +93448,20 @@ module.exports = { } else if (SENTINEL_TYPE.test(node.type)) { break; } - node = node.parent; } - return false; } + /** * 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.includes(variable.name); } + /** * Checks if a variable of the class name in the class scope of ClassDeclaration. * @@ -105451,12 +93470,11 @@ module.exports = { * @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. * @@ -105466,8 +93484,6 @@ module.exports = { * @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]; @@ -105477,28 +93493,25 @@ module.exports = { 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; } + /** * Get declared line and column of a variable. * @param {eslint-scope.Variable} variable The variable to get. * @returns {Object} The declared line and column of the variable. */ - - function getDeclaredLocation(variable) { const identifier = variable.identifiers[0]; let obj; - if (identifier) { obj = { global: false, @@ -105510,56 +93523,51 @@ module.exports = { global: true }; } - return obj; } + /** * 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"}. + 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. + 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. - + } + // 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.ignoreOnInitialization && isInitPatternNode(variable, shadowed)) && !(options.hoist !== "all" && isInTdz(variable, shadowed))) { const location = getDeclaredLocation(shadowed); const messageId = location.global ? "noShadowGlobal" : "noShadow"; const data = { name: variable.name }; - if (!location.global) { data.shadowedLine = location.line; data.shadowedColumn = location.column; } - context.report({ node: variable.identifiers[0], messageId, @@ -105568,26 +93576,22 @@ module.exports = { } } } - return { - "Program:exit"() { - const globalScope = context.getScope(); + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); const stack = globalScope.childScopes.slice(); - while (stack.length) { const scope = stack.pop(); stack.push(...scope.childScopes); checkForShadows(scope); } } - }; } - }; /***/ }), -/* 839 */ +/* 849 */ /***/ ((module) => { "use strict"; @@ -105596,6 +93600,7 @@ module.exports = { * @author Michael Ficarra */ + /** * 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 @@ -105603,35 +93608,34 @@ module.exports = { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow identifiers from shadowing restricted names", recommended: true, - url: "https://eslint.org/docs/rules/no-shadow-restricted-names" + url: "https://eslint.org/docs/latest/rules/no-shadow-restricted-names" }, schema: [], messages: { shadowingRestrictedName: "Shadowing of global property '{{name}}'." } }, - create(context) { const RESTRICTED = new Set(["undefined", "NaN", "Infinity", "arguments", "eval"]); + const sourceCode = context.sourceCode; return { "VariableDeclaration, :function, CatchClause"(node) { - for (const variable of context.getDeclaredVariables(node)) { + for (const variable of sourceCode.getDeclaredVariables(node)) { if (variable.defs.length > 0 && RESTRICTED.has(variable.name) && !safelyShadowsUndefined(variable)) { context.report({ node: variable.defs[0].name, @@ -105643,14 +93647,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 840 */ +/* 850 */ /***/ ((module) => { "use strict"; @@ -105659,19 +93661,21 @@ module.exports = { * @author Matt DuVall * @deprecated in ESLint v3.3.0 */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "layout", docs: { description: "Disallow spacing between function identifiers and their applications (deprecated)", recommended: false, - url: "https://eslint.org/docs/rules/no-spaced-func" + url: "https://eslint.org/docs/latest/rules/no-spaced-func" }, deprecated: true, replacedBy: ["func-call-spacing"], @@ -105681,51 +93685,47 @@ module.exports = { noSpacedFunction: "Unexpected space between function name and paren." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * 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. + 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 - + } + // 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 }; } - }; /***/ }), -/* 841 */ +/* 851 */ /***/ ((module) => { "use strict"; @@ -105733,34 +93733,34 @@ module.exports = { * @fileoverview Disallow sparse arrays * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow sparse arrays", recommended: true, - url: "https://eslint.org/docs/rules/no-sparse-arrays" + url: "https://eslint.org/docs/latest/rules/no-sparse-arrays" }, schema: [], messages: { unexpectedSparseArray: "Unexpected comma in middle of array." } }, - create(context) { //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- + return { ArrayExpression(node) { const emptySpot = node.elements.includes(null); - if (emptySpot) { context.report({ node, @@ -105768,14 +93768,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 842 */ +/* 852 */ /***/ ((module) => { "use strict"; @@ -105784,12 +93782,14 @@ module.exports = { * @author Matt DuVall * @deprecated in ESLint v7.0.0 */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { deprecated: true, @@ -105798,7 +93798,7 @@ module.exports = { docs: { description: "Disallow synchronous methods", recommended: false, - url: "https://eslint.org/docs/rules/no-sync" + url: "https://eslint.org/docs/latest/rules/no-sync" }, schema: [{ type: "object", @@ -105814,7 +93814,6 @@ module.exports = { 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 { @@ -105827,14 +93826,12 @@ module.exports = { } }); } - }; } - }; /***/ }), -/* 843 */ +/* 853 */ /***/ ((module) => { "use strict"; @@ -105842,24 +93839,27 @@ module.exports = { * @fileoverview Rule to check for tabs inside a file * @author Gyandeep Singh */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - const tabRegex = /\t+/gu; -const anyNonWhitespaceRegex = /\S/u; //------------------------------------------------------------------------------ +const anyNonWhitespaceRegex = /\S/u; + +//------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "layout", docs: { description: "Disallow all tabs", recommended: false, - url: "https://eslint.org/docs/rules/no-tabs" + url: "https://eslint.org/docs/latest/rules/no-tabs" }, schema: [{ type: "object", @@ -105875,20 +93875,17 @@ module.exports = { unexpectedTab: "Unexpected tab character." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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: { @@ -105906,14 +93903,12 @@ module.exports = { } }); } - }; } - }; /***/ }), -/* 844 */ +/* 854 */ /***/ ((module) => { "use strict"; @@ -105921,26 +93916,26 @@ module.exports = { * @fileoverview Warn when using template string syntax in regular strings * @author Jeroen Engels */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow template literal placeholder syntax in regular strings", recommended: false, - url: "https://eslint.org/docs/rules/no-template-curly-in-string" + url: "https://eslint.org/docs/latest/rules/no-template-curly-in-string" }, schema: [], messages: { unexpectedTemplateExpression: "Unexpected template string expression." } }, - create(context) { const regex = /\$\{[^}]+\}/u; return { @@ -105952,14 +93947,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 845 */ +/* 855 */ /***/ ((module) => { "use strict"; @@ -105967,26 +93960,27 @@ module.exports = { * @fileoverview Rule to flag use of ternary operators. * @author Ian Christian Myers */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow ternary operators", recommended: false, - url: "https://eslint.org/docs/rules/no-ternary" + url: "https://eslint.org/docs/latest/rules/no-ternary" }, schema: [], messages: { noTernaryOperator: "Ternary operator used." } }, - create(context) { return { ConditionalExpression(node) { @@ -105995,14 +93989,12 @@ module.exports = { messageId: "noTernaryOperator" }); } - }; } - }; /***/ }), -/* 846 */ +/* 856 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -106010,11 +94002,15 @@ module.exports = { * @fileoverview A rule to disallow using `this`/`super` before `super()`. * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -106025,31 +94021,28 @@ const astUtils = __webpack_require__(618); //----------------------------------- * `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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow `this`/`super` before calling `super()` in constructors", recommended: true, - url: "https://eslint.org/docs/rules/no-this-before-super" + url: "https://eslint.org/docs/latest/rules/no-this-before-super" }, schema: [], messages: { noBeforeSuper: "'{{kind}}' is not allowed before 'super()'." } }, - create(context) { /* * Information for each constructor. @@ -106060,6 +94053,7 @@ module.exports = { * - 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. @@ -106067,72 +94061,62 @@ module.exports = { * - 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. @@ -106159,7 +94143,6 @@ module.exports = { }; } }, - /** * Removes the top of stack item. * @@ -106171,14 +94154,11 @@ module.exports = { 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({ @@ -106189,13 +94169,11 @@ module.exports = { } }); } - if (info.superCalled) { controller.skip(); } }); }, - /** * Initialize information of a given code path segment. * @param {CodePathSegment} segment A code path segment to initialize. @@ -106204,15 +94182,14 @@ module.exports = { onCodePathSegmentStart(segment) { if (!isInConstructorOfDerivedClass()) { return; - } // Initialize info. - + } + // 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. @@ -106225,15 +94202,14 @@ module.exports = { onCodePathSegmentLoop(fromSegment, toSegment) { if (!isInConstructorOfDerivedClass()) { return; - } // Update information inside of the loop. - + } + // 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(); @@ -106243,7 +94219,6 @@ module.exports = { } }); }, - /** * Reports if this is before `super()`. * @param {ASTNode} node A target node. @@ -106254,7 +94229,6 @@ module.exports = { setInvalid(node); } }, - /** * Reports if this is before `super()`. * @param {ASTNode} node A target node. @@ -106265,7 +94239,6 @@ module.exports = { setInvalid(node); } }, - /** * Marks `super()` called. * @param {ASTNode} node A target node. @@ -106276,7 +94249,6 @@ module.exports = { setSuperCalled(); } }, - /** * Resets state. * @returns {void} @@ -106284,14 +94256,12 @@ module.exports = { "Program:exit"() { segInfoMap = Object.create(null); } - }; } - }; /***/ }), -/* 847 */ +/* 857 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -106301,20 +94271,21 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow throwing literals as exceptions", recommended: false, - url: "https://eslint.org/docs/rules/no-throw-literal" + url: "https://eslint.org/docs/latest/rules/no-throw-literal" }, schema: [], messages: { @@ -106322,7 +94293,6 @@ module.exports = { undef: "Do not throw undefined." } }, - create(context) { return { ThrowStatement(node) { @@ -106340,14 +94310,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 848 */ +/* 858 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -106355,24 +94323,25 @@ module.exports = { * @fileoverview Disallow trailing spaces at the end of lines. * @author Nodeca Team */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Disallow trailing whitespace at the end of lines", recommended: false, - url: "https://eslint.org/docs/rules/no-trailing-spaces" + url: "https://eslint.org/docs/latest/rules/no-trailing-spaces" }, fixable: "whitespace", schema: [{ @@ -106393,15 +94362,15 @@ module.exports = { trailingSpace: "Trailing spaces not allowed." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const BLANK_CLASS = "[ \t\u00a0\u2000-\u200b\u3000]", - SKIP_BLANK = `^${BLANK_CLASS}*$`, - NONBLANK = `${BLANK_CLASS}+$`; + SKIP_BLANK = `^${BLANK_CLASS}*$`, + NONBLANK = `${BLANK_CLASS}+$`; const options = context.options[0] || {}, - skipBlankLines = options.skipBlankLines || false, - ignoreComments = options.ignoreComments || false; + skipBlankLines = options.skipBlankLines || false, + ignoreComments = options.ignoreComments || false; + /** * Report the error message * @param {ASTNode} node node to report @@ -106409,7 +94378,6 @@ module.exports = { * @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 @@ -106421,62 +94389,58 @@ module.exports = { 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 = []; + 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: { @@ -106491,39 +94455,33 @@ module.exports = { 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; } } }; } - }; /***/ }), -/* 849 */ +/* 859 */ /***/ ((module) => { "use strict"; @@ -106531,7 +94489,9 @@ module.exports = { * @fileoverview Rule to flag references to undeclared variables. * @author Mark Macdonald */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -106540,24 +94500,23 @@ module.exports = { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow the use of undeclared variables unless mentioned in `/*global */` comments", recommended: true, - url: "https://eslint.org/docs/rules/no-undef" + url: "https://eslint.org/docs/latest/rules/no-undef" }, schema: [{ type: "object", @@ -106573,20 +94532,18 @@ module.exports = { undef: "'{{name}}' is not defined." } }, - create(context) { const options = context.options[0]; const considerTypeOf = options && options.typeof === true || false; + const sourceCode = context.sourceCode; return { - "Program:exit"() { - const globalScope = context.getScope(); + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); globalScope.through.forEach(ref => { const identifier = ref.identifier; - if (!considerTypeOf && hasTypeOfOperator(identifier)) { return; } - context.report({ node: identifier, messageId: "undef", @@ -106594,14 +94551,12 @@ module.exports = { }); }); } - }; } - }; /***/ }), -/* 850 */ +/* 860 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -106611,20 +94566,21 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow initializing variables to `undefined`", recommended: false, - url: "https://eslint.org/docs/rules/no-undef-init" + url: "https://eslint.org/docs/latest/rules/no-undef-init" }, schema: [], fixable: "code", @@ -106632,18 +94588,16 @@ module.exports = { unnecessaryUndefinedInit: "It's not necessary to initialize '{{name}}' to undefined." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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); - + init = node.init && node.init.name, + scope = sourceCode.getScope(node), + 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, @@ -106651,35 +94605,28 @@ module.exports = { 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]]); } - }); } } - }; } - }; /***/ }), -/* 851 */ +/* 861 */ /***/ ((module) => { "use strict"; @@ -106687,27 +94634,29 @@ module.exports = { * @fileoverview Rule to flag references to the undefined variable. * @author Michael Ficarra */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow the use of `undefined` as an identifier", recommended: false, - url: "https://eslint.org/docs/rules/no-undefined" + url: "https://eslint.org/docs/latest/rules/no-undefined" }, schema: [], messages: { unexpectedUndefined: "Unexpected use of undefined." } }, - create(context) { + const sourceCode = context.sourceCode; + /** * Report an invalid "undefined" identifier node. * @param {ASTNode} node The node to report. @@ -106719,47 +94668,41 @@ module.exports = { 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) + 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(); + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); const stack = [globalScope]; - while (stack.length) { const scope = stack.pop(); stack.push(...scope.childScopes); checkScope(scope); } } - }; } - }; /***/ }), -/* 852 */ +/* 862 */ /***/ ((module) => { "use strict"; @@ -106767,19 +94710,21 @@ module.exports = { * @fileoverview Rule to flag dangling underscores in variable declarations. * @author Matt DuVall */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow dangling underscores in identifiers", recommended: false, - url: "https://eslint.org/docs/rules/no-underscore-dangle" + url: "https://eslint.org/docs/latest/rules/no-underscore-dangle" }, schema: [{ type: "object", @@ -106813,6 +94758,14 @@ module.exports = { enforceInClassFields: { type: "boolean", default: false + }, + allowInArrayDestructuring: { + type: "boolean", + default: true + }, + allowInObjectDestructuring: { + type: "boolean", + default: true } }, additionalProperties: false @@ -106821,7 +94774,6 @@ module.exports = { unexpectedUnderscore: "Unexpected dangling '_' in '{{identifier}}'." } }, - create(context) { const options = context.options[0] || {}; const ALLOWED_VARIABLES = options.allow ? options.allow : []; @@ -106830,7 +94782,12 @@ module.exports = { const allowAfterThisConstructor = typeof options.allowAfterThisConstructor !== "undefined" ? options.allowAfterThisConstructor : false; const enforceInMethodNames = typeof options.enforceInMethodNames !== "undefined" ? options.enforceInMethodNames : false; const enforceInClassFields = typeof options.enforceInClassFields !== "undefined" ? options.enforceInClassFields : false; - const allowFunctionParams = typeof options.allowFunctionParams !== "undefined" ? options.allowFunctionParams : true; //------------------------------------------------------------------------- + const allowFunctionParams = typeof options.allowFunctionParams !== "undefined" ? options.allowFunctionParams : true; + const allowInArrayDestructuring = typeof options.allowInArrayDestructuring !== "undefined" ? options.allowInArrayDestructuring : true; + const allowInObjectDestructuring = typeof options.allowInObjectDestructuring !== "undefined" ? options.allowInObjectDestructuring : true; + const sourceCode = context.sourceCode; + + //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- @@ -106840,64 +94797,58 @@ module.exports = { * @returns {boolean} true if its is present * @private */ - function isAllowed(identifier) { return ALLOWED_VARIABLES.includes(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 => { @@ -106905,7 +94856,6 @@ module.exports = { type } = param; let nodeToCheck; - if (type === "RestElement") { nodeToCheck = param.argument; } else if (type === "AssignmentPattern") { @@ -106913,10 +94863,8 @@ module.exports = { } else { nodeToCheck = param; } - if (nodeToCheck.type === "Identifier") { const identifier = nodeToCheck.name; - if (hasDanglingUnderscore(identifier) && !isAllowed(identifier)) { context.report({ node: param, @@ -106930,18 +94878,16 @@ module.exports = { }); } } + /** * 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, @@ -106952,44 +94898,47 @@ module.exports = { }); } } - 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 - } - }); - } + sourceCode.getDeclaredVariables(node).forEach(variable => { + const definition = variable.defs.find(def => def.node === node); + const identifierNode = definition.name; + const identifier = identifierNode.name; + let parent = identifierNode.parent; + while (!["VariableDeclarator", "ArrayPattern", "ObjectPattern"].includes(parent.type)) { + parent = parent.parent; + } + if (hasDanglingUnderscore(identifier) && !isSpecialCaseIdentifierInVariableExpression(identifier) && !isAllowed(identifier) && !(allowInArrayDestructuring && parent.type === "ArrayPattern") && !(allowInObjectDestructuring && parent.type === "ObjectPattern")) { + 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); - + 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, @@ -107000,18 +94949,16 @@ module.exports = { }); } } + /** * 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, @@ -107022,17 +94969,15 @@ module.exports = { }); } } + /** * Check if a class field has a dangling underscore * @param {ASTNode} node node to evaluate * @returns {void} * @private */ - - function checkForDanglingUnderscoreInClassField(node) { const identifier = node.key.name; - if (typeof identifier !== "undefined" && hasDanglingUnderscore(identifier) && enforceInClassFields && !isAllowed(identifier)) { context.report({ node, @@ -107042,11 +94987,12 @@ module.exports = { } }); } - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public API //-------------------------------------------------------------------------- - return { FunctionDeclaration: checkForDanglingUnderscoreInFunction, VariableDeclarator: checkForDanglingUnderscoreInVariableExpression, @@ -107058,11 +95004,10 @@ module.exports = { ArrowFunctionExpression: checkForDanglingUnderscoreInFunction }; } - }; /***/ }), -/* 853 */ +/* 863 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -107070,24 +95015,25 @@ module.exports = { * @fileoverview Rule to spot scenarios where a newline looks like it is ending a statement, but is not. * @author Glen Mailer */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow confusing multiline expressions", recommended: true, - url: "https://eslint.org/docs/rules/no-unexpected-multiline" + url: "https://eslint.org/docs/latest/rules/no-unexpected-multiline" }, schema: [], messages: { @@ -107097,10 +95043,10 @@ module.exports = { division: "Unexpected newline between numerator and division operator." } }, - create(context) { const REGEX_FLAG_MATCHER = /^[gimsuy]+$/u; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * Check to see if there is a newline between the node and the following open bracket * line's expression @@ -107109,11 +95055,9 @@ module.exports = { * @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, @@ -107121,27 +95065,26 @@ module.exports = { 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 + } = 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, @@ -107156,31 +95099,25 @@ module.exports = { }); } }, - 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"); } } - }; } - }; /***/ }), -/* 854 */ +/* 864 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -107188,22 +95125,25 @@ module.exports = { * @fileoverview Rule to disallow use of unmodified expressions in loop conditions * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const Traverser = __webpack_require__(588), + astUtils = __webpack_require__(639); -const Traverser = __webpack_require__(565), - astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // 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. @@ -107220,53 +95160,48 @@ const DYNAMIC_PATTERN = /^(?:Call|Member|New|TaggedTemplate|Yield)Expression$/u; * @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. @@ -107274,93 +95209,83 @@ function isInRange(node, reference) { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow unmodified loop conditions", recommended: false, - url: "https://eslint.org/docs/rules/no-unmodified-loop-condition" + url: "https://eslint.org/docs/latest/rules/no-unmodified-loop-condition" }, schema: [], messages: { loopConditionNotModified: "'{{name}}' is not modified in this loop." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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({ @@ -107369,55 +95294,48 @@ module.exports = { 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; @@ -107426,26 +95344,22 @@ module.exports = { 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) { @@ -107456,17 +95370,16 @@ module.exports = { isInLoop: isInLoop[node.type].bind(null, node), modified: false }; - } // This reference is outside of a loop condition. - + } + // 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)) { @@ -107475,68 +95388,58 @@ module.exports = { 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. + } + // Registers the conditions to belonging groups. + registerConditionsToGroup(conditions); - registerConditionsToGroup(conditions); // Check the conditions are modified. - + // 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()]; + "Program:exit"(node) { + const queue = [sourceCode.getScope(node)]; groupMap = new Map(); let scope; - while (scope = queue.pop()) { queue.push(...scope.childScopes); scope.variables.forEach(checkReferences); } - groupMap.forEach(checkConditionsInGroup); groupMap = null; } - }; } - }; /***/ }), -/* 855 */ +/* 865 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -107546,33 +95449,37 @@ module.exports = { */ -const astUtils = __webpack_require__(618); // Operators that always result in a boolean value +const astUtils = __webpack_require__(639); +// 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. + "!==": "===" + // Operators like < and >= are not true inverses, since both will return false with NaN. }; + const OR_PRECEDENCE = astUtils.getPrecedence({ type: "LogicalExpression", operator: "||" -}); //------------------------------------------------------------------------------ +}); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow ternary operators when simpler alternatives exist", recommended: false, - url: "https://eslint.org/docs/rules/no-unneeded-ternary" + url: "https://eslint.org/docs/latest/rules/no-unneeded-ternary" }, schema: [{ type: "object", @@ -107590,93 +95497,84 @@ module.exports = { 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(); + const sourceCode = context.sourceCode; + /** * 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. + } + // 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 => { + 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); @@ -107685,14 +95583,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 856 */ +/* 866 */ /***/ ((module) => { "use strict"; @@ -107700,7 +95596,9 @@ module.exports = { * @fileoverview Checks for unreachable code due to return, throws, break, and continue. * @author Joel Feenstra */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -107715,179 +95613,162 @@ module.exports = { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow unreachable code after `return`, `throw`, `continue`, and `break` statements", recommended: true, - url: "https://eslint.org/docs/rules/no-unreachable" + url: "https://eslint.org/docs/latest/rules/no-unreachable" }, schema: [], messages: { unreachableCode: "Unreachable code." } }, - create(context) { let currentCodePath = null; + /** @type {ConstructorInfo | null} */ - let constructorInfo = null; - /** @type {ConsecutiveRange} */ - const range = new ConsecutiveRange(context.getSourceCode()); + /** @type {ConsecutiveRange} */ + const range = new ConsecutiveRange(context.sourceCode); + /** * 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 && (node.type === "PropertyDefinition" || 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. - + } + // 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. - + } + // 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. - + } + // 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, @@ -107906,23 +95787,19 @@ module.exports = { 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(); }, - /* * Instance fields defined in a subclass are never created if the constructor of the subclass * doesn't call `super()`, so their definitions are unreachable code. @@ -107933,19 +95810,17 @@ module.exports = { hasSuperCall: false }; }, - "MethodDefinition[kind='constructor']:exit"(node) { const { hasSuperCall } = constructorInfo; - constructorInfo = constructorInfo.upper; // skip typescript constructors without the body + constructorInfo = constructorInfo.upper; + // skip typescript constructors without the body if (!node.value.body) { return; } - const classDefinition = node.parent.parent; - if (classDefinition.superClass && !hasSuperCall) { for (const element of classDefinition.body.body) { if (element.type === "PropertyDefinition" && !element.static) { @@ -107954,20 +95829,17 @@ module.exports = { } } }, - "CallExpression > Super.callee"() { if (constructorInfo) { constructorInfo.hasSuperCall = true; } } - }; } - }; /***/ }), -/* 857 */ +/* 867 */ /***/ ((module) => { "use strict"; @@ -107975,65 +95847,63 @@ module.exports = { * @fileoverview Rule to disallow loops with a body that allows only one iteration * @author Milos Djermanovic */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // 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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow loops with a body that allows only one iteration", recommended: false, - url: "https://eslint.org/docs/rules/no-unreachable-loop" + url: "https://eslint.org/docs/latest/rules/no-unreachable-loop" }, schema: [{ type: "object", @@ -108052,23 +95922,20 @@ module.exports = { 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(); + 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. @@ -108078,16 +95945,15 @@ module.exports = { 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 @@ -108098,27 +95964,23 @@ module.exports = { * * 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" })); } - }; } - }; /***/ }), -/* 858 */ +/* 868 */ /***/ ((module) => { "use strict"; @@ -108126,32 +95988,34 @@ module.exports = { * @fileoverview Rule to flag unsafe statements in finally block * @author Onur Temizkan */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // 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; //------------------------------------------------------------------------------ +const SENTINEL_NODE_TYPE_CONTINUE = /^(?:Program|(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|DoWhileStatement|WhileStatement|ForOfStatement|ForInStatement|ForStatement)$/u; + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow control flow statements in `finally` blocks", recommended: true, - url: "https://eslint.org/docs/rules/no-unsafe-finally" + url: "https://eslint.org/docs/latest/rules/no-unsafe-finally" }, schema: [], messages: { unsafeUsage: "Unsafe usage of {{nodeType}}." } }, - create(context) { /** * Checks if the node is the finalizer of a TryStatement @@ -108161,18 +96025,16 @@ module.exports = { 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") { @@ -108180,30 +96042,25 @@ module.exports = { } 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({ @@ -108217,7 +96074,6 @@ module.exports = { }); } } - return { ReturnStatement: check, ThrowStatement: check, @@ -108225,11 +96081,10 @@ module.exports = { ContinueStatement: check }; } - }; /***/ }), -/* 859 */ +/* 869 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -108237,11 +96092,15 @@ module.exports = { * @fileoverview Rule to disallow negating the left operand of relational operators * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -108250,44 +96109,40 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow negating the left operand of relational operators", recommended: true, - url: "https://eslint.org/docs/rules/no-unsafe-negation" + url: "https://eslint.org/docs/latest/rules/no-unsafe-negation" }, hasSuggestions: true, schema: [{ @@ -108307,16 +96162,14 @@ module.exports = { suggestParenthesisedNegation: "Wrap negation in '()' to make the intention explicit. This preserves the current behavior." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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, @@ -108330,33 +96183,27 @@ module.exports = { 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)})`); } - }] }); } } - }; } - }; /***/ }), -/* 860 */ +/* 870 */ /***/ ((module) => { "use strict"; @@ -108366,28 +96213,28 @@ module.exports = { */ + const UNSAFE_ARITHMETIC_OPERATORS = new Set(["+", "-", "/", "*", "%", "**"]); const UNSAFE_ASSIGNMENT_OPERATORS = new Set(["+=", "-=", "/=", "*=", "%=", "**="]); const UNSAFE_RELATIONAL_OPERATORS = new Set(["in", "instanceof"]); + /** * Checks whether a node is a destructuring pattern or not * @param {ASTNode} node node to check * @returns {boolean} `true` if a node is a destructuring pattern, otherwise `false` */ - function isDestructuringPattern(node) { return node.type === "ObjectPattern" || node.type === "ArrayPattern"; } + /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow use of optional chaining in contexts where the `undefined` value is not allowed", recommended: true, - url: "https://eslint.org/docs/rules/no-unsafe-optional-chaining" + url: "https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining" }, schema: [{ type: "object", @@ -108405,48 +96252,44 @@ module.exports = { unsafeArithmetic: "Unsafe arithmetic operation on optional chaining. It can result in NaN." } }, - create(context) { const options = context.options[0] || {}; const disallowArithmeticOperators = options.disallowArithmeticOperators || false; + /** * Reports unsafe usage of optional chaining * @param {ASTNode} node node to report * @returns {void} */ - function reportUnsafeUsage(node) { context.report({ messageId: "unsafeOptionalChain", node }); } + /** * Reports unsafe arithmetic operation on optional chaining * @param {ASTNode} node node to report * @returns {void} */ - - function reportUnsafeArithmetic(node) { context.report({ messageId: "unsafeArithmetic", node }); } + /** * Checks and reports if a node can short-circuit with `undefined` by optional chaining. * @param {ASTNode} [node] node to check * @param {Function} reportFunc report function * @returns {void} */ - - function checkUndefinedShortCircuit(node, reportFunc) { if (!node) { return; } - switch (node.type) { case "LogicalExpression": if (node.operator === "||" || node.operator === "??") { @@ -108455,132 +96298,108 @@ module.exports = { checkUndefinedShortCircuit(node.left, reportFunc); checkUndefinedShortCircuit(node.right, reportFunc); } - break; - case "SequenceExpression": checkUndefinedShortCircuit(node.expressions[node.expressions.length - 1], reportFunc); break; - case "ConditionalExpression": checkUndefinedShortCircuit(node.consequent, reportFunc); checkUndefinedShortCircuit(node.alternate, reportFunc); break; - case "AwaitExpression": checkUndefinedShortCircuit(node.argument, reportFunc); break; - case "ChainExpression": reportFunc(node); break; - default: break; } } + /** * Checks unsafe usage of optional chaining * @param {ASTNode} node node to check * @returns {void} */ - - function checkUnsafeUsage(node) { checkUndefinedShortCircuit(node, reportUnsafeUsage); } + /** * Checks unsafe arithmetic operations on optional chaining * @param {ASTNode} node node to check * @returns {void} */ - - function checkUnsafeArithmetic(node) { checkUndefinedShortCircuit(node, reportUnsafeArithmetic); } - return { "AssignmentExpression, AssignmentPattern"(node) { if (isDestructuringPattern(node.left)) { checkUnsafeUsage(node.right); } }, - "ClassDeclaration, ClassExpression"(node) { checkUnsafeUsage(node.superClass); }, - CallExpression(node) { if (!node.optional) { checkUnsafeUsage(node.callee); } }, - NewExpression(node) { checkUnsafeUsage(node.callee); }, - VariableDeclarator(node) { if (isDestructuringPattern(node.id)) { checkUnsafeUsage(node.init); } }, - MemberExpression(node) { if (!node.optional) { checkUnsafeUsage(node.object); } }, - TaggedTemplateExpression(node) { checkUnsafeUsage(node.tag); }, - ForOfStatement(node) { checkUnsafeUsage(node.right); }, - SpreadElement(node) { if (node.parent && node.parent.type !== "ObjectExpression") { checkUnsafeUsage(node.argument); } }, - BinaryExpression(node) { if (UNSAFE_RELATIONAL_OPERATORS.has(node.operator)) { checkUnsafeUsage(node.right); } - if (disallowArithmeticOperators && UNSAFE_ARITHMETIC_OPERATORS.has(node.operator)) { checkUnsafeArithmetic(node.right); checkUnsafeArithmetic(node.left); } }, - WithStatement(node) { checkUnsafeUsage(node.object); }, - UnaryExpression(node) { if (disallowArithmeticOperators && UNSAFE_ARITHMETIC_OPERATORS.has(node.operator)) { checkUnsafeArithmetic(node.argument); } }, - AssignmentExpression(node) { if (disallowArithmeticOperators && UNSAFE_ASSIGNMENT_OPERATORS.has(node.operator)) { checkUnsafeArithmetic(node.right); } } - }; } - }; /***/ }), -/* 861 */ +/* 871 */ /***/ ((module) => { "use strict"; @@ -108588,7 +96407,9 @@ module.exports = { * @fileoverview Flag expressions in statement position that do not side effect * @author Michael Ficarra */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -108596,29 +96417,26 @@ module.exports = { * Returns `true`. * @returns {boolean} `true`. */ - function alwaysTrue() { return true; } + /** * Returns `false`. * @returns {boolean} `false`. */ - - function alwaysFalse() { return false; } + /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow unused expressions", recommended: false, - url: "https://eslint.org/docs/rules/no-unused-expressions" + url: "https://eslint.org/docs/latest/rules/no-unused-expressions" }, schema: [{ type: "object", @@ -108646,153 +96464,128 @@ module.exports = { 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, - enforceForJSX = config.enforceForJSX || false; + allowShortCircuit = config.allowShortCircuit || false, + allowTernary = config.allowTernary || false, + allowTaggedTemplates = config.allowTaggedTemplates || false, + enforceForJSX = config.enforceForJSX || false; + /** * Has AST suggesting a directive. * @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"; } + /** * Gets the leading sequence of members in a list that pass the predicate. * @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(); } + /** * Gets leading directives nodes in a Node body. * @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); } + /** * Detect if a Node is a directive. * @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) { + const parent = node.parent, + grandparent = parent.parent; - - function isDirective(node, ancestors) { - const parent = ancestors[ancestors.length - 1], - grandparent = ancestors[ancestors.length - 2]; /** * https://tc39.es/ecma262/#directive-prologue * * Only `FunctionBody`, `ScriptBody` and `ModuleBody` can have directive prologue. * Class static blocks do not have directive prologue. */ - return (parent.type === "Program" || parent.type === "BlockStatement" && /Function/u.test(grandparent.type)) && directives(parent).includes(node); } + /** * 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, - JSXElement() { return enforceForJSX; }, - JSXFragment() { return enforceForJSX; }, - 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())) { + if (Checker.isDisallowed(node.expression) && !isDirective(node)) { context.report({ node, messageId: "unusedExpression" }); } } - }; } - }; /***/ }), -/* 862 */ +/* 872 */ /***/ ((module) => { "use strict"; @@ -108800,19 +96593,21 @@ module.exports = { * @fileoverview Rule to disallow unused labels. * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow unused labels", recommended: true, - url: "https://eslint.org/docs/rules/no-unused-labels" + url: "https://eslint.org/docs/latest/rules/no-unused-labels" }, schema: [], fixable: "code", @@ -108820,16 +96615,15 @@ module.exports = { unused: "'{{name}}:' is defined but never used." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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, @@ -108837,21 +96631,19 @@ module.exports = { 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 @@ -108864,41 +96656,33 @@ module.exports = { })) { 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, @@ -108906,11 +96690,10 @@ module.exports = { ContinueStatement: markAsUsed }; } - }; /***/ }), -/* 863 */ +/* 873 */ /***/ ((module) => { "use strict"; @@ -108918,49 +96701,49 @@ module.exports = { * @fileoverview Rule to flag declared but unused private class members * @author Tim van der Lippe */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Disallow unused private class members", recommended: false, - url: "https://eslint.org/docs/rules/no-unused-private-class-members" + url: "https://eslint.org/docs/latest/rules/no-unused-private-class-members" }, schema: [], messages: { unusedPrivateClassMember: "'{{classMemberName}}' is defined but never used." } }, - create(context) { const trackedClasses = []; + /** * Check whether the current node is in a write only assignment. * @param {ASTNode} privateIdentifierNode Node referring to a private identifier * @returns {boolean} Whether the node is in a write only assignment * @private */ - function isWriteOnlyAssignment(privateIdentifierNode) { const parentStatement = privateIdentifierNode.parent.parent; const isAssignmentExpression = parentStatement.type === "AssignmentExpression"; - if (!isAssignmentExpression && parentStatement.type !== "ForInStatement" && parentStatement.type !== "ForOfStatement" && parentStatement.type !== "AssignmentPattern") { return false; - } // It is a write-only usage, since we still allow usages on the right for reads - + } + // It is a write-only usage, since we still allow usages on the right for reads if (parentStatement.left !== privateIdentifierNode.parent) { return false; - } // For any other operator (such as '+=') we still consider it a read operation - + } + // For any other operator (such as '+=') we still consider it a read operation if (isAssignmentExpression && parentStatement.operator !== "=") { /* * However, if the read operation is "discarded" in an empty statement, then @@ -108968,19 +96751,18 @@ module.exports = { */ return parentStatement.parent.type === "ExpressionStatement"; } - return true; - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- - return { // Collect all declared members up front and assume they are all unused ClassBody(classBodyNode) { const privateMembers = new Map(); trackedClasses.unshift(privateMembers); - for (const bodyMember of classBodyNode.body) { if (bodyMember.type === "PropertyDefinition" || bodyMember.type === "MethodDefinition") { if (bodyMember.key.type === "PrivateIdentifier") { @@ -108992,83 +96774,78 @@ module.exports = { } } }, - /* * Process all usages of the private identifier and remove a member from * `declaredAndUnusedPrivateMembers` if we deem it used. */ PrivateIdentifier(privateIdentifierNode) { - const classBody = trackedClasses.find(classProperties => classProperties.has(privateIdentifierNode.name)); // Can't happen, as it is a parser to have a missing class body, but let's code defensively here. + const classBody = trackedClasses.find(classProperties => classProperties.has(privateIdentifierNode.name)); + // Can't happen, as it is a parser to have a missing class body, but let's code defensively here. if (!classBody) { return; - } // In case any other usage was already detected, we can short circuit the logic here. - + } + // In case any other usage was already detected, we can short circuit the logic here. const memberDefinition = classBody.get(privateIdentifierNode.name); - if (memberDefinition.isUsed) { return; - } // The definition of the class member itself - + } + // The definition of the class member itself if (privateIdentifierNode.parent.type === "PropertyDefinition" || privateIdentifierNode.parent.type === "MethodDefinition") { return; } + /* * Any usage of an accessor is considered a read, as the getter/setter can have * side-effects in its definition. */ - - if (memberDefinition.isAccessor) { memberDefinition.isUsed = true; return; - } // Any assignments to this member, except for assignments that also read - + } + // Any assignments to this member, except for assignments that also read if (isWriteOnlyAssignment(privateIdentifierNode)) { return; } - const wrappingExpressionType = privateIdentifierNode.parent.parent.type; - const parentOfWrappingExpressionType = privateIdentifierNode.parent.parent.parent.type; // A statement which only increments (`this.#x++;`) + const parentOfWrappingExpressionType = privateIdentifierNode.parent.parent.parent.type; + // A statement which only increments (`this.#x++;`) if (wrappingExpressionType === "UpdateExpression" && parentOfWrappingExpressionType === "ExpressionStatement") { return; } + /* * ({ x: this.#usedInDestructuring } = bar); * * But should treat the following as a read: * ({ [this.#x]: a } = foo); */ - - if (wrappingExpressionType === "Property" && parentOfWrappingExpressionType === "ObjectPattern" && privateIdentifierNode.parent.parent.value === privateIdentifierNode.parent) { return; - } // [...this.#unusedInRestPattern] = bar; - + } + // [...this.#unusedInRestPattern] = bar; if (wrappingExpressionType === "RestElement") { return; - } // [this.#unusedInAssignmentPattern] = bar; - + } + // [this.#unusedInAssignmentPattern] = bar; if (wrappingExpressionType === "ArrayPattern") { return; } + /* * We can't delete the memberDefinition, as we need to keep track of which member we are marking as used. * In the case of nested classes, we only mark the first member we encounter as used. If you were to delete * the member, then any subsequent usage could incorrectly mark the member of an encapsulating parent class * as used, which is incorrect. */ - - memberDefinition.isUsed = true; }, - /* * Post-process the class members and report any remaining members. * Since private members can only be accessed in the current class context, @@ -109076,7 +96853,6 @@ module.exports = { */ "ClassBody:exit"() { const unusedPrivateMembers = trackedClasses.shift(); - for (const [classMemberName, { declaredNode, isUsed @@ -109084,7 +96860,6 @@ module.exports = { if (isUsed) { continue; } - context.report({ node: declaredNode, loc: declaredNode.key.loc, @@ -109095,14 +96870,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 864 */ +/* 874 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -109110,11 +96883,15 @@ module.exports = { * @fileoverview Rule to flag declared but unused variables * @author Ilya Volodin */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Typedefs //------------------------------------------------------------------------------ @@ -109125,20 +96902,19 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow unused variables", recommended: true, - url: "https://eslint.org/docs/rules/no-unused-vars" + url: "https://eslint.org/docs/latest/rules/no-unused-vars" }, schema: [{ oneOf: [{ @@ -109178,9 +96954,8 @@ module.exports = { unusedVar: "'{{varName}}' is {{action}} but never used{{additional}}." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const REST_PROPERTY_TYPE = /^(?:RestElement|(?:Experimental)?RestProperty)$/u; const config = { vars: "all", @@ -109189,7 +96964,6 @@ module.exports = { caughtErrors: "none" }; const firstOption = context.options[0]; - if (firstOption) { if (typeof firstOption === "string") { config.vars = firstOption; @@ -109198,37 +96972,31 @@ module.exports = { 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"); } - if (firstOption.destructuredArrayIgnorePattern) { config.destructuredArrayIgnorePattern = new RegExp(firstOption.destructuredArrayIgnorePattern, "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(); @@ -109239,7 +97007,6 @@ module.exports = { type = "vars"; pattern = config.varsIgnorePattern.toString(); } - const additional = type ? `. Allowed unused ${type} must match ${pattern}` : ""; return { varName: unusedVar.name, @@ -109247,97 +97014,88 @@ module.exports = { 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 def = unusedVar.defs[0]; let additional = ""; - if (config.destructuredArrayIgnorePattern && def && def.name.parent.type === "ArrayPattern") { additional = `. Allowed unused elements of array destructuring patterns must match ${config.destructuredArrayIgnorePattern.toString()}`; } else if (config.varsIgnorePattern) { additional = `. 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; } + /** * Checks whether a node is a sibling of the rest property or not. * @param {ASTNode} node a node to check * @returns {boolean} True if the node is a sibling of the rest property, otherwise false. */ - - function hasRestSibling(node) { return node.type === "Property" && node.parent.type === "ObjectPattern" && REST_PROPERTY_TYPE.test(node.parent.properties[node.parent.properties.length - 1].type); } + /** * 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) { const hasRestSiblingDefinition = variable.defs.some(def => hasRestSibling(def.name.parent)); const hasRestSiblingReference = variable.references.some(ref => hasRestSibling(ref.identifier.parent)); return hasRestSiblingDefinition || hasRestSiblingReference; } - 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. @@ -109345,48 +97103,44 @@ module.exports = { * @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.includes(scope.block)) { 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 + } = def; + // FunctionDeclarations if (type === "FunctionName") { functionDefinitions.push(node); - } // FunctionExpressions - + } + // 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. @@ -109394,38 +97148,31 @@ module.exports = { * @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]; } + /** * Checks whether a given node is unused expression or not. * @param {ASTNode} node The node itself * @returns {boolean} The node is an unused expression. * @private */ - - function isUnusedExpression(node) { const parent = node.parent; - if (parent.type === "ExpressionStatement") { return true; } - if (parent.type === "SequenceExpression") { const isLastExpression = parent.expressions[parent.expressions.length - 1] === node; - if (!isLastExpression) { return true; } - return isUnusedExpression(parent); } - return false; } + /** * If a given reference is left-hand side of an assignment, this gets * the right-hand side node of the assignment. @@ -109441,29 +97188,26 @@ module.exports = { * @returns {ASTNode|null} The RHS node or null. * @private */ - - function getRhsNode(ref, prevRhsNode) { const id = ref.identifier; const parent = id.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" && isUnusedExpression(parent) && 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. @@ -109475,30 +97219,23 @@ module.exports = { * - 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)) { /* @@ -109507,15 +97244,13 @@ module.exports = { */ 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. * @@ -109530,12 +97265,11 @@ module.exports = { * @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. @@ -109543,85 +97277,85 @@ module.exports = { * @returns {boolean} The reference is a read to update itself. * @private */ - - function isReadForItself(ref, rhsNode) { const id = ref.identifier; const parent = id.parent; - return ref.isRead() && ( // self update. e.g. `a += 1`, `a++` - parent.type === "AssignmentExpression" && parent.left === id && isUnusedExpression(parent) || parent.type === "UpdateExpression" && isUnusedExpression(parent) || // in RHS of an assignment for itself. e.g. `a = a + 1` + return ref.isRead() && ( + // self update. e.g. `a += 1`, `a++` + parent.type === "AssignmentExpression" && parent.left === id && isUnusedExpression(parent) || parent.type === "UpdateExpression" && isUnusedExpression(parent) || + // in RHS of an assignment for itself. e.g. `a = a + 1` + rhsNode && isInside(id, rhsNode) && !isInsideOfStorableFunction(id, rhsNode)); } + /** * Determine if an identifier is used either in for-in or for-of loops. * @param {Reference} ref The reference to check. * @returns {boolean} whether reference is used in the for-in loops * @private */ - - function isForInOfRef(ref) { - let target = ref.identifier.parent; // "for (var ...) { return; }" + let target = ref.identifier.parent; + // "for (var ...) { return; }" if (target.type === "VariableDeclarator") { target = target.parent.parent; } - if (target.type !== "ForInStatement" && target.type !== "ForOfStatement") { 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; } + // "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; + isFunctionDefinition = functionNodes.length > 0; let rhsNode = null; return variable.references.some(ref => { if (isForInOfRef(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. + const params = sourceCode.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. @@ -109629,71 +97363,68 @@ module.exports = { * @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 + 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() - + } + // skip function expression names and variables marked with markVariableAsUsed() if (scope.functionExpressionScope || variable.eslintUsed) { continue; - } // skip implicit "arguments" variable - + } + // skip implicit "arguments" variable if (scope.type === "function" && variable.name === "arguments" && variable.identifiers.length === 0) { continue; - } // explicit global variables don't have definitions. - + } + // explicit global variables don't have definitions. const def = variable.defs[0]; - if (def) { const type = def.type; - const refUsedInArrayPatterns = variable.references.some(ref => ref.identifier.parent.type === "ArrayPattern"); // skip elements of array destructuring patterns + const refUsedInArrayPatterns = variable.references.some(ref => ref.identifier.parent.type === "ArrayPattern"); + // skip elements of array destructuring patterns if ((def.name.parent.type === "ArrayPattern" || refUsedInArrayPatterns) && config.destructuredArrayIgnorePattern && config.destructuredArrayIgnorePattern.test(def.name.name)) { continue; - } // skip catch variables - + } + // skip catch variables if (type === "CatchClause") { if (config.caughtErrors === "none") { continue; - } // skip ignored parameters - + } + // 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 "args" option is "none", skip any parameter if (config.args === "none") { continue; - } // skip ignored parameters - + } + // skip ignored parameters if (config.argsIgnorePattern && config.argsIgnorePattern.test(def.name.name)) { continue; - } // if "args" option is "after-used", skip used variables - + } + // if "args" option is "after-used", skip used variables if (config.args === "after-used" && astUtils.isFunction(def.name.parent) && !isAfterLastUsedArg(variable)) { continue; } @@ -109704,44 +97435,42 @@ module.exports = { } } } - 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(), []); - + const unusedVars = collectUnusedVariables(sourceCode.getScope(programNode), []); for (let i = 0, l = unusedVars.length; i < l; ++i) { - const unusedVar = unusedVars[i]; // Report the first declaration. + const unusedVar = unusedVars[i]; + // Report the first declaration. if (unusedVar.defs.length > 0) { // report last write reference, https://github.com/eslint/eslint/issues/14324 const writeReferences = unusedVar.references.filter(ref => ref.isWrite() && ref.from.variableScope === unusedVar.scope.variableScope); let referenceToReport; - if (writeReferences.length > 0) { referenceToReport = writeReferences[writeReferences.length - 1]; } - context.report({ node: referenceToReport ? referenceToReport.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. + }); + + // If there are no regular declaration, report the first `/*globals*/` comment directive. } else if (unusedVar.eslintExplicitGlobalComments) { const directiveComment = unusedVar.eslintExplicitGlobalComments[0]; context.report({ @@ -109753,14 +97482,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 865 */ +/* 875 */ /***/ ((module) => { "use strict"; @@ -109768,24 +97495,25 @@ module.exports = { * @fileoverview Rule to flag use of variables before they are defined * @author Ilya Volodin */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // 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; let allowNamedExports = false; - if (typeof options === "string") { functions = options !== "nofunc"; } else if (typeof options === "object" && options !== null) { @@ -109794,7 +97522,6 @@ function parseOptions(options) { variables = options.variables !== false; allowNamedExports = !!options.allowNamedExports; } - return { functions, classes, @@ -109802,17 +97529,17 @@ function parseOptions(options) { allowNamedExports }; } + /** * 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 location is inside of the range of a class static initializer. * Static initializers are static blocks and initializers of static fields. @@ -109820,32 +97547,28 @@ function isInRange(node, location) { * @param {number} location A location to check. * @returns {boolean} `true` if the location is inside of a class static initializer. */ - - function isInClassStaticInitializerRange(node, location) { return node.body.some(classMember => classMember.type === "StaticBlock" && isInRange(classMember, location) || classMember.type === "PropertyDefinition" && classMember.static && classMember.value && isInRange(classMember.value, location)); } + /** - * Checks whether a given scope is the scope of a a class static initializer. + * Checks whether a given scope is the scope of a class static initializer. * Static initializers are static blocks and initializers of static fields. * @param {eslint-scope.Scope} scope A scope to check. * @returns {boolean} `true` if the scope is a class static initializer scope. */ - - function isClassStaticInitializerScope(scope) { if (scope.type === "class-static-block") { return true; } - if (scope.type === "class-field-initializer") { // `scope.block` is PropertyDefinition#value node const propertyDefinition = scope.block.parent; return propertyDefinition.static; } - return false; } + /** * Checks whether a given reference is evaluated in an execution context * that isn't the one where the variable it refers to is defined. @@ -109882,12 +97605,11 @@ function isClassStaticInitializerScope(scope) { * @param {eslint-scope.Reference} reference A reference to check. * @returns {boolean} `true` if the reference is from a separate execution context. */ - - function isFromSeparateExecutionContext(reference) { const variable = reference.resolved; - let scope = reference.from; // Scope#variableScope represents execution context + let scope = reference.from; + // Scope#variableScope represents execution context while (variable.scope.variableScope !== scope.variableScope) { if (isClassStaticInitializerScope(scope.variableScope)) { scope = scope.variableScope.upper; @@ -109895,9 +97617,9 @@ function isFromSeparateExecutionContext(reference) { return true; } } - return false; } + /** * Checks whether or not a given reference is evaluated during the initialization of its variable. * @@ -109917,8 +97639,6 @@ function isFromSeparateExecutionContext(reference) { * @param {Reference} reference A reference to check. * @returns {boolean} `true` if the reference is evaluated during the initialization. */ - - function isEvaluatedDuringInitialization(reference) { if (isFromSeparateExecutionContext(reference)) { /* @@ -109927,10 +97647,8 @@ function isEvaluatedDuringInitialization(reference) { */ return false; } - const location = reference.identifier.range[1]; const definition = reference.resolved.defs[0]; - if (definition.type === "ClassName") { // `ClassDeclaration` or `ClassExpression` const classDefinition = definition.node; @@ -109941,19 +97659,15 @@ function isEvaluatedDuringInitialization(reference) { */ !isInClassStaticInitializerRange(classDefinition.body, location); } - let node = definition.name.parent; - 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)) { @@ -109962,25 +97676,23 @@ function isEvaluatedDuringInitialization(reference) { } else if (SENTINEL_TYPE.test(node.type)) { break; } - node = node.parent; } - return false; -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow the use of variables before they are defined", recommended: false, - url: "https://eslint.org/docs/rules/no-use-before-define" + url: "https://eslint.org/docs/latest/rules/no-use-before-define" }, schema: [{ oneOf: [{ @@ -110008,9 +97720,10 @@ module.exports = { usedBeforeDefined: "'{{name}}' was used before it was defined." } }, - create(context) { const options = parseOptions(context.options[0]); + const sourceCode = context.sourceCode; + /** * Determines whether a given reference should be checked. * @@ -110023,51 +97736,41 @@ module.exports = { * @param {eslint-scope.Reference} reference The reference * @returns {boolean} `true` if the reference should be checked */ - function shouldCheck(reference) { if (reference.init) { return false; } - const { identifier } = reference; - if (options.allowNamedExports && identifier.parent.type === "ExportSpecifier" && identifier.parent.local === identifier) { return false; } - const variable = reference.resolved; - if (!variable || variable.defs.length === 0) { return false; } - const definitionType = variable.defs[0].type; - if (!options.functions && definitionType === "FunctionName") { return false; } - - if ((!options.variables && definitionType === "Variable" || !options.classes && definitionType === "ClassName") && // don't skip checking the reference if it's in the same execution context, because of TDZ + if ((!options.variables && definitionType === "Variable" || !options.classes && definitionType === "ClassName") && + // don't skip checking the reference if it's in the same execution context, because of TDZ isFromSeparateExecutionContext(reference)) { return false; } - return true; } + /** * Finds and validates all references in a given scope and its child scopes. * @param {eslint-scope.Scope} scope The scope object. * @returns {void} */ - - function checkReferencesInScope(scope) { scope.references.filter(shouldCheck).forEach(reference => { const variable = reference.resolved; const definitionIdentifier = variable.defs[0].name; - if (reference.identifier.range[1] < definitionIdentifier.range[1] || isEvaluatedDuringInitialization(reference)) { context.report({ node: reference.identifier, @@ -110078,19 +97781,16 @@ module.exports = { }); scope.childScopes.forEach(checkReferencesInScope); } - return { - Program() { - checkReferencesInScope(context.getScope()); + Program(node) { + checkReferencesInScope(sourceCode.getScope(node)); } - }; } - }; /***/ }), -/* 866 */ +/* 876 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -110098,76 +97798,74 @@ module.exports = { * @fileoverview Rule to disallow useless backreferences in regular expressions * @author Milos Djermanovic */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant -} = __webpack_require__(571); - +} = __webpack_require__(594); const { RegExpParser, visitRegExpAST -} = __webpack_require__(741); //------------------------------------------------------------------------------ +} = __webpack_require__(748); + +//------------------------------------------------------------------------------ // 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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow useless backreferences in regular expressions", recommended: true, - url: "https://eslint.org/docs/rules/no-useless-backreference" + url: "https://eslint.org/docs/latest/rules/no-useless-backreference" }, schema: [], messages: { @@ -110178,8 +97876,9 @@ module.exports = { intoNegativeLookaround: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}' which is in a negative lookaround." } }, - create(context) { + const sourceCode = context.sourceCode; + /** * 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. @@ -110189,40 +97888,34 @@ module.exports = { */ 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); + 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; - + 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"; - + 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"; @@ -110237,7 +97930,6 @@ module.exports = { messageId = "intoNegativeLookaround"; } } - if (messageId) { context.report({ node, @@ -110249,10 +97941,8 @@ module.exports = { }); } } - }); } - return { "Literal[regex]"(node) { const { @@ -110261,37 +97951,32 @@ module.exports = { } = node.regex; checkRegex(node, pattern, flags); }, - - Program() { - const scope = context.getScope(), - tracker = new ReferenceTracker(scope), - traceMap = { - RegExp: { - [CALL]: true, - [CONSTRUCT]: true - } - }; - + Program(node) { + const scope = sourceCode.getScope(node), + tracker = new ReferenceTracker(scope), + traceMap = { + RegExp: { + [CALL]: true, + [CONSTRUCT]: true + } + }; for (const { - node + node: refNode } of tracker.iterateGlobalReferences(traceMap)) { - const [patternNode, flagsNode] = node.arguments, - pattern = getStringIfConstant(patternNode, scope), - flags = getStringIfConstant(flagsNode, scope); - + const [patternNode, flagsNode] = refNode.arguments, + pattern = getStringIfConstant(patternNode, scope), + flags = getStringIfConstant(flagsNode, scope); if (typeof pattern === "string") { - checkRegex(node, pattern, flags || ""); + checkRegex(refNode, pattern, flags || ""); } } } - }; } - }; /***/ }), -/* 867 */ +/* 877 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -110301,7 +97986,10 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -110310,12 +97998,11 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @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. @@ -110323,48 +98010,42 @@ function isCallOrNonVariadicApply(node) { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow unnecessary calls to `.call()` and `.apply()`", recommended: false, - url: "https://eslint.org/docs/rules/no-useless-call" + url: "https://eslint.org/docs/latest/rules/no-useless-call" }, schema: [], messages: { unnecessaryCall: "Unnecessary '.{{name}}()'." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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, @@ -110375,14 +98056,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 868 */ +/* 878 */ /***/ ((module) => { "use strict"; @@ -110390,19 +98069,21 @@ module.exports = { * @fileoverview Reports useless `catch` clauses that just rethrow their error. * @author Teddy Katz */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow unnecessary `catch` clauses", recommended: true, - url: "https://eslint.org/docs/rules/no-useless-catch" + url: "https://eslint.org/docs/latest/rules/no-useless-catch" }, schema: [], messages: { @@ -110410,7 +98091,6 @@ module.exports = { unnecessaryCatch: "Unnecessary try/catch wrapper." } }, - create(context) { return { CatchClause(node) { @@ -110428,14 +98108,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 869 */ +/* 879 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -110443,11 +98121,14 @@ module.exports = { * @fileoverview Rule to disallow unnecessary computed property keys in object literals * @author Burak Yigit Kaya */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -110476,66 +98157,54 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @throws {Error} (Unreachable.) * @returns {void} `true` if the node has useless computed key. */ - - function hasUselessComputedKey(node) { if (!node.computed) { return false; } - const { key } = node; - if (key.type !== "Literal") { return false; } - const { value } = key; - if (typeof value !== "number" && typeof value !== "string") { return false; } - switch (node.type) { case "Property": return value !== "__proto__"; - case "PropertyDefinition": if (node.static) { return value !== "constructor" && value !== "prototype"; } - return value !== "constructor"; - case "MethodDefinition": if (node.static) { return value !== "prototype"; } - return value !== "constructor"; /* c8 ignore next */ - default: throw new Error(`Unexpected node type: ${node.type}`); } -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow unnecessary computed property keys in objects and classes", recommended: false, - url: "https://eslint.org/docs/rules/no-useless-computed-key" + url: "https://eslint.org/docs/latest/rules/no-useless-computed-key" }, schema: [{ type: "object", @@ -110552,16 +98221,15 @@ module.exports = { unnecessarilyComputedProperty: "Unnecessarily computed property [{{property}}] found." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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 (hasUselessComputedKey(node)) { const { @@ -110573,45 +98241,41 @@ module.exports = { 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. + 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); - const tokenBeforeLeftBracket = sourceCode.getTokenBefore(leftSquareBracket); // Insert a space before the key to avoid changing identifiers, e.g. ({ get[2]() {} }) to ({ get2() {} }) - + // 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); } - }); } } + /** * A no-op function to act as placeholder for checking a node when the `enforceForClassMembers` option is `false`. * @returns {void} * @private */ - - function noop() {} - return { Property: check, MethodDefinition: enforceForClassMembers ? check : noop, PropertyDefinition: enforceForClassMembers ? check : noop }; } - }; /***/ }), -/* 870 */ +/* 880 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -110619,11 +98283,14 @@ module.exports = { * @fileoverview disallow unnecessary concatenation of template strings * @author Henry Zhu */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -110632,86 +98299,75 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow unnecessary concatenation of literals or template literals", recommended: false, - url: "https://eslint.org/docs/rules/no-useless-concat" + url: "https://eslint.org/docs/latest/rules/no-useless-concat" }, schema: [], messages: { unexpectedConcat: "Unexpected string concatenation of literals." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; return { BinaryExpression(node) { // check if not concatenation if (node.operator !== "+") { return; - } // account for the `foo + "a" + "b"` case - + } + // 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({ @@ -110721,14 +98377,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 871 */ +/* 881 */ /***/ ((module) => { "use strict"; @@ -110736,7 +98390,9 @@ module.exports = { * @fileoverview Rule to flag the use of redundant constructors in classes. * @author Alberto Rodríguez */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -110745,32 +98401,30 @@ module.exports = { * @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. @@ -110778,11 +98432,10 @@ function isSpreadArguments(superArgs) { * @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. @@ -110790,22 +98443,20 @@ function isValidIdentifierPair(ctorParam, superArg) { * @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. @@ -110813,52 +98464,46 @@ function isValidPair(ctorParam, superArg) { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow unnecessary constructors", recommended: false, - url: "https://eslint.org/docs/rules/no-useless-constructor" + url: "https://eslint.org/docs/latest/rules/no-useless-constructor" }, schema: [], messages: { noUselessConstructor: "Useless constructor." } }, - create(context) { /** * Checks whether a node is a redundant constructor @@ -110869,20 +98514,17 @@ module.exports = { if (node.kind !== "constructor") { return; } + /* * Prevent crashing on parsers which do not require class constructor * to have a body, e.g. typescript and flow */ - - if (!node.value.body) { 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, @@ -110890,16 +98532,14 @@ module.exports = { }); } } - return { MethodDefinition: checkForConstructor }; } - }; /***/ }), -/* 872 */ +/* 882 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -110909,7 +98549,10 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -110919,18 +98562,16 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @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 @@ -110949,7 +98590,6 @@ const REGEX_NON_CHARCLASS_ESCAPES = union(REGEX_GENERAL_ESCAPES, new Set("^/.$*+ * ]; * */ - function parseRegExp(regExpText) { const charList = []; regExpText.split("").reduce((state, char, index) => { @@ -110959,26 +98599,22 @@ function parseRegExp(regExpText) { 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, @@ -110998,16 +98634,15 @@ function parseRegExp(regExpText) { }); return charList; } + /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow unnecessary escape characters", recommended: true, - url: "https://eslint.org/docs/rules/no-useless-escape" + url: "https://eslint.org/docs/latest/rules/no-useless-escape" }, hasSuggestions: true, messages: { @@ -111017,9 +98652,9 @@ module.exports = { }, schema: [] }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * Reports a node * @param {ASTNode} node The node to report @@ -111027,7 +98662,6 @@ module.exports = { * @param {string} character The uselessly escaped character (not including the backslash) * @returns {void} */ - function report(node, startOffset, character) { const rangeStart = node.range[0] + startOffset; const range = [rangeStart, rangeStart + 1]; @@ -111047,21 +98681,18 @@ module.exports = { }, 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 @@ -111069,17 +98700,13 @@ module.exports = { * @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] !== "{"; @@ -111094,26 +98721,22 @@ module.exports = { } else { isQuoteEscape = escapedChar === node.raw[0]; } - if (isUnnecessaryEscape && !isQuoteEscape) { report(node, match.index, 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/. @@ -111122,46 +98745,48 @@ module.exports = { if (node.parent.type === "JSXAttribute" || node.parent.type === "JSXElement" || node.parent.type === "JSXFragment") { return; } - const value = isTemplateElement ? sourceCode.getText(node) : node.raw; 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)) + */.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. + */.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 }; } - }; /***/ }), -/* 873 */ +/* 883 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -111169,24 +98794,26 @@ module.exports = { * @fileoverview Disallow renaming import, export, and destructured assignments to the same name. * @author Kai Cataldo */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow renaming import, export, and destructured assignments to the same name", recommended: false, - url: "https://eslint.org/docs/rules/no-useless-rename" + url: "https://eslint.org/docs/latest/rules/no-useless-rename" }, fixable: "code", schema: [{ @@ -111211,13 +98838,14 @@ module.exports = { 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; //-------------------------------------------------------------------------- + const sourceCode = context.sourceCode, + options = context.options[0] || {}, + ignoreDestructuring = options.ignoreDestructuring === true, + ignoreImport = options.ignoreImport === true, + ignoreExport = options.ignoreExport === true; + + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -111228,7 +98856,6 @@ module.exports = { * @param {string} type the type of the offending node * @returns {void} */ - function reportError(node, initial, type) { const name = initial.type === "Identifier" ? initial.name : initial.value; return context.report({ @@ -111238,36 +98865,30 @@ module.exports = { name, type }, - fix(fixer) { const replacementNode = node.type === "Property" ? node.value : node.local; - if (sourceCode.getCommentsInside(node).length > sourceCode.getCommentsInside(replacementNode).length) { return null; - } // Don't autofix code such as `({foo: (foo) = a} = obj);`, parens are not allowed in shorthand properties. - - - if (replacementNode.type === "AssignmentPattern" && astUtils.isParenthesised(sourceCode, replacementNode.left)) { - return null; } + // Don't autofix code such as `({foo: (foo) = a} = obj);`, parens are not allowed in shorthand properties. + if (replacementNode.type === "AssignmentPattern" && astUtils.isParenthesised(sourceCode, replacementNode.left)) { + return null; + } return fixer.replaceText(node, sourceCode.getText(replacementNode)); } - }); } + /** * 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) { /** * Properties using shorthand syntax and rest elements can not be renamed. @@ -111276,62 +98897,56 @@ module.exports = { if (property.type !== "Property" || property.shorthand || 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, "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.range[0] !== node.local.range[0] && astUtils.getModuleExportName(node.imported) === node.local.name) { reportError(node, node.imported, "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.range[0] !== node.exported.range[0] && astUtils.getModuleExportName(node.local) === astUtils.getModuleExportName(node.exported)) { reportError(node, node.local, "Export"); } - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- - return { ObjectPattern: checkDestructured, ImportSpecifier: checkImport, ExportSpecifier: checkExport }; } - }; /***/ }), -/* 874 */ +/* 884 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -111339,12 +98954,15 @@ module.exports = { * @fileoverview Disallow redundant return statements * @author Teddy Katz */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639), + FixTracker = __webpack_require__(759); -const astUtils = __webpack_require__(618), - FixTracker = __webpack_require__(752); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -111354,54 +98972,48 @@ const astUtils = __webpack_require__(618), * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow redundant return statements", recommended: false, - url: "https://eslint.org/docs/rules/no-useless-return" + url: "https://eslint.org/docs/latest/rules/no-useless-return" }, fixable: "code", schema: [], @@ -111409,22 +99021,22 @@ module.exports = { unnecessaryReturn: "Unnecessary return statement." } }, - create(context) { const segmentInfoMap = new WeakMap(); const usedUnreachableSegments = new WeakSet(); - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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. * @@ -111443,26 +99055,21 @@ module.exports = { * @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. @@ -111480,23 +99087,19 @@ module.exports = { * @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. @@ -111509,17 +99112,16 @@ module.exports = { * - BreakStatements go the next merely. * @returns {void} */ - - function markReturnStatementsOnCurrentSegmentsAsUsed() { scopeInfo.codePath.currentSegments.forEach(markReturnStatementsOnSegmentAsUsed); - } //---------------------------------------------------------------------- + } + + //---------------------------------------------------------------------- // Public //---------------------------------------------------------------------- - return { - // Makes and pushs a new scope information. + // Makes and pushes a new scope information. onCodePathStart(codePath) { scopeInfo = { upper: scopeInfo, @@ -111527,7 +99129,6 @@ module.exports = { codePath }; }, - // Reports useless return statements if exist. onCodePathEnd() { for (const node of scopeInfo.uselessReturns) { @@ -111535,7 +99136,6 @@ module.exports = { node, loc: node.loc, messageId: "unnecessaryReturn", - fix(fixer) { if (isRemovable(node) && !sourceCode.getCommentsInside(node).length) { /* @@ -111546,16 +99146,12 @@ module.exports = { */ 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. @@ -111564,34 +99160,30 @@ module.exports = { const info = { uselessReturns: getUselessReturns([], segment.allPrevSegments), returned: false - }; // Stores the info. + }; + // 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). + 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. @@ -111619,11 +99211,10 @@ module.exports = { ExportAllDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed }; } - }; /***/ }), -/* 875 */ +/* 885 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -111631,11 +99222,15 @@ module.exports = { * @fileoverview Rule to check for the usage of var. * @author Jamund Ferguson */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -111644,11 +99239,10 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @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. @@ -111656,52 +99250,45 @@ function isGlobal(variable) { * @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 @@ -111710,36 +99297,32 @@ const SCOPE_NODE_TYPE = /^(?:Program|BlockStatement|SwitchStatement|ForStatement * `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; } } + /* c8 ignore next */ - - 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. @@ -111752,11 +99335,11 @@ function isUsedFromOutsideOf(scopeNode) { 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. * @@ -111769,8 +99352,6 @@ function isUsedFromOutsideOf(scopeNode) { * @returns {Function} The predicate function. * @private */ - - function hasReferenceInTDZ(node) { const initStart = node.range[0]; const initEnd = node.range[1]; @@ -111783,34 +99364,33 @@ function hasReferenceInTDZ(node) { 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); + return !reference.init && (start < idStart || defaultValue !== null && start >= defaultStart && end <= defaultEnd || !astUtils.isFunction(node) && 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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Require `let` or `const` instead of `var`", recommended: false, - url: "https://eslint.org/docs/rules/no-var" + url: "https://eslint.org/docs/latest/rules/no-var" }, schema: [], fixable: "code", @@ -111818,23 +99398,22 @@ module.exports = { unexpectedVar: "Unexpected var, use let or const instead." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * 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); + const variables = sourceCode.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: @@ -111887,69 +99466,56 @@ module.exports = { * @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 variables = sourceCode.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); } } - }; } - }; /***/ }), -/* 876 */ +/* 886 */ /***/ ((module) => { "use strict"; @@ -111957,19 +99523,20 @@ module.exports = { * @fileoverview Rule to disallow use of void operator. * @author Mike Sidorov */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow `void` operators", recommended: false, - url: "https://eslint.org/docs/rules/no-void" + url: "https://eslint.org/docs/latest/rules/no-void" }, messages: { noVoid: "Expected 'undefined' and instead saw 'void'." @@ -111985,9 +99552,10 @@ module.exports = { additionalProperties: false }] }, - create(context) { - const allowAsStatement = context.options[0] && context.options[0].allowAsStatement; //-------------------------------------------------------------------------- + const allowAsStatement = context.options[0] && context.options[0].allowAsStatement; + + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- @@ -111996,20 +99564,17 @@ module.exports = { if (allowAsStatement && node.parent && node.parent.type === "ExpressionStatement") { return; } - context.report({ node, messageId: "noVoid" }); } - }; } - }; /***/ }), -/* 877 */ +/* 887 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -112019,23 +99584,23 @@ module.exports = { */ -const escapeRegExp = __webpack_require__(595); -const astUtils = __webpack_require__(618); +const escapeRegExp = __webpack_require__(616); +const astUtils = __webpack_require__(639); +const CHAR_LIMIT = 40; -const CHAR_LIMIT = 40; //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow specified warning terms in comments", recommended: false, - url: "https://eslint.org/docs/rules/no-warning-comments" + url: "https://eslint.org/docs/latest/rules/no-warning-comments" }, schema: [{ type: "object", @@ -112065,14 +99630,14 @@ module.exports = { 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", - decoration = [...(configuration.decoration || [])].join(""), - selfConfigRegEx = /\bno-warning-comments\b/u; + const sourceCode = context.sourceCode, + configuration = context.options[0] || {}, + warningTerms = configuration.terms || ["todo", "fixme", "xxx"], + location = configuration.location || "start", + decoration = [...(configuration.decoration || [])].join(""), + 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 @@ -112080,10 +99645,10 @@ module.exports = { * @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 escapedDecoration = escapeRegExp(decoration); + /* * When matching at the start, ignore leading whitespace, and * there's no need to worry about word boundaries. @@ -112104,16 +99669,13 @@ module.exports = { * handles optional leading spaces or decoration characters (for "start" location only) * e.g. terms ["TODO"] matches `/**** TODO something ... ` */ - const wordBoundary = "\\b"; let prefix = ""; - if (location === "start") { prefix = `^[\\s${escapedDecoration}]*`; } else if (/^\w/u.test(term)) { prefix = wordBoundary; } - const suffix = /\w$/u.test(term) ? wordBoundary : ""; const flags = "iu"; // Case-insensitive with Unicode case folding. @@ -112129,17 +99691,15 @@ module.exports = { * * If it starts or ends with non-word character, the prefix and suffix are empty, respectively. */ - return new RegExp(`${prefix}${escaped}${suffix}`, flags); } - 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) => { @@ -112149,28 +99709,23 @@ module.exports = { }); 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 { @@ -112178,7 +99733,6 @@ module.exports = { break; } } - context.report({ node, messageId: "unexpectedComment", @@ -112189,20 +99743,17 @@ module.exports = { }); }); } - return { Program() { const comments = sourceCode.getAllComments(); comments.filter(token => token.type !== "Shebang").forEach(checkComment); } - }; } - }; /***/ }), -/* 878 */ +/* 888 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -112210,24 +99761,25 @@ module.exports = { * @fileoverview Rule to disallow whitespace before properties * @author Kai Cataldo */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Disallow whitespace before properties", recommended: false, - url: "https://eslint.org/docs/rules/no-whitespace-before-property" + url: "https://eslint.org/docs/latest/rules/no-whitespace-before-property" }, fixable: "whitespace", schema: [], @@ -112235,9 +99787,10 @@ module.exports = { unexpectedWhitespace: "Unexpected whitespace before property {{propName}}." } }, - create(context) { - const sourceCode = context.getSourceCode(); //-------------------------------------------------------------------------- + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -112249,7 +99802,6 @@ module.exports = { * @returns {void} * @private */ - function reportError(node, leftToken, rightToken) { context.report({ node, @@ -112257,47 +99809,41 @@ module.exports = { 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. - + } + // 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); @@ -112305,19 +99851,16 @@ module.exports = { rightToken = sourceCode.getFirstToken(node.property); leftToken = sourceCode.getTokenBefore(rightToken, 1); } - if (sourceCode.isSpaceBetweenTokens(leftToken, rightToken)) { reportError(node, leftToken, rightToken); } } - }; } - }; /***/ }), -/* 879 */ +/* 889 */ /***/ ((module) => { "use strict"; @@ -112325,26 +99868,27 @@ module.exports = { * @fileoverview Rule to flag use of with statement * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow `with` statements", recommended: true, - url: "https://eslint.org/docs/rules/no-with" + url: "https://eslint.org/docs/latest/rules/no-with" }, schema: [], messages: { unexpectedWith: "Unexpected use of 'with' statement." } }, - create(context) { return { WithStatement(node) { @@ -112353,14 +99897,12 @@ module.exports = { messageId: "unexpectedWith" }); } - }; } - }; /***/ }), -/* 880 */ +/* 890 */ /***/ ((module) => { "use strict"; @@ -112368,22 +99910,23 @@ module.exports = { * @fileoverview enforce the location of single-line statements * @author Teddy Katz */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ - const POSITION_SCHEMA = { enum: ["beside", "below", "any"] }; -/** @type {import('../shared/types').Rule} */ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { description: "Enforce the location of single-line statements", recommended: false, - url: "https://eslint.org/docs/rules/nonblock-statement-body-position" + url: "https://eslint.org/docs/latest/rules/nonblock-statement-body-position" }, fixable: "whitespace", schema: [POSITION_SCHEMA, { @@ -112406,9 +99949,10 @@ module.exports = { expectLinebreak: "Expected a linebreak before this statement." } }, - create(context) { - const sourceCode = context.getSourceCode(); //---------------------------------------------------------------------- + const sourceCode = context.sourceCode; + + //---------------------------------------------------------------------- // Helpers //---------------------------------------------------------------------- @@ -112417,27 +99961,22 @@ module.exports = { * @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, @@ -112448,31 +99987,29 @@ module.exports = { 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. + 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"), @@ -112480,11 +100017,10 @@ module.exports = { ForOfStatement: node => validateStatement(node.body, "for") }; } - }; /***/ }), -/* 881 */ +/* 891 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -112492,16 +100028,19 @@ module.exports = { * @fileoverview Rule to require or disallow line breaks inside braces. * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ + // Schema objects. - - const OPTION_VALUE = { oneOf: [{ enum: ["always", "never"] @@ -112523,17 +100062,16 @@ const OPTION_VALUE = { 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; @@ -112547,33 +100085,31 @@ function normalizeOptionValue(value) { } else { consistent = true; } - return { multiline, minProperties, consistent }; } + /** * Checks if a value is an object. * @param {any} value The value to check * @returns {boolean} `true` if the value is an object, otherwise `false` */ - - function isObject(value) { return typeof value === "object" && value !== null; } + /** * Checks if an option is a node-specific option * @param {any} option The option to check * @returns {boolean} `true` if the option is node-specific, otherwise `false` */ - - function isNodeSpecificOption(option) { return isObject(option) || typeof option === "string"; } + /** * Normalizes a given option value. * @param {string|Object|undefined} options An option value to parse. @@ -112584,8 +100120,6 @@ function isNodeSpecificOption(option) { * ExportNamedDeclaration : {multiline: boolean, minProperties: number, consistent: boolean} * }} Normalized option object. */ - - function normalizeOptions(options) { if (isObject(options) && Object.values(options).some(isNodeSpecificOption)) { return { @@ -112595,7 +100129,6 @@ function normalizeOptions(options) { ExportNamedDeclaration: normalizeOptionValue(options.ExportDeclaration) }; } - const value = normalizeOptionValue(options); return { ObjectExpression: value, @@ -112604,6 +100137,7 @@ function normalizeOptions(options) { ExportNamedDeclaration: value }; } + /** * Determines if ObjectExpression, ObjectPattern, ImportDeclaration or ExportNamedDeclaration * node needs to be checked for missing line breaks @@ -112613,33 +100147,29 @@ function normalizeOptions(options) { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent line breaks after opening and before closing braces", recommended: false, - url: "https://eslint.org/docs/rules/object-curly-newline" + url: "https://eslint.org/docs/latest/rules/object-curly-newline" }, fixable: "whitespace", schema: [{ @@ -112662,32 +100192,27 @@ module.exports = { expectedLinebreakAfterOpeningBrace: "Expected a line break after this opening brace." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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 }); @@ -112697,6 +100222,7 @@ module.exports = { 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. @@ -112705,85 +100231,67 @@ module.exports = { * 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, @@ -112791,11 +100299,10 @@ module.exports = { ExportNamedDeclaration: check }; } - }; /***/ }), -/* 882 */ +/* 892 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -112805,20 +100312,20 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent spacing inside braces", recommended: false, - url: "https://eslint.org/docs/rules/object-curly-spacing" + url: "https://eslint.org/docs/latest/rules/object-curly-spacing" }, fixable: "whitespace", schema: [{ @@ -112842,10 +100349,10 @@ module.exports = { unexpectedSpaceAfter: "There should be no space after '{{token}}'." } }, - create(context) { const spaced = context.options[0] === "always", - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; + /** * Determines whether an option is set, relative to the spacing option. * If spaced is "always", then check whether option is set to false. @@ -112853,16 +100360,16 @@ module.exports = { * @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 //-------------------------------------------------------------------------- @@ -112872,9 +100379,8 @@ module.exports = { * @param {Token} token The token to use for the report. * @returns {void} */ - function reportNoBeginningSpace(node, token) { - const nextToken = context.getSourceCode().getTokenAfter(token, { + const nextToken = context.sourceCode.getTokenAfter(token, { includeComments: true }); context.report({ @@ -112887,23 +100393,20 @@ module.exports = { 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, { + const previousToken = context.sourceCode.getTokenBefore(token, { includeComments: true }); context.report({ @@ -112916,21 +100419,18 @@ module.exports = { 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, @@ -112939,21 +100439,18 @@ module.exports = { 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, @@ -112962,13 +100459,12 @@ module.exports = { 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. @@ -112978,36 +100474,30 @@ module.exports = { * @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. * @@ -113019,95 +100509,85 @@ module.exports = { * 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 - }); + 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 - }); + 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 - }); + 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, @@ -113119,11 +100599,10 @@ module.exports = { ExportNamedDeclaration: checkForExport }; } - }; /***/ }), -/* 883 */ +/* 893 */ /***/ ((module) => { "use strict"; @@ -113131,19 +100610,21 @@ module.exports = { * @fileoverview Rule to enforce placing object properties on separate lines. * @author Vitor Balocco */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "layout", docs: { description: "Enforce placing object properties on separate lines", recommended: false, - url: "https://eslint.org/docs/rules/object-property-newline" + url: "https://eslint.org/docs/latest/rules/object-property-newline" }, schema: [{ type: "object", @@ -113166,60 +100647,51 @@ module.exports = { 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 allowSameLine = context.options[0] && (context.options[0].allowAllPropertiesOnSameLine || context.options[0].allowMultiplePropertiesPerLine /* Deprecated */); + const messageId = allowSameLine ? "propertiesOnNewlineAll" : "propertiesOnNewline"; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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. + 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"); } - }); } } } - }; } - }; /***/ }), -/* 884 */ +/* 894 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -113229,6 +100701,7 @@ module.exports = { */ + const OPTIONS = { always: "always", never: "never", @@ -113236,24 +100709,24 @@ const OPTIONS = { properties: "properties", consistent: "consistent", consistentAsNeeded: "consistent-as-needed" -}; //------------------------------------------------------------------------------ +}; + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ - /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Require or disallow method and property shorthand syntax for object literals", recommended: false, - url: "https://eslint.org/docs/rules/object-shorthand" + url: "https://eslint.org/docs/latest/rules/object-shorthand" }, fixable: "code", schema: { @@ -113315,7 +100788,6 @@ module.exports = { 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; @@ -113328,72 +100800,69 @@ module.exports = { const METHODS_IGNORE_PATTERN = PARAMS.methodsIgnorePattern ? new RegExp(PARAMS.methodsIgnorePattern, "u") : null; const AVOID_QUOTES = PARAMS.avoidQuotes; const AVOID_EXPLICIT_RETURN_ARROWS = !!PARAMS.avoidExplicitReturnArrows; - const sourceCode = context.getSourceCode(); //-------------------------------------------------------------------------- + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- // 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' + 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. } @@ -113401,28 +100870,27 @@ module.exports = { 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? + 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) { @@ -113436,7 +100904,6 @@ module.exports = { * all the keys are redundant. */ const canAlwaysUseShorthand = properties.every(isRedundant); - if (canAlwaysUseShorthand) { context.report({ node, @@ -113447,88 +100914,77 @@ module.exports = { } } } + /** * 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: /* */ () => {} + 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 @@ -113539,46 +100995,44 @@ module.exports = { * 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. + * @param {ASTNode} node The node representing the function. * @returns {void} */ - - function enterFunction() { + function enterFunction(node) { lexicalScopeStack.unshift(new Set()); - context.getScope().variables.filter(variable => variable.name === "arguments").forEach(variable => { + sourceCode.getScope(node).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, @@ -113586,30 +101040,24 @@ module.exports = { "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); @@ -113617,30 +101065,31 @@ module.exports = { checkConsistency(node, true); } }, - "Property:exit"(node) { - const isConciseProperty = node.method || node.shorthand; // Ignore destructuring assignment + const isConciseProperty = node.method || node.shorthand; + // Ignore destructuring assignment if (node.parent.type === "ObjectPattern") { return; - } // getters and setters are ignored - + } + // getters and setters are ignored if (node.kind === "get" || node.kind === "set") { return; - } // only computed methods can fail the following checks - + } + // 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() {} } + const messageId = APPLY_NEVER ? "expectedMethodLongform" : "expectedLiteralMethodLongform"; + // { x() {} } should be written as { x: function() {} } context.report({ node, messageId, @@ -113658,20 +101107,17 @@ module.exports = { if (IGNORE_CONSTRUCTORS && node.key.type === "Identifier" && isConstructor(node.key.name)) { return; } - if (METHODS_IGNORE_PATTERN) { const propertyName = astUtils.getStaticPropertyName(node); - if (propertyName !== null && METHODS_IGNORE_PATTERN.test(propertyName)) { return; } } - if (AVOID_QUOTES && isStringLiteral(node.key)) { return; - } // {[x]: function(){}} should be written as {[x]() {}} - + } + // {[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, @@ -113684,37 +101130,31 @@ module.exports = { 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} - + } + // {"x": x} should be written as {x} context.report({ node, messageId: "expectedPropertyShorthand", - fix(fixer) { return fixer.replaceText(node, node.value.name); } - }); } } - }; } - }; /***/ }), -/* 885 */ +/* 895 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -113722,11 +101162,15 @@ module.exports = { * @fileoverview A rule to control the use of single variable declarations. * @author Ian Christian Myers */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -113735,24 +101179,22 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @param {ASTNode} node node to check * @returns {boolean} `true` if the given node is in a statement list */ - - function isInStatementList(node) { return astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type); -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce variables to be declared either together or separately in functions", recommended: false, - url: "https://eslint.org/docs/rules/one-var" + url: "https://eslint.org/docs/latest/rules/one-var" }, fixable: "code", schema: [{ @@ -113798,14 +101240,12 @@ module.exports = { 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 = { @@ -113835,32 +101275,31 @@ module.exports = { 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.sourceCode; - const sourceCode = context.getSourceCode(); //-------------------------------------------------------------------------- + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- const functionStack = []; const blockStack = []; + /** * Increments the blockStack counter. * @returns {void} * @private */ - function startBlock() { blockStack.push({ let: { @@ -113873,13 +101312,12 @@ module.exports = { } }); } + /** * Increments the functionStack counter. * @returns {void} * @private */ - - function startFunction() { functionStack.push({ initialized: false, @@ -113887,38 +101325,36 @@ module.exports = { }); 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" @@ -113927,8 +101363,6 @@ module.exports = { * @returns {void} * @private */ - - function recordTypes(statementType, declarations, currentScope) { for (let i = 0; i < declarations.length; i++) { if (declarations[i].init === null) { @@ -113946,16 +101380,14 @@ module.exports = { } } } + /** * 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") { @@ -113963,23 +101395,20 @@ module.exports = { } 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++; @@ -113987,9 +101416,9 @@ module.exports = { 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" @@ -113997,14 +101426,11 @@ module.exports = { * @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) { @@ -114012,13 +101438,11 @@ module.exports = { } } } - 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) { @@ -114026,21 +101450,18 @@ module.exports = { } } } - 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 : []; @@ -114050,103 +101471,87 @@ module.exports = { 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|null} The fixer function */ - - function splitDeclarations(declaration) { const { parent - } = declaration; // don't autofix code such as: if (foo) var x, y; + } = declaration; + // don't autofix code such as: if (foo) var x, y; if (!isInStatementList(parent.type === "ExportNamedDeclaration" ? parent : declaration)) { return null; } - 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; } - const exportPlacement = declaration.parent.type === "ExportNamedDeclaration" ? "export " : ""; + /* * `var x,y` * tokenAfterDeclarator ^^ afterComma */ - if (afterComma.range[0] === tokenAfterDeclarator.range[1]) { return fixer.replaceText(tokenAfterDeclarator, `; ${exportPlacement}${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])}${exportPlacement}${declaration.kind} `); } - return fixer.replaceText(tokenAfterDeclarator, `; ${exportPlacement}${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({ @@ -114154,19 +101559,16 @@ module.exports = { messageId: "splitRequires" }); } - } // consecutive - + } + // 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, @@ -114196,9 +101598,9 @@ module.exports = { }); } } - } // always - + } + // always if (!hasOnlyOneStatement(type, declarations)) { if (options[type].initialized === MODE_ALWAYS && options[type].uninitialized === MODE_ALWAYS) { context.report({ @@ -114220,12 +101622,10 @@ module.exports = { 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", @@ -114236,12 +101636,11 @@ module.exports = { }); } } - } // never - + } + // 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 @@ -114276,11 +101675,12 @@ module.exports = { } } } - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public API //-------------------------------------------------------------------------- - return { Program: startFunction, FunctionDeclaration: startFunction, @@ -114288,6 +101688,7 @@ module.exports = { ArrowFunctionExpression: startFunction, StaticBlock: startFunction, // StaticBlock creates a new scope for `var` variables + BlockStatement: startBlock, ForStatement: startBlock, ForInStatement: startBlock, @@ -114306,11 +101707,10 @@ module.exports = { "StaticBlock:exit": endFunction }; } - }; /***/ }), -/* 886 */ +/* 896 */ /***/ ((module) => { "use strict"; @@ -114318,19 +101718,20 @@ module.exports = { * @fileoverview Rule to check multiple var declarations per line * @author Alberto Rodríguez */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Require or disallow newlines around variable declarations", recommended: false, - url: "https://eslint.org/docs/rules/one-var-declaration-per-line" + url: "https://eslint.org/docs/latest/rules/one-var-declaration-per-line" }, schema: [{ enum: ["always", "initializations"] @@ -114340,9 +101741,10 @@ module.exports = { expectVarOnNewline: "Expected variable declaration to be on a new line." } }, - create(context) { - const always = context.options[0] === "always"; //-------------------------------------------------------------------------- + const always = context.options[0] === "always"; + + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -114352,23 +101754,20 @@ module.exports = { * @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 => { @@ -114382,23 +101781,22 @@ module.exports = { }); } } - prev = current; }); - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- - return { VariableDeclaration: checkForNewLine }; } - }; /***/ }), -/* 887 */ +/* 897 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -114406,11 +101804,14 @@ module.exports = { * @fileoverview Rule to replace assignment expressions with operator assignment * @author Brandon Mills */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -114421,11 +101822,10 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @returns {boolean} True if the operator is commutative and has a * shorthand form. */ - - function isCommutativeOperatorWithShorthand(operator) { return ["*", "&", "^", "|"].includes(operator); } + /** * Checks whether an operator is not commutative and has an operator assignment * shorthand form. @@ -114433,11 +101833,11 @@ function isCommutativeOperatorWithShorthand(operator) { * @returns {boolean} True if the operator is not commutative and has * a shorthand form. */ - - function isNonCommutativeOperatorWithShorthand(operator) { return ["+", "-", "/", "%", "<<", ">>", ">>>", "**"].includes(operator); -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -114447,21 +101847,18 @@ function isNonCommutativeOperatorWithShorthand(operator) { * @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"); } + /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Require or disallow assignment operator shorthand where possible", recommended: false, - url: "https://eslint.org/docs/rules/operator-assignment" + url: "https://eslint.org/docs/latest/rules/operator-assignment" }, schema: [{ enum: ["always", "never"] @@ -114472,37 +101869,32 @@ module.exports = { unexpected: "Unexpected operator assignment ({{operator}}) shorthand." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * 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)) { const replacementOperator = `${operator}=`; - if (astUtils.isSameReference(left, expr.left, true)) { context.report({ node, @@ -114510,24 +101902,21 @@ module.exports = { data: { operator: replacementOperator }, - 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. + 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}${replacementOperator}${rightText}`); } - return null; } - }); } else if (astUtils.isSameReference(left, expr.right, true) && isCommutativeOperatorWithShorthand(operator)) { /* @@ -114545,13 +101934,12 @@ module.exports = { } } } + /** * 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({ @@ -114560,20 +101948,20 @@ module.exports = { data: { operator: node.operator }, - 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. + 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 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 @@ -114584,7 +101972,6 @@ module.exports = { includeComments: true }); let rightTextPrefix = ""; - if (operatorToken.range[1] === tokenAfterOperator.range[0] && !astUtils.canTokensBeAdjacent({ type: "Punctuator", value: newOperator @@ -114594,26 +101981,21 @@ module.exports = { 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 }; } - }; /***/ }), -/* 888 */ +/* 898 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -114621,24 +102003,26 @@ module.exports = { * @fileoverview Operator linebreak - enforces operator linebreak style of two types: after and before * @author Benoît Zugmeyer */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent linebreak style for operators", recommended: false, - url: "https://eslint.org/docs/rules/operator-linebreak" + url: "https://eslint.org/docs/latest/rules/operator-linebreak" }, schema: [{ enum: ["after", "before", "none", null] @@ -114662,22 +102046,20 @@ module.exports = { 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.sourceCode; - const sourceCode = context.getSourceCode(); //-------------------------------------------------------------------------- + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -114687,7 +102069,6 @@ module.exports = { * @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); @@ -114697,7 +102078,6 @@ module.exports = { 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, { @@ -114707,6 +102087,7 @@ module.exports = { }) !== 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 && @@ -114715,29 +102096,28 @@ module.exports = { * 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. + 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. + 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 @@ -114746,8 +102126,6 @@ module.exports = { * @private * @returns {void} */ - - function validateNode(node, rightSide, operator) { /* * Find the operator token by searching from the right side, because between the left side and the operator @@ -114759,9 +102137,12 @@ module.exports = { const rightToken = sourceCode.getTokenAfter(operatorToken); const operatorStyleOverride = styleOverrides[operator]; const style = operatorStyleOverride || globalStyle; - const fix = getFixer(operatorToken, style); // if single line + const fix = getFixer(operatorToken, style); - if (astUtils.isTokenOnSameLine(leftToken, operatorToken) && astUtils.isTokenOnSameLine(operatorToken, rightToken)) {// do nothing. + // 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({ @@ -114805,49 +102186,44 @@ module.exports = { }); } } + /** * Validates a binary expression using `validateNode` * @param {BinaryExpression|LogicalExpression|AssignmentExpression} node node to be validated * @returns {void} */ - - function validateBinaryExpression(node) { validateNode(node, node.right, node.operator); - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- - return { BinaryExpression: validateBinaryExpression, LogicalExpression: validateBinaryExpression, AssignmentExpression: validateBinaryExpression, - VariableDeclarator(node) { if (node.init) { validateNode(node, node.init, "="); } }, - PropertyDefinition(node) { if (node.value) { validateNode(node, node.value, "="); } }, - ConditionalExpression(node) { validateNode(node, node.consequent, "?"); validateNode(node, node.alternate, ":"); } - }; } - }; /***/ }), -/* 889 */ +/* 899 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -114855,24 +102231,26 @@ module.exports = { * @fileoverview A rule to ensure blank lines within blocks. * @author Mathias Schreck */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Require or disallow padding within blocks", recommended: false, - url: "https://eslint.org/docs/rules/padded-blocks" + url: "https://eslint.org/docs/latest/rules/padded-blocks" }, fixable: "whitespace", schema: [{ @@ -114908,12 +102286,10 @@ module.exports = { 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; @@ -114923,153 +102299,133 @@ module.exports = { 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.sourceCode; - 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]); } - if (node.type === "StaticBlock") { return sourceCode.getFirstToken(node, { skip: 1 }); // skip the `static` token - } // `BlockStatement` or `ClassBody` - + } + // `BlockStatement` or `ClassBody` 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; - + 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; - + 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. * @throws {Error} (Unreachable) * @returns {boolean} True if the node should be padded, false otherwise. */ - - function requirePaddingFor(node) { switch (node.type) { case "BlockStatement": case "StaticBlock": return options.blocks; - case "SwitchStatement": return options.switches; - case "ClassBody": return options.classes; /* c8 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); - + 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({ @@ -115078,15 +102434,12 @@ module.exports = { start: tokenBeforeFirst.loc.start, end: firstBlockToken.loc.start }, - fix(fixer) { return fixer.insertTextAfter(tokenBeforeFirst, "\n"); }, - messageId: "alwaysPadBlock" }); } - if (!blockHasBottomPadding) { context.report({ node, @@ -115094,11 +102447,9 @@ module.exports = { end: tokenAfterLast.loc.start, start: lastBlockToken.loc.end }, - fix(fixer) { return fixer.insertTextBefore(tokenAfterLast, "\n"); }, - messageId: "alwaysPadBlock" }); } @@ -115110,15 +102461,12 @@ module.exports = { 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, @@ -115127,57 +102475,45 @@ module.exports = { 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); }; - rule.StaticBlock = rule.BlockStatement; } - if (Object.prototype.hasOwnProperty.call(options, "classes")) { rule.ClassBody = function (node) { if (node.body.length === 0) { return; } - checkPadding(node); }; } - return rule; } - }; /***/ }), -/* 890 */ +/* 900 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -115185,91 +102521,88 @@ module.exports = { * @fileoverview Rule to require or disallow newlines between statements * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // 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. @@ -115278,64 +102611,57 @@ function isIIFEStatement(node) { * @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. - + } + // 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. * @@ -115349,8 +102675,6 @@ function isDirectivePrologue(node, sourceCode) { * @returns {Token} The actual last token. * @private */ - - function getActualLastToken(sourceCode, node) { const semiToken = sourceCode.getLastToken(node); const prevToken = sourceCode.getTokenBefore(semiToken); @@ -115358,6 +102682,7 @@ function getActualLastToken(sourceCode, node) { 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. @@ -115366,20 +102691,18 @@ function getActualLastToken(sourceCode, node) { * @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. @@ -115393,32 +102716,27 @@ function verifyForAny() {} * @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); + const text = context.sourceCode.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. @@ -115432,23 +102750,18 @@ function verifyForNever(context, _, nextNode, paddingLines) { * @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(); + const sourceCode = context.sourceCode; 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. @@ -115474,25 +102787,21 @@ function verifyForAlways(context, prevNode, nextNode, paddingLines) { 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 @@ -115504,12 +102813,12 @@ const PaddingTypes = { verify: verifyForAlways } }; + /** * Types of statements. * Those have `test` method to check it matches to the given statement. * @private */ - const StatementTypes = { "*": { test: () => true @@ -115567,19 +102876,20 @@ const StatementTypes = { var: newKeywordTester("var"), while: newKeywordTester("while"), with: newKeywordTester("with") -}; //------------------------------------------------------------------------------ +}; + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "layout", docs: { description: "Require or disallow padding lines between statements", recommended: false, - url: "https://eslint.org/docs/rules/padding-line-between-statements" + url: "https://eslint.org/docs/latest/rules/padding-line-between-statements" }, fixable: "whitespace", schema: { @@ -115623,34 +102933,33 @@ module.exports = { expectedBlankLine: "Expected blank line before this statement." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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. @@ -115658,21 +102967,17 @@ module.exports = { * @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. @@ -115680,20 +102985,17 @@ module.exports = { * @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. @@ -115702,55 +103004,48 @@ module.exports = { * @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. + } + // Save this node as the current previous statement. + const prevNode = scopeInfo.prevNode; - const prevNode = scopeInfo.prevNode; // Verify. - + // 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. @@ -115758,13 +103053,10 @@ module.exports = { * @returns {void} * @private */ - - function verifyThenEnterScope(node) { verify(node); enterScope(); } - return { Program: enterScope, BlockStatement: enterScope, @@ -115779,11 +103071,10 @@ module.exports = { "SwitchCase:exit": exitScope }; } - }; /***/ }), -/* 891 */ +/* 901 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -115793,7 +103084,10 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -115802,11 +103096,10 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @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. @@ -115814,24 +103107,19 @@ function isFunctionName(variable) { * @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 @@ -115841,11 +103129,11 @@ function getVariableOfArguments(scope) { return variable.identifiers.length === 0 ? variable : null; } } + /* c8 ignore next */ - - return null; } + /** * Checks whether or not a given node is a callback. * @param {ASTNode} node A node to check. @@ -115854,8 +103142,6 @@ function getVariableOfArguments(scope) { * {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, @@ -115864,27 +103150,24 @@ function getCallbackInfo(node) { 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. + // 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; @@ -115892,30 +103175,26 @@ function getCallbackInfo(node) { } else { return retv; } - break; - // Checks whether the node is a callback. + // 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; } + /* c8 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 @@ -115923,24 +103202,22 @@ function getCallbackInfo(node) { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Require using arrow functions for callbacks", recommended: false, - url: "https://eslint.org/docs/rules/prefer-arrow-callback" + url: "https://eslint.org/docs/latest/rules/prefer-arrow-callback" }, schema: [{ type: "object", @@ -115961,26 +103238,24 @@ module.exports = { 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(); + const sourceCode = context.sourceCode; + /* * {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, @@ -115988,87 +103263,74 @@ module.exports = { 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 + const scopeInfo = exitScope(); + // Skip named function expressions if (allowNamedFunctions && node.id && node.id.name) { return; - } // Skip generators. - + } + // Skip generators. if (node.generator) { return; - } // Skip recursive functions. - - - const nameVar = context.getDeclaredVariables(node)[0]; + } + // Skip recursive functions. + const nameVar = sourceCode.getDeclaredVariables(node)[0]; if (isFunctionName(nameVar) && nameVar.references.length > 0) { return; - } // Skip if it's using arguments. - - - const variable = getVariableOfArguments(context.getScope()); + } + // Skip if it's using arguments. + const variable = getVariableOfArguments(sourceCode.getScope(node)); if (variable && variable.references.length > 0) { return; - } // Reports if it's a callback which can replace with arrows. - + } + // 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)) { /* @@ -116078,49 +103340,46 @@ module.exports = { * don't replace it with an arrow function, because this is a SyntaxError with arrow functions. */ return; - } // Remove `.bind(this)` if exists. - + } + // 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; } - 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; - } // If comments exist in the `.bind(this)`, don't remove those. - - - if (sourceCode.commentsExistBetween(firstTokenToRemove, lastTokenToRemove)) { - return; } + // If comments exist in the `.bind(this)`, don't remove those. + if (sourceCode.commentsExistBetween(firstTokenToRemove, lastTokenToRemove)) { + return; + } yield fixer.removeRange([firstTokenToRemove.range[0], lastTokenToRemove.range[1]]); - } // Convert the function expression to an arrow function. - + } + // Convert the function expression to an arrow function. const functionToken = sourceCode.getFirstToken(node, node.async ? 1 : 0); const leftParenToken = sourceCode.getTokenAfter(functionToken, astUtils.isOpeningParenToken); - + const tokenBeforeBody = sourceCode.getTokenBefore(node.body); if (sourceCode.commentsExistBetween(functionToken, leftParenToken)) { // Remove only extra tokens to keep comments. yield fixer.remove(functionToken); - if (node.id) { yield fixer.remove(node.id); } @@ -116128,38 +103387,33 @@ module.exports = { // Remove extra tokens and spaces. yield fixer.removeRange([functionToken.range[0], leftParenToken.range[0]]); } + yield fixer.insertTextAfter(tokenBeforeBody, " =>"); - yield fixer.insertTextBefore(node.body, "=> "); // Get the node that will become the new arrow function. - + // 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, ")"); } } - }); } } - }; } - }; /***/ }), -/* 892 */ +/* 902 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -116167,45 +103421,45 @@ module.exports = { * @fileoverview A rule to suggest using of const declaration for variables that are never reassigned after declared. * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const FixTracker = __webpack_require__(759); +const astUtils = __webpack_require__(639); -const FixTracker = __webpack_require__(752); - -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - const PATTERN_TYPE = /^(?:.+?Pattern|RestElement|SpreadProperty|ExperimentalRestProperty|Property)$/u; const DECLARATION_HOST_TYPE = /^(?:Program|BlockStatement|StaticBlock|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. @@ -116213,21 +103467,17 @@ function canBecomeVariableDeclaration(identifier) { * @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.some(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. @@ -116237,25 +103487,20 @@ function isOuterVariableInDestructing(name, initScope) { * @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 @@ -116265,8 +103510,6 @@ function getDestructuringHost(reference) { * @returns {boolean} True if the destructuring pattern contains * a MemberExpression, false if not. */ - - function hasMemberExpressionAssignment(node) { switch (node.type) { case "ObjectPattern": @@ -116280,29 +103523,26 @@ function hasMemberExpressionAssignment(node) { */ 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. * @@ -116327,35 +103567,27 @@ function hasMemberExpressionAssignment(node) { * 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. - + } + // 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; - + 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)); @@ -116365,39 +103597,33 @@ function getIdentifierIfShouldBeConst(variable, ignoreReadBeforeAssign) { 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. @@ -116408,33 +103634,28 @@ function getIdentifierIfShouldBeConst(variable, 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; - prevId = id; // Add the identifier node into the destructuring group. - + // Add the identifier node into the destructuring group. const group = getDestructuringHost(reference); - if (group) { if (identifierMap.has(group)) { identifierMap.get(group).push(identifier); @@ -116444,9 +103665,9 @@ function groupByDestructuring(variables, ignoreReadBeforeAssign) { } } } - return identifierMap; } + /** * Finds the nearest parent of node with a given type. * @param {ASTNode} node The node to search from. @@ -116454,32 +103675,28 @@ function groupByDestructuring(variables, ignoreReadBeforeAssign) { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Require `const` declarations for variables that are never reassigned after declared", recommended: false, - url: "https://eslint.org/docs/rules/prefer-const" + url: "https://eslint.org/docs/latest/rules/prefer-const" }, fixable: "code", schema: [{ @@ -116500,16 +103717,16 @@ module.exports = { useConst: "'{{name}}' is never reassigned. Use 'const' instead." } }, - create(context) { const options = context.options[0] || {}; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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. @@ -116523,19 +103740,16 @@ module.exports = { * 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" @@ -116550,14 +103764,12 @@ module.exports = { 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; @@ -116565,8 +103777,8 @@ module.exports = { } } } - - 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) + 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 @@ -116574,13 +103786,13 @@ module.exports = { * 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; let totalDeclarationsCount = 0; varDeclParent.declarations.forEach(declaration => { @@ -116595,7 +103807,6 @@ module.exports = { shouldFix = shouldFix && reportCount === totalDeclarationsCount; } } - nodesToReport.forEach(node => { context.report({ node, @@ -116603,37 +103814,33 @@ module.exports = { data: node, fix: shouldFix ? fixer => { const letKeywordToken = sourceCode.getFirstToken(varDeclParent, t => t.value === varDeclParent.kind); + /** * Extend the replacement range to the whole declaration, * in order to prevent other fixes in the same pass * https://github.com/eslint/eslint/issues/13899 */ - return new FixTracker(fixer, sourceCode).retainRange(varDeclParent.range).replaceTextRange(letKeywordToken.range, "const"); } : null }); }); } } - return { "Program:exit"() { groupByDestructuring(variables, ignoreReadBeforeAssign).forEach(checkGroup); }, - VariableDeclaration(node) { if (node.kind === "let" && !isInitOfForStatement(node)) { - variables.push(...context.getDeclaredVariables(node)); + variables.push(...sourceCode.getDeclaredVariables(node)); } } - }; } - }; /***/ }), -/* 893 */ +/* 903 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -116641,30 +103848,33 @@ module.exports = { * @fileoverview Prefer destructuring from arrays and objects * @author Alex LaFroscia */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - const PRECEDENCE_OF_ASSIGNMENT_EXPR = astUtils.getPrecedence({ type: "AssignmentExpression" -}); //------------------------------------------------------------------------------ +}); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Require destructuring from arrays and/or objects", recommended: false, - url: "https://eslint.org/docs/rules/prefer-destructuring" + url: "https://eslint.org/docs/latest/rules/prefer-destructuring" }, fixable: "code", schema: [{ @@ -116726,7 +103936,6 @@ module.exports = { preferDestructuring: "Use {{type}} destructuring." } }, - create(context) { const enabledTypes = context.options[0]; const enforceForRenamedProperties = context.options[1] && context.options[1].enforceForRenamedProperties; @@ -116740,13 +103949,14 @@ module.exports = { object: true } }; - if (enabledTypes) { normalizedOptions = typeof enabledTypes.array !== "undefined" || typeof enabledTypes.object !== "undefined" ? { VariableDeclarator: enabledTypes, AssignmentExpression: enabledTypes } : enabledTypes; - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -116756,11 +103966,10 @@ module.exports = { * @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 * @@ -116769,11 +103978,10 @@ module.exports = { * @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 @@ -116781,8 +103989,6 @@ module.exports = { * @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, @@ -116793,6 +103999,7 @@ module.exports = { fix }); } + /** * Determines if a node should be fixed into object destructuring * @@ -116805,11 +104012,10 @@ module.exports = { * @param {ASTNode} node 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, @@ -116818,24 +104024,21 @@ module.exports = { * @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. + const sourceCode = context.sourceCode; + // 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; } - let objectText = sourceCode.getText(rightNode.object); - if (astUtils.getPrecedence(rightNode.object) < PRECEDENCE_OF_ASSIGNMENT_EXPR) { objectText = `(${objectText})`; } - return fixer.replaceText(node, `{${rightNode.property.name}} = ${objectText}`); } + /** * Check that the `prefer-destructuring` rules are followed based on the * given left- and right-hand side of the assignment. @@ -116847,83 +104050,72 @@ module.exports = { * @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" || rightNode.property.type === "PrivateIdentifier") { 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 - + } + // 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 checkAssignmentExpression(node) { if (node.operator === "=") { performCheck(node.left, node.right, node); } - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- - return { VariableDeclarator: checkVariableDeclarator, AssignmentExpression: checkAssignmentExpression }; } - }; /***/ }), -/* 894 */ +/* 904 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -116931,84 +104123,85 @@ module.exports = { * @fileoverview Rule to disallow Math.pow in favor of the ** operator * @author Milos Djermanovic */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - -const astUtils = __webpack_require__(618); - +const astUtils = __webpack_require__(639); const { CALL, ReferenceTracker -} = __webpack_require__(571); //------------------------------------------------------------------------------ +} = __webpack_require__(594); + +//------------------------------------------------------------------------------ // 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 + 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 === "AwaitExpression" || 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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow the use of `Math.pow` in favor of the `**` operator", recommended: false, - url: "https://eslint.org/docs/rules/prefer-exponentiation-operator" + url: "https://eslint.org/docs/latest/rules/prefer-exponentiation-operator" }, schema: [], fixable: "code", @@ -117016,40 +104209,35 @@ module.exports = { useExponentiation: "Use the '**' operator instead of 'Math.pow'." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * 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); + 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 = ""; - + suffix = ""; if (!shouldParenthesizeAll) { if (!shouldParenthesizeBase) { const firstReplacementToken = sourceCode.getFirstToken(base), - tokenBefore = sourceCode.getTokenBefore(node); - + 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 } @@ -117057,8 +104245,7 @@ module.exports = { if (!shouldParenthesizeExponent) { const lastReplacementToken = sourceCode.getLastToken(exponent), - tokenAfter = sourceCode.getTokenAfter(node); - + 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 } @@ -117066,17 +104253,15 @@ module.exports = { } const baseReplacement = parenthesizeIfShould(baseText, shouldParenthesizeBase), - exponentReplacement = parenthesizeIfShould(exponentText, shouldParenthesizeExponent), - replacement = parenthesizeIfShould(`${baseReplacement}**${exponentReplacement}`, shouldParenthesizeAll); + exponentReplacement = parenthesizeIfShould(exponentText, shouldParenthesizeExponent), + replacement = parenthesizeIfShould(`${baseReplacement}**${exponentReplacement}`, shouldParenthesizeAll); return fixer.replaceText(node, `${prefix}${replacement}${suffix}`); } - }); } - return { - Program() { - const scope = context.getScope(); + Program(node) { + const scope = sourceCode.getScope(node); const tracker = new ReferenceTracker(scope); const trackMap = { Math: { @@ -117085,21 +104270,18 @@ module.exports = { } } }; - for (const { - node + node: refNode } of tracker.iterateGlobalReferences(trackMap)) { - report(node); + report(refNode); } } - }; } - }; /***/ }), -/* 895 */ +/* 905 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -117107,85 +104289,130 @@ module.exports = { * @fileoverview Rule to enforce requiring named capture groups in regular expression. * @author Pig Fang */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant -} = __webpack_require__(571); +} = __webpack_require__(594); +const regexpp = __webpack_require__(748); -const regexpp = __webpack_require__(741); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ +const parser = new regexpp.RegExpParser(); -const parser = new regexpp.RegExpParser(); //------------------------------------------------------------------------------ +/** + * Creates fixer suggestions for the regex, if statically determinable. + * @param {number} groupStart Starting index of the regex group. + * @param {string} pattern The regular expression pattern to be checked. + * @param {string} rawText Source text of the regexNode. + * @param {ASTNode} regexNode AST node which contains the regular expression. + * @returns {Array} Fixer suggestions for the regex, if statically determinable. + */ +function suggestIfPossible(groupStart, pattern, rawText, regexNode) { + switch (regexNode.type) { + case "Literal": + if (typeof regexNode.value === "string" && rawText.includes("\\")) { + return null; + } + break; + case "TemplateLiteral": + if (regexNode.expressions.length || rawText.slice(1, -1) !== pattern) { + return null; + } + break; + default: + return null; + } + const start = regexNode.range[0] + groupStart + 2; + return [{ + fix(fixer) { + const existingTemps = pattern.match(/temp\d+/gu) || []; + const highestTempCount = existingTemps.reduce((previous, next) => Math.max(previous, Number(next.slice("temp".length))), 0); + return fixer.insertTextBeforeRange([start, start], `?`); + }, + messageId: "addGroupName" + }, { + fix(fixer) { + return fixer.insertTextBeforeRange([start, start], "?:"); + }, + messageId: "addNonCapture" + }]; +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce using named capture group in regular expression", recommended: false, - url: "https://eslint.org/docs/rules/prefer-named-capture-group" + url: "https://eslint.org/docs/latest/rules/prefer-named-capture-group" }, + hasSuggestions: true, schema: [], messages: { + addGroupName: "Add name to capture group.", + addNonCapture: "Convert group to non-capturing.", required: "Capture group '{{group}}' should be converted to a named or non-capturing group." } }, - create(context) { + const sourceCode = context.sourceCode; + /** * 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 {string} pattern The regular expression pattern to be checked. + * @param {ASTNode} node AST node which contains the regular expression or a call/new expression. + * @param {ASTNode} regexNode AST node which contains the regular expression. * @param {boolean} uFlag Flag indicates whether unicode mode is enabled or not. * @returns {void} */ - function checkRegex(pattern, node, uFlag) { + function checkRegex(pattern, node, regexNode, 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) { + const rawText = sourceCode.getText(regexNode); + const suggest = suggestIfPossible(group.start, pattern, rawText, regexNode); context.report({ node, messageId: "required", data: { group: group.raw - } + }, + suggest }); } } - }); } - return { Literal(node) { if (node.regex) { - checkRegex(node.regex.pattern, node, node.regex.flags.includes("u")); + checkRegex(node.regex.pattern, node, node, node.regex.flags.includes("u")); } }, - - Program() { - const scope = context.getScope(); + Program(node) { + const scope = sourceCode.getScope(node); const tracker = new ReferenceTracker(scope); const traceMap = { RegExp: { @@ -117193,26 +104420,22 @@ module.exports = { [CONSTRUCT]: true } }; - for (const { - node + node: refNode } of tracker.iterateGlobalReferences(traceMap)) { - const regex = getStringIfConstant(node.arguments[0]); - const flags = getStringIfConstant(node.arguments[1]); - + const regex = getStringIfConstant(refNode.arguments[0]); + const flags = getStringIfConstant(refNode.arguments[1]); if (regex) { - checkRegex(regex, node, flags && flags.includes("u")); + checkRegex(regex, refNode, refNode.arguments[0], flags && flags.includes("u")); } } } - }; } - }; /***/ }), -/* 896 */ +/* 906 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -117220,15 +104443,18 @@ module.exports = { * @fileoverview Rule to disallow `parseInt()` in favor of binary, octal, and hexadecimal literals * @author Annie Zhang, Henry Zhu */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - const radixMap = new Map([[2, { system: "binary", literalPrefix: "0b" @@ -117239,6 +104465,7 @@ const radixMap = new Map([[2, { system: "hexadecimal", literalPrefix: "0x" }]]); + /** * Checks to see if a CallExpression's callee node is `parseInt` or * `Number.parseInt`. @@ -117246,23 +104473,22 @@ const radixMap = new Map([[2, { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals", recommended: false, - url: "https://eslint.org/docs/rules/prefer-numeric-literals" + url: "https://eslint.org/docs/latest/rules/prefer-numeric-literals" }, schema: [], messages: { @@ -117270,18 +104496,18 @@ module.exports = { }, fixable: "code" }, - create(context) { - const sourceCode = context.getSourceCode(); //---------------------------------------------------------------------- + const sourceCode = context.sourceCode; + + //---------------------------------------------------------------------- // Public //---------------------------------------------------------------------- return { "CallExpression[arguments.length=2]"(node) { const [strNode, radixNode] = node.arguments, - str = astUtils.getStaticStringValue(strNode), - radix = radixNode.value; - + 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, @@ -117294,14 +104520,11 @@ module.exports = { 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), @@ -117319,34 +104542,27 @@ module.exports = { */ return null; } - const tokenBefore = sourceCode.getTokenBefore(node), - tokenAfter = sourceCode.getTokenAfter(node); + tokenAfter = sourceCode.getTokenAfter(node); let prefix = "", - suffix = ""; - + 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}`); } - }); } } - }; } - }; /***/ }), -/* 897 */ +/* 907 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -117355,11 +104571,15 @@ module.exports = { * @author Nitin Kumar * @author Gautam Arora */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -117368,8 +104588,6 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @param {ASTNode} node `MemberExpression` node to evaluate. * @returns {boolean} `true` if `node.object` is `Object`, `Object.prototype`, or `{}` (empty 'ObjectExpression' node). */ - - function hasLeftHandObject(node) { /* * ({}).hasOwnProperty.call(obj, prop) - `true` @@ -117378,28 +104596,25 @@ function hasLeftHandObject(node) { if (node.object.type === "ObjectExpression" && node.object.properties.length === 0) { return true; } - const objectNodeToCheck = node.object.type === "MemberExpression" && astUtils.getStaticPropertyName(node.object) === "prototype" ? node.object.object : node.object; - if (objectNodeToCheck.type === "Identifier" && objectNodeToCheck.name === "Object") { return true; } - return false; -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow use of `Object.prototype.hasOwnProperty.call()` and prefer use of `Object.hasOwn()`", recommended: false, - url: "https://eslint.org/docs/rules/prefer-object-has-own" + url: "https://eslint.org/docs/latest/rules/prefer-object-has-own" }, schema: [], messages: { @@ -117407,117 +104622,105 @@ module.exports = { }, fixable: "code" }, - create(context) { + const sourceCode = context.sourceCode; return { CallExpression(node) { if (!(node.callee.type === "MemberExpression" && node.callee.object.type === "MemberExpression")) { return; } - const calleePropertyName = astUtils.getStaticPropertyName(node.callee); const objectPropertyName = astUtils.getStaticPropertyName(node.callee.object); - const isObject = hasLeftHandObject(node.callee.object); // check `Object` scope + const isObject = hasLeftHandObject(node.callee.object); - const scope = context.getScope(); + // check `Object` scope + const scope = sourceCode.getScope(node); const variable = astUtils.getVariableByName(scope, "Object"); - if (calleePropertyName === "call" && objectPropertyName === "hasOwnProperty" && isObject && variable && variable.scope.type === "global") { context.report({ node, messageId: "useHasOwn", - fix(fixer) { - const sourceCode = context.getSourceCode(); - if (sourceCode.getCommentsInside(node.callee).length > 0) { return null; } - const tokenJustBeforeNode = sourceCode.getTokenBefore(node.callee, { includeComments: true - }); // for https://github.com/eslint/eslint/pull/15346#issuecomment-991417335 + }); + // for https://github.com/eslint/eslint/pull/15346#issuecomment-991417335 if (tokenJustBeforeNode && tokenJustBeforeNode.range[1] === node.callee.range[0] && !astUtils.canTokensBeAdjacent(tokenJustBeforeNode, "Object.hasOwn")) { return fixer.replaceText(node.callee, " Object.hasOwn"); } - return fixer.replaceText(node.callee, "Object.hasOwn"); } - }); } } - }; } - }; /***/ }), -/* 898 */ +/* 908 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /** * @fileoverview Prefers object spread property over Object.assign * @author Sharmila Jesupaul - * See LICENSE file in root directory for full license. */ + const { CALL, ReferenceTracker -} = __webpack_require__(571); - +} = __webpack_require__(594); const { isCommaToken, isOpeningParenToken, isClosingParenToken, isParenthesised -} = __webpack_require__(618); - +} = __webpack_require__(639); 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. @@ -117525,11 +104728,8 @@ function hasArgumentsWithAccessors(node) { * @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": @@ -117537,33 +104737,30 @@ function needsParens(node, sourceCode) { 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. @@ -117572,114 +104769,111 @@ function argNeedsParens(node, sourceCode) { * @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. + 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. + 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. + } + // 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. + 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. + const rightParen = sourceCode.getLastToken(node); - yield fixer.removeRange([node.range[0], leftParen.range[0]]); // Replace the parens of argument list to braces. + // 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. - + } + // 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 + 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. + 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); } @@ -117695,16 +104889,15 @@ function defineFixer(node, sourceCode) { } }; } + /** @type {import('../shared/types').Rule} */ - - 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.", + description: "Disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead", recommended: false, - url: "https://eslint.org/docs/rules/prefer-object-spread" + url: "https://eslint.org/docs/latest/rules/prefer-object-spread" }, schema: [], fixable: "code", @@ -117713,12 +104906,11 @@ module.exports = { useLiteralMessage: "Use an object literal instead of `Object.assign`. eg: `{ foo: bar }`." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; return { - Program() { - const scope = context.getScope(); + Program(node) { + const scope = sourceCode.getScope(node); const tracker = new ReferenceTracker(scope); const trackMap = { Object: { @@ -117726,30 +104918,29 @@ module.exports = { [CALL]: true } } - }; // Iterate all calls of `Object.assign` (only of the global variable `Object`). + }; + // Iterate all calls of `Object.assign` (only of the global variable `Object`). for (const { - node + node: refNode } 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); + if (refNode.arguments.length >= 1 && refNode.arguments[0].type === "ObjectExpression" && !hasArraySpread(refNode) && !(refNode.arguments.length > 1 && hasArgumentsWithAccessors(refNode))) { + const messageId = refNode.arguments.length === 1 ? "useLiteralMessage" : "useSpreadMessage"; + const fix = defineFixer(refNode, sourceCode); context.report({ - node, + node: refNode, messageId, fix }); } } } - }; } - }; /***/ }), -/* 899 */ +/* 909 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -117759,20 +104950,20 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Require using Error objects as Promise rejection reasons", recommended: false, - url: "https://eslint.org/docs/rules/prefer-promise-reject-errors" + url: "https://eslint.org/docs/latest/rules/prefer-promise-reject-errors" }, fixable: null, schema: [{ @@ -117789,9 +104980,11 @@ module.exports = { rejectAnError: "Expected the Promise rejection reason to be an Error." } }, - create(context) { - const ALLOW_EMPTY_REJECT = context.options.length && context.options[0].allowEmptyReject; //---------------------------------------------------------------------- + const ALLOW_EMPTY_REJECT = context.options.length && context.options[0].allowEmptyReject; + const sourceCode = context.sourceCode; + + //---------------------------------------------------------------------- // Helpers //---------------------------------------------------------------------- @@ -117800,12 +104993,10 @@ module.exports = { * @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, @@ -117813,20 +105004,20 @@ module.exports = { }); } } + /** * 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) { @@ -117834,7 +105025,6 @@ module.exports = { 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 @@ -117842,7 +105032,8 @@ module.exports = { */ "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]) + sourceCode.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 @@ -117851,22 +105042,27 @@ module.exports = { * 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. + */.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)); } } - }; } - }; /***/ }), -/* 900 */ +/* 910 */ /***/ ((module) => { "use strict"; @@ -117875,19 +105071,20 @@ module.exports = { * @author Keith Cirkel * @deprecated in ESLint v3.9.0 */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Require `Reflect` methods where applicable", recommended: false, - url: "https://eslint.org/docs/rules/prefer-reflect" + url: "https://eslint.org/docs/latest/rules/prefer-reflect" }, deprecated: true, replacedBy: [], @@ -117908,7 +105105,6 @@ module.exports = { preferReflect: "Avoid using {{existing}}, instead use {{substitute}}." } }, - create(context) { const existingNames = { apply: "Function.prototype.apply", @@ -117933,6 +105129,7 @@ module.exports = { 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. @@ -117940,7 +105137,6 @@ module.exports = { * @param {string} substitute The Reflect substitute that should be used. * @returns {void} */ - function report(node, existing, substitute) { context.report({ node, @@ -117951,36 +105147,30 @@ module.exports = { } }); } - return { CallExpression(node) { const methodName = (node.callee.property || {}).name; const isReflectCall = (node.callee.object || {}).name === "Reflect"; const hasReflectSubstitute = Object.prototype.hasOwnProperty.call(reflectSubstitutes, methodName); const userConfiguredException = exceptions.includes(methodName); - if (hasReflectSubstitute && !isReflectCall && !userConfiguredException) { report(node, existingNames[methodName], reflectSubstitutes[methodName]); } }, - UnaryExpression(node) { const isDeleteOperator = node.operator === "delete"; const targetsIdentifier = node.argument.type === "Identifier"; const userConfiguredException = exceptions.includes("delete"); - if (isDeleteOperator && !targetsIdentifier && !userConfiguredException) { report(node, "the delete keyword", "Reflect.deleteProperty"); } } - }; } - }; /***/ }), -/* 901 */ +/* 911 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -117988,76 +105178,75 @@ module.exports = { * @fileoverview Rule to disallow use of the `RegExp` constructor in favor of regular expression literals * @author Milos Djermanovic */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - -const astUtils = __webpack_require__(618); - +const astUtils = __webpack_require__(639); const { CALL, CONSTRUCT, ReferenceTracker, findVariable -} = __webpack_require__(571); - +} = __webpack_require__(594); const { RegExpValidator, visitRegExpAST, RegExpParser -} = __webpack_require__(741); - +} = __webpack_require__(748); const { canTokensBeAdjacent -} = __webpack_require__(618); //------------------------------------------------------------------------------ +} = __webpack_require__(639); +const { + REGEXPP_LATEST_ECMA_VERSION +} = __webpack_require__(801); + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - -const REGEXPP_LATEST_ECMA_VERSION = 2022; /** * 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; } +const validPrecedingTokens = new Set(["(", ";", "[", ",", "=", "+", "*", "-", "?", "~", "%", "**", "!", "typeof", "instanceof", "&&", "||", "??", "return", "...", "delete", "void", "in", "<", ">", "<=", ">=", "==", "===", "!=", "!==", "<<", ">>", ">>>", "&", "|", "^", ":", "{", "=>", "*=", "<<=", ">>=", ">>>=", "^=", "|=", "&=", "??=", "||=", "&&=", "**=", "+=", "-=", "/=", "%=", "/", "do", "break", "continue", "debugger", "case", "throw"]); -const validPrecedingTokens = new Set(["(", ";", "[", ",", "=", "+", "*", "-", "?", "~", "%", "**", "!", "typeof", "instanceof", "&&", "||", "??", "return", "...", "delete", "void", "in", "<", ">", "<=", ">=", "==", "===", "!=", "!==", "<<", ">>", ">>>", "&", "|", "^", ":", "{", "=>", "*=", "<<=", ">>=", ">>>=", "^=", "|=", "&=", "??=", "||=", "&&=", "**=", "+=", "-=", "/=", "%=", "/", "do", "break", "continue", "debugger", "case", "throw"]); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow use of the `RegExp` constructor in favor of regular expression literals", recommended: false, - url: "https://eslint.org/docs/rules/prefer-regex-literals" + url: "https://eslint.org/docs/latest/rules/prefer-regex-literals" }, hasSuggestions: true, schema: [{ @@ -118073,160 +105262,205 @@ module.exports = { messages: { unexpectedRegExp: "Use a regular expression literal instead of the 'RegExp' constructor.", replaceWithLiteral: "Replace with an equivalent regular expression literal.", + replaceWithLiteralAndFlags: "Replace with an equivalent regular expression literal with flags '{{ flags }}'.", + replaceWithIntendedLiteralAndFlags: "Replace with a regular expression literal with flags '{{ flags }}'.", 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; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * 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 scope = sourceCode.getScope(node); 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); } + /** * Gets the value of a string * @param {ASTNode} node The node to get the string of. * @returns {string|null} The value of the node. */ - - function getStringValue(node) { if (isStringLiteral(node)) { return node.value; } - if (isStaticTemplateLiteral(node)) { return node.quasis[0].value.cooked; } - if (isStringRawTaggedStaticTemplateLiteral(node)) { return node.quasi.quasis[0].value.raw; } - return null; } + /** * 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; } + /** * Returns a ecmaVersion compatible for regexpp. - * @param {any} ecmaVersion The ecmaVersion to convert. + * @param {number} ecmaVersion The ecmaVersion to convert. * @returns {import("regexpp/ecma-versions").EcmaVersion} The resulting ecmaVersion compatible for regexpp. */ - - function getRegexppEcmaVersion(ecmaVersion) { - if (typeof ecmaVersion !== "number" || ecmaVersion <= 5) { + if (ecmaVersion <= 5) { return 5; } - - return Math.min(ecmaVersion + 2009, REGEXPP_LATEST_ECMA_VERSION); + return Math.min(ecmaVersion, REGEXPP_LATEST_ECMA_VERSION); } + const regexppEcmaVersion = getRegexppEcmaVersion(context.languageOptions.ecmaVersion); + /** * Makes a character escaped or else returns null. * @param {string} character The character to escape. * @returns {string} The resulting escaped character. */ - - function resolveEscapes(character) { switch (character) { case "\n": case "\\\n": return "\\n"; - case "\r": case "\\\r": return "\\r"; - case "\t": case "\\\t": return "\\t"; - case "\v": case "\\\v": return "\\v"; - case "\f": case "\\\f": return "\\f"; - case "/": return "\\/"; - default: return null; } } + /** + * Checks whether the given regex and flags are valid for the ecma version or not. + * @param {string} pattern The regex pattern to check. + * @param {string | undefined} flags The regex flags to check. + * @returns {boolean} True if the given regex pattern and flags are valid for the ecma version. + */ + function isValidRegexForEcmaVersion(pattern, flags) { + const validator = new RegExpValidator({ + ecmaVersion: regexppEcmaVersion + }); + try { + validator.validatePattern(pattern, 0, pattern.length, flags ? flags.includes("u") : false); + if (flags) { + validator.validateFlags(flags); + } + return true; + } catch { + return false; + } + } + + /** + * Checks whether two given regex flags contain the same flags or not. + * @param {string} flagsA The regex flags. + * @param {string} flagsB The regex flags. + * @returns {boolean} True if two regex flags contain same flags. + */ + function areFlagsEqual(flagsA, flagsB) { + return [...flagsA].sort().join("") === [...flagsB].sort().join(""); + } + + /** + * Merges two regex flags. + * @param {string} flagsA The regex flags. + * @param {string} flagsB The regex flags. + * @returns {string} The merged regex flags. + */ + function mergeRegexFlags(flagsA, flagsB) { + const flagsSet = new Set([...flagsA, ...flagsB]); + return [...flagsSet].join(""); + } + + /** + * Checks whether a give node can be fixed to the given regex pattern and flags. + * @param {ASTNode} node The node to check. + * @param {string} pattern The regex pattern to check. + * @param {string} flags The regex flags + * @returns {boolean} True if a node can be fixed to the given regex pattern and flags. + */ + function canFixTo(node, pattern, flags) { + const tokenBefore = sourceCode.getTokenBefore(node); + return sourceCode.getCommentsInside(node).length === 0 && (!tokenBefore || validPrecedingTokens.has(tokenBefore.value)) && isValidRegexForEcmaVersion(pattern, flags); + } + + /** + * Returns a safe output code considering the before and after tokens. + * @param {ASTNode} node The regex node. + * @param {string} newRegExpValue The new regex expression value. + * @returns {string} The output code. + */ + function getSafeOutput(node, newRegExpValue) { + const tokenBefore = sourceCode.getTokenBefore(node); + const tokenAfter = sourceCode.getTokenAfter(node); + return (tokenBefore && !canTokensBeAdjacent(tokenBefore, newRegExpValue) && tokenBefore.range[1] === node.range[0] ? " " : "") + newRegExpValue + (tokenAfter && !canTokensBeAdjacent(newRegExpValue, tokenAfter) && node.range[1] === tokenAfter.range[0] ? " " : ""); + } return { - Program() { - const scope = context.getScope(); + Program(node) { + const scope = sourceCode.getScope(node); const tracker = new ReferenceTracker(scope); const traceMap = { RegExp: { @@ -118234,60 +105468,79 @@ module.exports = { [CONSTRUCT]: true } }; - for (const { - node + node: refNode } of tracker.iterateGlobalReferences(traceMap)) { - if (disallowRedundantWrapping && isUnnecessarilyWrappedRegexLiteral(node)) { - if (node.arguments.length === 2) { + if (disallowRedundantWrapping && isUnnecessarilyWrappedRegexLiteral(refNode)) { + const regexNode = refNode.arguments[0]; + if (refNode.arguments.length === 2) { + const suggests = []; + const argFlags = getStringValue(refNode.arguments[1]) || ""; + if (canFixTo(refNode, regexNode.regex.pattern, argFlags)) { + suggests.push({ + messageId: "replaceWithLiteralAndFlags", + pattern: regexNode.regex.pattern, + flags: argFlags + }); + } + const literalFlags = regexNode.regex.flags || ""; + const mergedFlags = mergeRegexFlags(literalFlags, argFlags); + if (!areFlagsEqual(mergedFlags, argFlags) && canFixTo(refNode, regexNode.regex.pattern, mergedFlags)) { + suggests.push({ + messageId: "replaceWithIntendedLiteralAndFlags", + pattern: regexNode.regex.pattern, + flags: mergedFlags + }); + } context.report({ - node, - messageId: "unexpectedRedundantRegExpWithFlags" + node: refNode, + messageId: "unexpectedRedundantRegExpWithFlags", + suggest: suggests.map(_ref => { + let { + flags, + pattern, + messageId + } = _ref; + return { + messageId, + data: { + flags + }, + fix(fixer) { + return fixer.replaceText(refNode, getSafeOutput(refNode, `/${pattern}/${flags}`)); + } + }; + }) }); } else { + const outputs = []; + if (canFixTo(refNode, regexNode.regex.pattern, regexNode.regex.flags)) { + outputs.push(sourceCode.getText(regexNode)); + } context.report({ - node, - messageId: "unexpectedRedundantRegExp" + node: refNode, + messageId: "unexpectedRedundantRegExp", + suggest: outputs.map(output => ({ + messageId: "replaceWithLiteral", + fix(fixer) { + return fixer.replaceText(refNode, getSafeOutput(refNode, output)); + } + })) }); } - } else if (hasOnlyStaticStringArguments(node)) { - let regexContent = getStringValue(node.arguments[0]); + } else if (hasOnlyStaticStringArguments(refNode)) { + let regexContent = getStringValue(refNode.arguments[0]); let noFix = false; let flags; - - if (node.arguments[1]) { - flags = getStringValue(node.arguments[1]); + if (refNode.arguments[1]) { + flags = getStringValue(refNode.arguments[1]); } - - const regexppEcmaVersion = getRegexppEcmaVersion(context.parserOptions.ecmaVersion); - const RegExpValidatorInstance = new RegExpValidator({ - ecmaVersion: regexppEcmaVersion - }); - - try { - RegExpValidatorInstance.validatePattern(regexContent, 0, regexContent.length, flags ? flags.includes("u") : false); - - if (flags) { - RegExpValidatorInstance.validateFlags(flags); - } - } catch { + if (!canFixTo(refNode, regexContent, flags)) { noFix = true; } - - const tokenBefore = sourceCode.getTokenBefore(node); - - if (tokenBefore && !validPrecedingTokens.has(tokenBefore.value)) { - noFix = true; - } - if (!/^[-a-zA-Z0-9\\[\](){} \t\r\n\v\f!@#$%^&*+^_=/~`.> 0) { - noFix = true; - } - if (regexContent && !noFix) { let charIncrease = 0; const ast = new RegExpParser({ @@ -118296,44 +105549,35 @@ module.exports = { visitRegExpAST(ast, { onCharacterEnter(characterNode) { const escaped = resolveEscapes(characterNode.raw); - if (escaped) { regexContent = regexContent.slice(0, characterNode.start + charIncrease) + escaped + regexContent.slice(characterNode.end + charIncrease); - if (characterNode.raw.length === 1) { charIncrease += 1; } } } - }); } - const newRegExpValue = `/${regexContent || "(?:)"}/${flags || ""}`; context.report({ - node, + node: refNode, messageId: "unexpectedRegExp", suggest: noFix ? [] : [{ messageId: "replaceWithLiteral", - fix(fixer) { - const tokenAfter = sourceCode.getTokenAfter(node); - return fixer.replaceText(node, (tokenBefore && !canTokensBeAdjacent(tokenBefore, newRegExpValue) && tokenBefore.range[1] === node.range[0] ? " " : "") + newRegExpValue + (tokenAfter && !canTokensBeAdjacent(newRegExpValue, tokenAfter) && node.range[1] === tokenAfter.range[0] ? " " : "")); + return fixer.replaceText(refNode, getSafeOutput(refNode, newRegExpValue)); } - }] }); } } } - }; } - }; /***/ }), -/* 902 */ +/* 912 */ /***/ ((module) => { "use strict"; @@ -118341,7 +105585,10 @@ module.exports = { * @fileoverview Rule to * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -118350,13 +105597,10 @@ module.exports = { * @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. @@ -118365,11 +105609,11 @@ function getVariableOfArguments(scope) { return variable.identifiers.length === 0 ? variable : null; } } + /* c8 ignore next */ - - return null; } + /** * Checks if the given reference is not normal member access. * @@ -118380,34 +105624,33 @@ function getVariableOfArguments(scope) { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Require rest parameters instead of `arguments`", recommended: false, - url: "https://eslint.org/docs/rules/prefer-rest-params" + url: "https://eslint.org/docs/latest/rules/prefer-rest-params" }, schema: [], messages: { preferRestParams: "Use the rest parameters instead of 'arguments'." } }, - create(context) { + const sourceCode = context.sourceCode; + /** * Reports a given reference. * @param {eslint-scope.Reference} reference A reference to report. @@ -118420,30 +105663,27 @@ module.exports = { messageId: "preferRestParams" }); } + /** * Reports references of the implicit `arguments` variable if exist. + * @param {ASTNode} node The node representing the function. * @returns {void} */ - - - function checkForArguments() { - const argumentsVar = getVariableOfArguments(context.getScope()); - + function checkForArguments(node) { + const argumentsVar = getVariableOfArguments(sourceCode.getScope(node)); if (argumentsVar) { argumentsVar.references.filter(isNotNormalMemberAccess).forEach(report); } } - return { "FunctionDeclaration:exit": checkForArguments, "FunctionExpression:exit": checkForArguments }; } - }; /***/ }), -/* 903 */ +/* 913 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -118453,7 +105693,10 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -118462,11 +105705,10 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @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. @@ -118474,28 +105716,25 @@ function isVariadicApplyCalling(node) { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Require spread operators instead of `.apply()`", recommended: false, - url: "https://eslint.org/docs/rules/prefer-spread" + url: "https://eslint.org/docs/latest/rules/prefer-spread" }, schema: [], fixable: null, @@ -118503,19 +105742,16 @@ module.exports = { preferSpread: "Use the spread operator instead of '.apply()'." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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, @@ -118523,14 +105759,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 904 */ +/* 914 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -118538,11 +105772,15 @@ module.exports = { * @fileoverview A rule to suggest using template literals instead of string concatenation. * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -118551,126 +105789,109 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @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; } + /** * Checks whether or not a node contains a string literal with an octal or non-octal decimal escape sequence * @param {ASTNode} node A node to check * @returns {boolean} `true` if at least one string literal within the node contains * an octal or non-octal decimal escape sequence */ - - function hasOctalOrNonOctalDecimalEscapeSequence(node) { if (isConcatenation(node)) { return hasOctalOrNonOctalDecimalEscapeSequence(node.left) || hasOctalOrNonOctalDecimalEscapeSequence(node.right); - } // No need to check TemplateLiterals – would throw parsing error - + } + // No need to check TemplateLiterals – would throw parsing error if (node.type === "Literal" && typeof node.value === "string") { return astUtils.hasOctalOrNonOctalDecimalEscapeSequence(node.raw); } - return false; } + /** * 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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Require template literals instead of string concatenation", recommended: false, - url: "https://eslint.org/docs/rules/prefer-template" + url: "https://eslint.org/docs/latest/rules/prefer-template" }, schema: [], fixable: "code", @@ -118678,22 +105899,22 @@ module.exports = { unexpectedStringConcatenation: "Unexpected string concatenation." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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 @@ -118701,8 +105922,6 @@ module.exports = { * @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") { /* @@ -118715,81 +105934,70 @@ module.exports = { if (matched.lastIndexOf("\\") % 2) { return `\\${matched}`; } + return matched; - return matched; // Unescape any quotes that appear in the original Literal that no longer need to be escaped. + // 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)) { 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 (hasOctalOrNonOctalDecimalEscapeSequence(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); - const topBinaryExpr = getTopConcatBinaryExpression(node.parent); // Checks whether or not this node had been checked already. - + // 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, @@ -118798,21 +106006,18 @@ module.exports = { }); } } - return { Program() { done = Object.create(null); }, - Literal: checkForStringConcat, TemplateLiteral: checkForStringConcat }; } - }; /***/ }), -/* 905 */ +/* 915 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -118820,28 +106025,27 @@ module.exports = { * @fileoverview Rule to flag non-quoted property names in object literals. * @author Mathias Bynens */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const espree = __webpack_require__(530); +const astUtils = __webpack_require__(639); +const keywords = __webpack_require__(679); -const espree = __webpack_require__(508); - -const astUtils = __webpack_require__(618); - -const keywords = __webpack_require__(653); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Require quotes around object literal property names", recommended: false, - url: "https://eslint.org/docs/rules/quote-props" + url: "https://eslint.org/docs/latest/rules/quote-props" }, schema: { anyOf: [{ @@ -118885,22 +106089,22 @@ module.exports = { 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(); + 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.sourceCode; + /** * 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.includes(tokenStr); } + /** * 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 @@ -118909,70 +106113,58 @@ module.exports = { * @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"].includes(tokens[0].type) || 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. - + } + // 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, @@ -119003,16 +106195,14 @@ module.exports = { }); } } + /** * 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, @@ -119024,39 +106214,33 @@ module.exports = { }); } } + /** * 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 = []; + unquotedProps = []; let keywordKeyName = null, - necessaryQuotes = false; + 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)) { @@ -119067,7 +106251,6 @@ module.exports = { unquotedProps.push(property); } }); - if (checkQuotesRedundancy && quotedProps.length && !necessaryQuotes) { quotedProps.forEach(property => { context.report({ @@ -119100,35 +106283,29 @@ module.exports = { }); } } - 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); } } - }; } - }; /***/ }), -/* 906 */ +/* 916 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -119136,15 +106313,18 @@ module.exports = { * @fileoverview A rule to choose between single and double quote marks * @author Matt DuVall , Brandon Payton */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Constants //------------------------------------------------------------------------------ - const QUOTE_SETTINGS = { double: { quote: "\"", @@ -119161,9 +106341,11 @@ const QUOTE_SETTINGS = { alternateQuote: "\"", description: "backtick" } -}; // An unescaped newline is a newline preceded by an even number of backslashes. +}; +// 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. @@ -119173,15 +106355,12 @@ const UNESCAPED_LINEBREAK_PATTERN = new RegExp(String.raw`(^|[^\\])(\\\\)*[${Arr * @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 @@ -119198,20 +106377,20 @@ QUOTE_SETTINGS.double.convert = QUOTE_SETTINGS.single.convert = QUOTE_SETTINGS.b return match; }) + newQuote; }; +const AVOID_ESCAPE = "avoid-escape"; -const AVOID_ESCAPE = "avoid-escape"; //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "layout", docs: { description: "Enforce the consistent use of either backticks, double, or single quotes", recommended: false, - url: "https://eslint.org/docs/rules/quotes" + url: "https://eslint.org/docs/latest/rules/quotes" }, fixable: "code", schema: [{ @@ -119236,18 +106415,19 @@ module.exports = { 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 + settings = QUOTE_SETTINGS[quoteOption || "double"], + options = context.options[1], + allowTemplateLiterals = options && options.allowTemplateLiterals === true, + sourceCode = context.sourceCode; + let avoidEscape = options && options.avoidEscape === true; + // deprecated if (options === AVOID_ESCAPE) { avoidEscape = true; } + /** * Determines if a given node is part of JSX syntax. * @@ -119268,11 +106448,10 @@ module.exports = { * @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. @@ -119280,11 +106459,10 @@ module.exports = { * @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 @@ -119292,116 +106470,97 @@ module.exports = { * @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. - + } + // 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. + // LiteralPropertyName. case "Property": case "PropertyDefinition": case "MethodDefinition": return parent.key === node && !parent.computed; - // ModuleSpecifier. + // ModuleSpecifier. case "ImportDeclaration": case "ExportNamedDeclaration": return parent.source === node; - // ModuleExportName or ModuleSpecifier. + // ModuleExportName or ModuleSpecifier. case "ExportAllDeclaration": return parent.exported === node || parent.source === node; - // ModuleExportName. + // ModuleExportName. case "ImportSpecifier": return parent.imported === node; - // ModuleExportName. + // ModuleExportName. case "ExportSpecifier": return parent.local === node || parent.exported === node; - // Others don't allow. + // 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; - + 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.includes(settings.quote); } - if (!isValid) { context.report({ node, @@ -119409,7 +106568,6 @@ module.exports = { data: { description: settings.description }, - fix(fixer) { if (quoteOption === "backtick" && astUtils.hasOctalOrNonOctalDecimalEscapeSequence(rawVal)) { /* @@ -119418,28 +106576,23 @@ module.exports = { */ 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)) { /* @@ -119449,20 +106602,16 @@ module.exports = { */ return null; } - return fixer.replaceText(node, settings.convert(sourceCode.getText(node))); } - }); } - }; } - }; /***/ }), -/* 907 */ +/* 917 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -119470,40 +106619,43 @@ module.exports = { * @fileoverview Rule to flag use of parseInt without a radix argument * @author James Allardice */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - const MODE_ALWAYS = "always", - MODE_AS_NEEDED = "as-needed"; + 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. * @@ -119514,34 +106666,31 @@ function isParseIntMethod(node) { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce the consistent use of the radix argument when using `parseInt()`", recommended: false, - url: "https://eslint.org/docs/rules/radix" + url: "https://eslint.org/docs/latest/rules/radix" }, hasSuggestions: true, schema: [{ @@ -119555,19 +106704,18 @@ module.exports = { addRadixParameter10: "Add radix parameter `10` for parsing decimal numbers." } }, - create(context) { const mode = context.options[0] || MODE_ALWAYS; + const sourceCode = context.sourceCode; + /** * 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({ @@ -119575,7 +106723,6 @@ module.exports = { messageId: "missingParameters" }); break; - case 1: if (mode === MODE_ALWAYS) { context.report({ @@ -119583,24 +106730,17 @@ module.exports = { messageId: "missingRadix", suggest: [{ messageId: "addRadixParameter10", - fix(fixer) { - const sourceCode = context.getSourceCode(); const tokens = sourceCode.getTokens(node); const lastToken = tokens[tokens.length - 1]; // Parenthesis. - const secondToLastToken = tokens[tokens.length - 2]; // May or may not be a comma. - const hasTrailingComma = secondToLastToken.type === "Punctuator" && secondToLastToken.value === ","; return fixer.insertTextBefore(lastToken, hasTrailingComma ? " 10," : ", 10"); } - }] }); } - break; - default: if (mode === MODE_AS_NEEDED && isDefaultRadix(args[1])) { context.report({ @@ -119613,50 +106753,43 @@ module.exports = { messageId: "invalidRadix" }); } - break; } } - return { - "Program:exit"() { - const scope = context.getScope(); - let variable; // Check `parseInt()` + "Program:exit"(node) { + const scope = sourceCode.getScope(node); + 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); + const idNode = reference.identifier; + if (astUtils.isCallee(idNode)) { + checkArguments(idNode.parent); } }); - } // Check `Number.parseInt()` - + } + // 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)) { + const parentNode = reference.identifier.parent; + const maybeCallee = parentNode.parent.type === "ChainExpression" ? parentNode.parent : parentNode; + if (isParseIntMethod(parentNode) && astUtils.isCallee(maybeCallee)) { checkArguments(maybeCallee.parent); } }); } } - }; } - }; /***/ }), -/* 908 */ +/* 918 */ /***/ ((module) => { "use strict"; @@ -119666,189 +106799,164 @@ module.exports = { * @author Toru Nagashima */ + /** * 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) { let outReferenceMap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Map(); - for (const reference of scope.references) { if (reference.resolved === null) { continue; } - 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 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); } + /** * Represents segment information. */ - - class SegmentInfo { constructor() { this.info = new WeakMap(); } + /** * Initialize the segment information. * @param {PathSegment} segment The segment to initialize. * @returns {void} */ - - initialize(segment) { const outdatedReadVariables = new Set(); const freshReadVariables = new Set(); - for (const prevSegment of segment.prevSegments) { const info = this.info.get(prevSegment); - if (info) { info.outdatedReadVariables.forEach(Set.prototype.add, outdatedReadVariables); info.freshReadVariables.forEach(Set.prototype.add, freshReadVariables); } } - this.info.set(segment, { outdatedReadVariables, freshReadVariables }); } + /** * Mark a given variable as read on given segments. * @param {PathSegment[]} segments The segments that it read the variable on. * @param {Variable} variable The variable to be read. * @returns {void} */ - - markAsRead(segments, variable) { for (const segment of segments) { const info = this.info.get(segment); - if (info) { - info.freshReadVariables.add(variable); // If a variable is freshly read again, then it's no more out-dated. + info.freshReadVariables.add(variable); + // If a variable is freshly read again, then it's no more out-dated. info.outdatedReadVariables.delete(variable); } } } + /** * Move `freshReadVariables` to `outdatedReadVariables`. * @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.freshReadVariables.forEach(Set.prototype.add, info.outdatedReadVariables); info.freshReadVariables.clear(); } } } + /** * Check if a given variable is outdated on the current segments. * @param {PathSegment[]} segments The current segments. * @param {Variable} variable The variable to check. * @returns {boolean} `true` if the variable is outdated on the segments. */ - - isOutdated(segments, variable) { for (const segment of segments) { const info = this.info.get(segment); - if (info && info.outdatedReadVariables.has(variable)) { return true; } } - return false; } +} -} //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Disallow assignments that can lead to race conditions due to usage of `await` or `yield`", recommended: false, - url: "https://eslint.org/docs/rules/require-atomic-updates" + url: "https://eslint.org/docs/latest/rules/require-atomic-updates" }, fixable: null, schema: [{ @@ -119866,16 +106974,15 @@ module.exports = { nonAtomicObjectUpdate: "Possible race condition: `{{value}}` might be assigned based on an outdated state of `{{object}}`." } }, - create(context) { const allowProperties = !!context.options[0] && context.options[0].allowProperties; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const assignmentReferences = new Map(); const segmentInfo = new SegmentInfo(); let stack = null; return { - onCodePathStart(codePath) { - const scope = context.getScope(); + onCodePathStart(codePath, node) { + const scope = sourceCode.getScope(node); const shouldVerify = scope.type === "function" && (scope.block.async || scope.block.generator); stack = { upper: stack, @@ -119883,54 +106990,49 @@ module.exports = { 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. + const reference = referenceMap && referenceMap.get(node); + // Ignore if this is not a valid variable reference. if (!reference) { return; } - const variable = reference.resolved; const writeExpr = getWriteExpr(reference); - const isMemberAccess = reference.identifier.parent.type === "MemberExpression"; // Add a fresh read variable. + const isMemberAccess = reference.identifier.parent.type === "MemberExpression"; + // Add a fresh read variable. if (reference.isRead() && !(writeExpr && writeExpr.parent.operator === "=")) { segmentInfo.markAsRead(codePath.currentSegments, variable); } + /* * 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. + 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 `outdatedReadVariables` list, report it. @@ -119939,26 +107041,24 @@ module.exports = { const { codePath, referenceMap - } = stack; // referenceMap exists if this is in a resumable function scope. + } = stack; + // referenceMap exists if this is in a resumable function scope. if (!referenceMap) { return; - } // Mark the read variables on this code path as outdated. - + } + // Mark the read variables on this code path as outdated. if (node.type === "AwaitExpression" || node.type === "YieldExpression") { segmentInfo.makeOutdated(codePath.currentSegments); - } // Verify. - + } + // Verify. const references = assignmentReferences.get(node); - if (references) { assignmentReferences.delete(node); - for (const reference of references) { const variable = reference.resolved; - if (segmentInfo.isOutdated(codePath.currentSegments, variable)) { if (node.parent.left === reference.identifier) { context.report({ @@ -119982,14 +107082,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 909 */ +/* 919 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -119997,11 +107095,15 @@ module.exports = { * @fileoverview Rule to disallow async functions which have no `await` expression. * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -120010,53 +107112,49 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Disallow async functions which have no `await` expression", recommended: false, - url: "https://eslint.org/docs/rules/require-await" + url: "https://eslint.org/docs/latest/rules/require-await" }, schema: [], messages: { missingAwait: "{{name}} has no 'await' expression." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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({ @@ -120068,10 +107166,8 @@ module.exports = { } }); } - scopeInfo = scopeInfo.upper; } - return { FunctionDeclaration: enterFunction, FunctionExpression: enterFunction, @@ -120079,32 +107175,26 @@ module.exports = { "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; } } - }; } - }; /***/ }), -/* 910 */ +/* 920 */ /***/ ((module) => { "use strict"; @@ -120114,15 +107204,15 @@ module.exports = { * @deprecated in ESLint v5.10.0 */ -/** @type {import('../shared/types').Rule} */ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { description: "Require JSDoc comments", recommended: false, - url: "https://eslint.org/docs/rules/require-jsdoc" + url: "https://eslint.org/docs/latest/rules/require-jsdoc" }, schema: [{ type: "object", @@ -120163,9 +107253,8 @@ module.exports = { missingJSDocComment: "Missing JSDoc comment." } }, - create(context) { - const source = context.getSourceCode(); + const source = context.sourceCode; const DEFAULT_OPTIONS = { FunctionDeclaration: true, MethodDefinition: false, @@ -120174,65 +107263,57 @@ module.exports = { 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); } } - }; } - }; /***/ }), -/* 911 */ +/* 921 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -120240,51 +107321,63 @@ module.exports = { * @fileoverview Rule to enforce the use of `u` flag on RegExp. * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant -} = __webpack_require__(571); //------------------------------------------------------------------------------ +} = __webpack_require__(594); +const astUtils = __webpack_require__(639); +const { + isValidWithUnicodeFlag +} = __webpack_require__(801); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce the use of `u` flag on RegExp", recommended: false, - url: "https://eslint.org/docs/rules/require-unicode-regexp" + url: "https://eslint.org/docs/latest/rules/require-unicode-regexp" }, + hasSuggestions: true, messages: { + addUFlag: "Add the 'u' flag.", requireUFlag: "Use the 'u' flag." }, schema: [] }, - create(context) { + const sourceCode = context.sourceCode; return { "Literal[regex]"(node) { const flags = node.regex.flags || ""; - if (!flags.includes("u")) { context.report({ + messageId: "requireUFlag", node, - messageId: "requireUFlag" + suggest: isValidWithUnicodeFlag(context.languageOptions.ecmaVersion, node.regex.pattern) ? [{ + fix(fixer) { + return fixer.insertTextAfter(node, "u"); + }, + messageId: "addUFlag" + }] : null }); } }, - - Program() { - const scope = context.getScope(); + Program(node) { + const scope = sourceCode.getScope(node); const tracker = new ReferenceTracker(scope); const trackMap = { RegExp: { @@ -120292,29 +107385,48 @@ module.exports = { [CONSTRUCT]: true } }; - for (const { - node + node: refNode } of tracker.iterateGlobalReferences(trackMap)) { - const flagsNode = node.arguments[1]; + const [patternNode, flagsNode] = refNode.arguments; + if (patternNode && patternNode.type === "SpreadElement") { + continue; + } + const pattern = getStringIfConstant(patternNode, scope); const flags = getStringIfConstant(flagsNode, scope); - if (!flagsNode || typeof flags === "string" && !flags.includes("u")) { context.report({ - node, - messageId: "requireUFlag" + messageId: "requireUFlag", + node: refNode, + suggest: typeof pattern === "string" && isValidWithUnicodeFlag(context.languageOptions.ecmaVersion, pattern) ? [{ + fix(fixer) { + if (flagsNode) { + if (flagsNode.type === "Literal" && typeof flagsNode.value === "string" || flagsNode.type === "TemplateLiteral") { + const flagsNodeText = sourceCode.getText(flagsNode); + return fixer.replaceText(flagsNode, [flagsNodeText.slice(0, flagsNodeText.length - 1), flagsNodeText.slice(flagsNodeText.length - 1)].join("u")); + } + + // We intentionally don't suggest concatenating + "u" to non-literals + return null; + } + const penultimateToken = sourceCode.getLastToken(refNode, { + skip: 1 + }); // skip closing parenthesis + + return fixer.insertTextAfter(penultimateToken, astUtils.isCommaToken(penultimateToken) ? ' "u",' : ', "u"'); + }, + messageId: "addUFlag" + }] : null }); } } } - }; } - }; /***/ }), -/* 912 */ +/* 922 */ /***/ ((module) => { "use strict"; @@ -120322,54 +107434,52 @@ module.exports = { * @fileoverview Rule to flag the generator functions that does not have yield. * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Require generator functions to contain `yield`", recommended: true, - url: "https://eslint.org/docs/rules/require-yield" + url: "https://eslint.org/docs/latest/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, @@ -120377,27 +107487,23 @@ module.exports = { }); } } - return { FunctionDeclaration: beginChecking, "FunctionDeclaration:exit": endChecking, FunctionExpression: beginChecking, "FunctionExpression:exit": endChecking, - // Increases the count of `yield` keyword. YieldExpression() { if (stack.length > 0) { stack[stack.length - 1] += 1; } } - }; } - }; /***/ }), -/* 913 */ +/* 923 */ /***/ ((module) => { "use strict"; @@ -120405,19 +107511,21 @@ module.exports = { * @fileoverview Enforce spacing between rest and spread operators and their expressions. * @author Kai Cataldo */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "layout", docs: { description: "Enforce spacing between rest and spread operators and their expressions", recommended: false, - url: "https://eslint.org/docs/rules/rest-spread-spacing" + url: "https://eslint.org/docs/latest/rules/rest-spread-spacing" }, fixable: "whitespace", schema: [{ @@ -120428,10 +107536,11 @@ module.exports = { expectedWhitespace: "Expected whitespace after {{type}} operator." } }, - create(context) { - const sourceCode = context.getSourceCode(), - alwaysSpace = context.options[0] === "always"; //-------------------------------------------------------------------------- + const sourceCode = context.sourceCode, + alwaysSpace = context.options[0] === "always"; + + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -120440,44 +107549,33 @@ module.exports = { * @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); + 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, @@ -120486,11 +107584,9 @@ module.exports = { data: { type }, - fix(fixer) { return fixer.replaceTextRange([operator.range[1], nextToken.range[0]], " "); } - }); } else if (!alwaysSpace && hasWhitespace) { context.report({ @@ -120503,18 +107599,17 @@ module.exports = { data: { type }, - fix(fixer) { return fixer.removeRange([operator.range[1], nextToken.range[0]]); } - }); } - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- - return { SpreadElement: checkWhiteSpace, RestElement: checkWhiteSpace, @@ -120522,11 +107617,10 @@ module.exports = { ExperimentalRestProperty: checkWhiteSpace }; } - }; /***/ }), -/* 914 */ +/* 924 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -120534,26 +107628,26 @@ module.exports = { * @fileoverview Rule to flag missing semicolons. * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const FixTracker = __webpack_require__(759); +const astUtils = __webpack_require__(639); -const FixTracker = __webpack_require__(752); - -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Require or disallow semicolons instead of ASI", recommended: false, - url: "https://eslint.org/docs/rules/semi" + url: "https://eslint.org/docs/latest/rules/semi" }, fixable: "code", schema: { @@ -120581,6 +107675,9 @@ module.exports = { properties: { omitLastInOneLineBlock: { type: "boolean" + }, + omitLastInOneLineClassBody: { + type: "boolean" } }, additionalProperties: false @@ -120594,17 +107691,18 @@ module.exports = { extraSemi: "Extra semicolon." } }, - create(context) { const OPT_OUT_PATTERN = /^[-[(/+`]/u; // One of [(/+-` - const unsafeClassFieldNames = new Set(["get", "set", "static"]); const unsafeClassFieldFollowers = new Set(["*", "in", "instanceof"]); const options = context.options[1]; const never = context.options[0] === "never"; const exceptOneLine = Boolean(options && options.omitLastInOneLineBlock); + const exceptOneLineClassBody = Boolean(options && options.omitLastInOneLineClassBody); const beforeStatementContinuationChars = options && options.beforeStatementContinuationChars || "any"; - const sourceCode = context.getSourceCode(); //-------------------------------------------------------------------------- + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -120614,25 +107712,21 @@ module.exports = { * @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 @@ -120642,7 +107736,6 @@ module.exports = { return new FixTracker(fixer, sourceCode).retainSurroundingTokens(lastToken).remove(lastToken); }; } - context.report({ node, loc, @@ -120650,32 +107743,30 @@ module.exports = { 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"; } + /** * Checks if a given PropertyDefinition node followed by a semicolon * can safely remove that semicolon. It is not to safe to remove if @@ -120685,25 +107776,22 @@ module.exports = { * @returns {boolean} `true` if the node cannot have the semicolon * removed. */ - - function maybeClassFieldAsiHazard(node) { if (node.type !== "PropertyDefinition") { return false; } + /* * Computed property names and non-identifiers are always safe * as they can be distinguished from keywords easily. */ - - const needsNameCheck = !node.computed && node.key.type === "Identifier"; + /* * Certain names are problematic unless they also have a * a way to distinguish between keywords and property * names. */ - if (needsNameCheck && unsafeClassFieldNames.has(node.key.name)) { /* * Special case: If the field name is `static`, @@ -120711,69 +107799,61 @@ module.exports = { * so "static static" is okay but "static" is not. */ const isStaticStatic = node.static && node.key.name === "static"; + /* * For other unsafe names, we only care if there is no * initializer. No initializer = hazard. */ - if (!isStaticStatic && !node.value) { return true; } } - const followingToken = sourceCode.getTokenAfter(node); return unsafeClassFieldFollowers.has(followingToken.value); } + /** * 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 `}`). @@ -120781,8 +107861,6 @@ module.exports = { * @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 `;}` @@ -120791,12 +107869,11 @@ module.exports = { if (maybeClassFieldAsiHazard(node)) { return false; } - if (isOnSameLineWithNextToken(node)) { return false; // One liner. - } // continuation characters should not apply to class fields - + } + // continuation characters should not apply to class fields if (node.type !== "PropertyDefinition" && beforeStatementContinuationChars === "never" && !maybeAsiHazardAfter(node)) { return true; // ASI works. This statement doesn't connect to the next. } @@ -120807,6 +107884,7 @@ module.exports = { return false; } + /** * Checks a node to see if it's the last item in a one-liner block. * Block is any `BlockStatement` or `StaticBlock` node. Block is a one-liner if its @@ -120814,20 +107892,15 @@ module.exports = { * @param {ASTNode} node The node to check. * @returns {boolean} whether the node is the last item in a one-liner block. */ - - function isLastInOneLinerBlock(node) { const parent = node.parent; const nextToken = sourceCode.getTokenAfter(node); - if (!nextToken || nextToken.value !== "}") { return false; } - if (parent.type === "BlockStatement") { return parent.loc.start.line === parent.loc.end.line; } - if (parent.type === "StaticBlock") { const openingBrace = sourceCode.getFirstToken(parent, { skip: 1 @@ -120835,19 +107908,34 @@ module.exports = { return openingBrace.loc.start.line === parent.loc.end.line; } - return false; } + + /** + * Checks a node to see if it's the last item in a one-liner `ClassBody` node. + * ClassBody is a one-liner if its braces (and consequently everything between them) are on the same line. + * @param {ASTNode} node The node to check. + * @returns {boolean} whether the node is the last item in a one-liner ClassBody. + */ + function isLastInOneLinerClassBody(node) { + const parent = node.parent; + const nextToken = sourceCode.getTokenAfter(node); + if (!nextToken || nextToken.value !== "}") { + return false; + } + if (parent.type === "ClassBody") { + return parent.loc.start.line === parent.loc.end.line; + } + return false; + } + /** * 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); @@ -120856,32 +107944,32 @@ module.exports = { } } else { const oneLinerBlock = exceptOneLine && isLastInOneLinerBlock(node); - - if (isSemi && oneLinerBlock) { + const oneLinerClassBody = exceptOneLineClassBody && isLastInOneLinerClassBody(node); + const oneLinerBlockOrClassBody = oneLinerBlock || oneLinerClassBody; + if (isSemi && oneLinerBlockOrClassBody) { report(node, true); - } else if (!isSemi && !oneLinerBlock) { + } else if (!isSemi && !oneLinerBlockOrClassBody) { 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, @@ -120893,27 +107981,23 @@ module.exports = { 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); } }, - PropertyDefinition: checkForSemicolon }; } - }; /***/ }), -/* 915 */ +/* 925 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -120923,20 +108007,21 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ + +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent spacing before and after semicolons", recommended: false, - url: "https://eslint.org/docs/rules/semi-spacing" + url: "https://eslint.org/docs/latest/rules/semi-spacing" }, fixable: "whitespace", schema: [{ @@ -120960,72 +108045,66 @@ module.exports = { missingWhitespaceAfter: "Missing whitespace after semicolon." } }, - create(context) { const config = context.options[0], - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; let requireSpaceBefore = false, - requireSpaceAfter = true; - + 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 : * @@ -121044,8 +108123,6 @@ module.exports = { * @param {ASTNode} node The corresponding node of the token. * @returns {void} */ - - function checkSemicolonSpacing(token, node) { if (astUtils.isSemicolonToken(token)) { if (hasLeadingSpace(token)) { @@ -121059,11 +108136,9 @@ module.exports = { node, loc, messageId: "unexpectedWhitespaceBefore", - fix(fixer) { return fixer.removeRange([tokenBefore.range[1], token.range[0]]); } - }); } } else { @@ -121073,15 +108148,12 @@ module.exports = { node, loc, messageId: "missingWhitespaceBefore", - fix(fixer) { return fixer.insertTextBefore(token, " "); } - }); } } - if (!isFirstTokenInCurrentLine(token) && !isLastTokenInCurrentLine(token) && !isBeforeClosingParen(token)) { if (hasTrailingSpace(token)) { if (!requireSpaceAfter) { @@ -121094,11 +108166,9 @@ module.exports = { node, loc, messageId: "unexpectedWhitespaceAfter", - fix(fixer) { return fixer.removeRange([token.range[1], tokenAfter.range[0]]); } - }); } } else { @@ -121108,29 +108178,25 @@ module.exports = { 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, @@ -121144,25 +108210,21 @@ module.exports = { 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); } }, - PropertyDefinition: checkNode }; } - }; /***/ }), -/* 916 */ +/* 926 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -121170,16 +108232,20 @@ module.exports = { * @fileoverview Rule to enforce location of semicolons. * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ - const SELECTOR = ["BreakStatement", "ContinueStatement", "DebuggerStatement", "DoWhileStatement", "ExportAllDeclaration", "ExportDefaultDeclaration", "ExportNamedDeclaration", "ExpressionStatement", "ImportDeclaration", "ReturnStatement", "ThrowStatement", "VariableDeclaration", "PropertyDefinition"].join(","); + /** * Get the child node list of a given node. * This returns `BlockStatement#body`, `StaticBlock#body`, `Program#body`, @@ -121188,53 +108254,44 @@ const SELECTOR = ["BreakStatement", "ContinueStatement", "DebuggerStatement", "D * @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 === "StaticBlock" || t === "Program" || t === "ClassBody") { 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. } + /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce location of semicolons", recommended: false, - url: "https://eslint.org/docs/rules/semi-style" + url: "https://eslint.org/docs/latest/rules/semi-style" }, schema: [{ enum: ["last", "first"] @@ -121244,23 +108301,21 @@ module.exports = { expectedSemiColon: "Expected this semicolon to be at {{pos}}." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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, @@ -121268,55 +108323,44 @@ module.exports = { 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"); } } - }; } - }; /***/ }), -/* 917 */ +/* 927 */ /***/ ((module) => { "use strict"; @@ -121324,19 +108368,21 @@ module.exports = { * @fileoverview Rule to require sorting of import declarations * @author Christian Schuller */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce sorted import declarations within modules", recommended: false, - url: "https://eslint.org/docs/rules/sort-imports" + url: "https://eslint.org/docs/latest/rules/sort-imports" }, schema: [{ type: "object", @@ -121376,16 +108422,16 @@ module.exports = { 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(); + 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.sourceCode; let previousDeclaration = null; + /** * Gets the used member syntax style. * @@ -121396,46 +108442,40 @@ module.exports = { * @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 @@ -121445,12 +108485,9 @@ module.exports = { * @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) { @@ -121458,24 +108495,21 @@ module.exports = { // reset declaration sort previousDeclaration = null; } - if (previousDeclaration) { const currentMemberSyntaxGroupIndex = getMemberParameterGroupIndex(node), - previousMemberSyntaxGroupIndex = getMemberParameterGroupIndex(previousDeclaration); + previousMemberSyntaxGroupIndex = getMemberParameterGroupIndex(previousDeclaration); let currentLocalMemberName = getFirstLocalMemberName(node), - previousLocalMemberName = getFirstLocalMemberName(previousDeclaration); - + 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({ @@ -121496,15 +108530,12 @@ module.exports = { } } } - 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], @@ -121512,38 +108543,39 @@ module.exports = { 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 - 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 + // 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 + }) + + // 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; }, "")); } - }); } } } - }; } - }; /***/ }), -/* 918 */ +/* 928 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -121551,12 +108583,16 @@ module.exports = { * @fileoverview Rule to require object keys to be sorted * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639), + naturalCompare = __webpack_require__(929); -const astUtils = __webpack_require__(618), - naturalCompare = __webpack_require__(919); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -121571,17 +108607,14 @@ const astUtils = __webpack_require__(618), * @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. * @@ -121589,54 +108622,45 @@ function getPropertyName(node) { * 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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Require object keys to be sorted", recommended: false, - url: "https://eslint.org/docs/rules/sort-keys" + url: "https://eslint.org/docs/latest/rules/sort-keys" }, schema: [{ enum: ["asc", "desc"] @@ -121667,7 +108691,6 @@ module.exports = { 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"; @@ -121676,10 +108699,11 @@ module.exports = { const natural = options && options.natural; const minKeys = options && options.minKeys; const allowLineSeparatedGroups = options && options.allowLineSeparatedGroups || false; - const isValidOrder = isValidOrders[order + (insensitive ? "I" : "") + (natural ? "N" : "")]; // The stack to save the previous property's name for each object literals. + const isValidOrder = isValidOrders[order + (insensitive ? "I" : "") + (natural ? "N" : "")]; + // The stack to save the previous property's name for each object literals. let stack = null; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; return { ObjectExpression(node) { stack = { @@ -121690,66 +108714,57 @@ module.exports = { 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); // Get tokens between current node and previous node + const thisName = getPropertyName(node); + // Get tokens between current node and previous node const tokens = stack.prevNode && sourceCode.getTokensBetween(stack.prevNode, node, { includeComments: true }); let isBlankLineBetweenNodes = stack.prevBlankLine; - if (tokens) { // check blank line between tokens tokens.forEach((token, index) => { const previousToken = tokens[index - 1]; - if (previousToken && token.loc.start.line - previousToken.loc.end.line > 1) { isBlankLineBetweenNodes = true; } - }); // check blank line between the current node and the last token + }); + // check blank line between the current node and the last token if (!isBlankLineBetweenNodes && node.loc.start.line - tokens[tokens.length - 1].loc.end.line > 1) { isBlankLineBetweenNodes = true; - } // check blank line between the first token and the previous node - + } + // check blank line between the first token and the previous node if (!isBlankLineBetweenNodes && tokens[0].loc.start.line - stack.prevNode.loc.end.line > 1) { isBlankLineBetweenNodes = true; } } - stack.prevNode = node; - if (thisName !== null) { stack.prevName = thisName; } - if (allowLineSeparatedGroups && isBlankLineBetweenNodes) { stack.prevBlankLine = thisName === null; return; } - if (prevName === null || thisName === null || numKeys < minKeys) { return; } - if (!isValidOrder(prevName, thisName)) { context.report({ node, @@ -121765,14 +108780,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 919 */ +/* 929 */ /***/ ((module) => { /* @@ -121782,21 +108795,19 @@ module.exports = { * @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; - + 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 @@ -121804,22 +108815,18 @@ var naturalCompare = function (a, b) { : 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) { @@ -121827,7 +108834,7 @@ try { } /***/ }), -/* 920 */ +/* 930 */ /***/ ((module) => { "use strict"; @@ -121835,19 +108842,21 @@ try { * @fileoverview Rule to require sorting of variables within a single Variable Declaration block * @author Ilya Volodin */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Require variables within the same declaration block to be sorted", recommended: false, - url: "https://eslint.org/docs/rules/sort-vars" + url: "https://eslint.org/docs/latest/rules/sort-vars" }, schema: [{ type: "object", @@ -121864,11 +108873,10 @@ module.exports = { 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(); + ignoreCase = configuration.ignoreCase || false, + sourceCode = context.sourceCode; return { VariableDeclaration(node) { const idDeclarations = node.declarations.filter(decl => decl.id.type === "Identifier"); @@ -121877,47 +108885,46 @@ module.exports = { let fixed = false; idDeclarations.slice(1).reduce((memo, decl) => { const lastVariableName = getSortableName(memo), - currentVariableName = getSortableName(decl); - + 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 - 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 + // 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 + }) + + // 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]); } - }; } - }; /***/ }), -/* 921 */ +/* 931 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -121925,11 +108932,15 @@ module.exports = { * @fileoverview A rule to ensure whitespace before blocks. * @author Mathias Schreck */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -121938,25 +108949,23 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @param {ASTNode} node the node to check. * @returns {boolean} `true` if the node is function body. */ - - function isFunctionBody(node) { const parent = node.parent; return node.type === "BlockStatement" && astUtils.isFunction(parent) && parent.body === node; -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent spacing before blocks", recommended: false, - url: "https://eslint.org/docs/rules/space-before-blocks" + url: "https://eslint.org/docs/latest/rules/space-before-blocks" }, fixable: "whitespace", schema: [{ @@ -121983,17 +108992,15 @@ module.exports = { missingSpace: "Missing space before opening brace." } }, - create(context) { const config = context.options[0], - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; let alwaysFunctions = true, - alwaysKeywords = true, - alwaysClasses = true, - neverFunctions = false, - neverKeywords = false, - neverClasses = false; - + alwaysKeywords = true, + alwaysClasses = true, + neverFunctions = false, + neverKeywords = false, + neverClasses = false; if (typeof config === "object") { alwaysFunctions = config.functions === "always"; alwaysKeywords = config.keywords === "always"; @@ -122009,6 +109016,7 @@ module.exports = { neverKeywords = true; neverClasses = true; } + /** * Checks whether the spacing before the given block is already controlled by another rule: * - `arrow-spacing` checks spaces after `=>`. @@ -122018,26 +109026,21 @@ module.exports = { * @param {ASTNode|Token} node `BlockStatement` node or `{` token of a `SwitchStatement` node. * @returns {boolean} `true` if requiring or disallowing spaces before the given block could produce conflicts with other rules. */ - - function isConflicted(precedingToken, node) { return astUtils.isArrowToken(precedingToken) || astUtils.isKeywordToken(precedingToken) && !isFunctionBody(node) || astUtils.isColonToken(precedingToken) && node.parent && node.parent.type === "SwitchCase" && precedingToken === astUtils.getSwitchCaseColonToken(node.parent, sourceCode); } + /** * 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, node) && astUtils.isTokenOnSameLine(precedingToken, node)) { const hasSpace = sourceCode.isSpaceBetweenTokens(precedingToken, node); let requireSpace; let requireNoSpace; - if (isFunctionBody(node)) { requireSpace = alwaysFunctions; requireNoSpace = neverFunctions; @@ -122048,61 +109051,51 @@ module.exports = { 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 }; } - }; /***/ }), -/* 922 */ +/* 932 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -122110,24 +109103,25 @@ module.exports = { * @fileoverview Rule to validate spacing before function paren. * @author Mathias Schreck */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent spacing before `function` definition opening parenthesis", recommended: false, - url: "https://eslint.org/docs/rules/space-before-function-paren" + url: "https://eslint.org/docs/latest/rules/space-before-function-paren" }, fixable: "whitespace", schema: [{ @@ -122154,32 +109148,29 @@ module.exports = { missingSpace: "Missing space before function parentheses." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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 @@ -122189,31 +109180,28 @@ module.exports = { return overrideConfig.asyncArrow || baseConfig; } } else if (isNamedFunction(node)) { - return overrideConfig.named || baseConfig; // `generator-star-spacing` should warn anonymous generators. E.g. `function* () {}` + 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, @@ -122222,17 +109210,15 @@ module.exports = { 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 + 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({ @@ -122243,18 +109229,16 @@ module.exports = { }); } } - return { ArrowFunctionExpression: checkFunction, FunctionDeclaration: checkFunction, FunctionExpression: checkFunction }; } - }; /***/ }), -/* 923 */ +/* 933 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -122264,20 +109248,20 @@ module.exports = { */ -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent spacing inside parentheses", recommended: false, - url: "https://eslint.org/docs/rules/space-in-parens" + url: "https://eslint.org/docs/latest/rules/space-in-parens" }, fixable: "whitespace", schema: [{ @@ -122302,206 +109286,180 @@ module.exports = { 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 = {}; + 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 = []; - + 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.sourceCode; - - 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 + 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 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 is an opening paren and is followed by a disallowed space if (token.value === "(" && openerRejectsSpace(token, nextToken)) { context.report({ node, @@ -122510,29 +109468,25 @@ module.exports = { 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 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 is a closing paren and is preceded by a disallowed space if (token.value === ")" && closerRejectsSpace(prevToken, token)) { context.report({ node, @@ -122541,22 +109495,19 @@ module.exports = { end: token.loc.start }, messageId: "rejectedClosingSpace", - fix(fixer) { return fixer.removeRange([prevToken.range[1], token.range[0]]); } - }); } }); } }; } - }; /***/ }), -/* 924 */ +/* 934 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -122568,20 +109519,20 @@ module.exports = { const { isEqToken -} = __webpack_require__(618); //------------------------------------------------------------------------------ +} = __webpack_require__(639); + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Require spacing around infix operators", recommended: false, - url: "https://eslint.org/docs/rules/space-infix-ops" + url: "https://eslint.org/docs/latest/rules/space-infix-ops" }, fixable: "whitespace", schema: [{ @@ -122598,10 +109549,10 @@ module.exports = { missingSpace: "Operator '{{operator}}' must be spaced." } }, - create(context) { const int32Hint = context.options[0] ? context.options[0].int32Hint === true : false; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * Returns the first token which violates the rule * @param {ASTNode} left The left node of the main node @@ -122610,18 +109561,16 @@ module.exports = { * @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 @@ -122629,8 +109578,6 @@ module.exports = { * @returns {void} * @private */ - - function report(mainNode, culpritToken) { context.report({ node: mainNode, @@ -122639,89 +109586,75 @@ module.exports = { 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 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); } - 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, @@ -122729,34 +109662,29 @@ module.exports = { LogicalExpression: checkBinary, ConditionalExpression: checkConditional, VariableDeclarator: checkVar, - PropertyDefinition(node) { if (!node.value) { return; } + /* * Because of computed properties and type annotations, some * tokens may exist between `node.key` and `=`. * Therefore, find the `=` from the right. */ - - const operatorToken = sourceCode.getTokenBefore(node.value, isEqToken); const leftToken = sourceCode.getTokenBefore(operatorToken); const rightToken = sourceCode.getTokenAfter(operatorToken); - if (!sourceCode.isSpaceBetweenTokens(leftToken, operatorToken) || !sourceCode.isSpaceBetweenTokens(operatorToken, rightToken)) { report(node, operatorToken); } } - }; } - }; /***/ }), -/* 925 */ +/* 935 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -122764,24 +109692,25 @@ module.exports = { * @fileoverview This rule should require or disallow spaces before or after unary operations. * @author Marcin Kumorek */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce consistent spacing before or after unary operators", recommended: false, - url: "https://eslint.org/docs/rules/space-unary-ops" + url: "https://eslint.org/docs/latest/rules/space-unary-ops" }, fixable: "whitespace", schema: [{ @@ -122813,13 +109742,14 @@ module.exports = { beforeUnaryExpressions: "Space is required before unary expressions '{{token}}'." } }, - create(context) { const options = context.options[0] || { words: true, nonwords: false }; - const sourceCode = context.getSourceCode(); //-------------------------------------------------------------------------- + const sourceCode = context.sourceCode; + + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -122828,30 +109758,28 @@ module.exports = { * @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 @@ -122860,8 +109788,6 @@ module.exports = { * @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({ @@ -122870,14 +109796,13 @@ module.exports = { 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 @@ -122886,8 +109811,6 @@ module.exports = { * @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]) { @@ -122897,15 +109820,14 @@ module.exports = { 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 @@ -122914,8 +109836,6 @@ module.exports = { * @param {string} word The word to be used for reporting * @returns {void} */ - - function checkUnaryWordOperatorForSpaces(node, firstToken, secondToken, word) { if (overrideExistsForOperator(word)) { if (overrideEnforcesSpaces(word)) { @@ -122929,34 +109849,31 @@ module.exports = { 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"; - + 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 @@ -122964,14 +109881,11 @@ module.exports = { * @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, @@ -122979,11 +109893,9 @@ module.exports = { data: { operator: firstToken.value }, - fix(fixer) { return fixer.insertTextAfter(firstToken, " "); } - }); } } else { @@ -122994,15 +109906,14 @@ module.exports = { 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 @@ -123010,8 +109921,6 @@ module.exports = { * @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]) { @@ -123021,15 +109930,12 @@ module.exports = { data: { operator: firstToken.value }, - fix(fixer) { if (astUtils.canTokensBeAdjacent(firstToken, secondToken)) { return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); } - return null; } - }); } } else { @@ -123040,34 +109946,28 @@ module.exports = { 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); @@ -123079,11 +109979,12 @@ module.exports = { } else { verifyNonWordsDontHaveSpaces(node, firstToken, secondToken); } - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- - return { UnaryExpression: checkForSpaces, UpdateExpression: checkForSpaces, @@ -123092,11 +109993,10 @@ module.exports = { AwaitExpression: checkForSpacesAfterAwait }; } - }; /***/ }), -/* 926 */ +/* 936 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -123106,9 +110006,10 @@ module.exports = { */ -const escapeRegExp = __webpack_require__(595); +const escapeRegExp = __webpack_require__(616); +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -123117,38 +110018,34 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @param {string} s A string to escape. * @returns {string} An escaped string. */ - - function escape(s) { return `(?:${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.includes("*")) { return markers.concat("*"); } - return markers; } + /** * Creates string pattern for exceptions. * Generated pattern: @@ -123157,10 +110054,9 @@ function parseMarkersOption(markers) { * @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" @@ -123168,14 +110064,12 @@ function createExceptionsPattern(exceptions) { * ["-", "="] ==> "(?:\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]); @@ -123185,12 +110079,11 @@ function createExceptionsPattern(exceptions) { 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: @@ -123201,17 +110094,15 @@ function createExceptionsPattern(exceptions) { * @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]); @@ -123221,12 +110112,11 @@ function createAlwaysStylePattern(markers, exceptions) { 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: @@ -123236,25 +110126,23 @@ function createAlwaysStylePattern(markers, exceptions) { * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce consistent spacing after the `//` or `/*` in a comment", recommended: false, - url: "https://eslint.org/docs/rules/spaced-comment" + url: "https://eslint.org/docs/latest/rules/spaced-comment" }, fixable: "whitespace", schema: [{ @@ -123326,24 +110214,25 @@ module.exports = { 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 sourceCode = context.sourceCode; + // 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. + 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"), @@ -123353,6 +110242,7 @@ module.exports = { }; return rule; }, {}); + /** * Reports a beginning spacing error with an appropriate message. * @param {ASTNode} node A comment node to check. @@ -123361,35 +110251,30 @@ module.exports = { * @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" ? "/*" : "//"; + 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. @@ -123397,56 +110282,49 @@ module.exports = { * @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; + 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. + 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. + 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"); } @@ -123458,26 +110336,22 @@ module.exports = { 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); } - }; } - }; /***/ }), -/* 927 */ +/* 937 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -123485,11 +110359,15 @@ module.exports = { * @fileoverview Rule to control usage of strict mode directives. * @author Brandon Mills */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -123499,56 +110377,49 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Require or disallow strict mode directives", recommended: false, - url: "https://eslint.org/docs/rules/strict" + url: "https://eslint.org/docs/latest/rules/strict" }, schema: [{ enum: ["never", "global", "function", "safe"] @@ -123567,38 +110438,35 @@ module.exports = { wrap: "Wrap {{name}} in a function with 'use strict' directive." } }, - create(context) { const ecmaFeatures = context.parserOptions.ecmaFeatures || {}, - scopes = [], - classScopes = []; + scopes = [], + classScopes = []; let mode = context.options[0] || "safe"; - if (ecmaFeatures.impliedStrict) { mode = "implied"; } else if (mode === "safe") { - mode = ecmaFeatures.globalReturn ? "global" : "function"; + mode = ecmaFeatures.globalReturn || context.languageOptions.sourceType === "commonjs" ? "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. @@ -123608,8 +110476,6 @@ module.exports = { * @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({ @@ -123619,6 +110485,7 @@ module.exports = { }); }); } + /** * Report all nodes in an array with a given message. * @param {ASTNode[]} nodes Nodes. @@ -123626,11 +110493,10 @@ module.exports = { * @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. @@ -123638,11 +110504,10 @@ module.exports = { * @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. @@ -123650,14 +110515,11 @@ module.exports = { * @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; - + 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({ @@ -123677,7 +110539,6 @@ module.exports = { fix: getFixFunction(useStrictDirectives[0]) }); } - reportAllExceptFirst(useStrictDirectives, "multiple", true); } else if (isParentGlobal) { if (isSimpleParameterList(node.params)) { @@ -123695,18 +110556,17 @@ module.exports = { }); } } - 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). @@ -123714,12 +110574,9 @@ module.exports = { * @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) : []; - + useStrictDirectives = isBlock ? getUseStrictDirectives(node.body.body) : []; if (mode === "function") { enterFunctionInFunctionMode(node, useStrictDirectives); } else if (useStrictDirectives.length > 0) { @@ -123734,15 +110591,12 @@ module.exports = { } } } - 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({ @@ -123750,42 +110604,35 @@ module.exports = { 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; } - }; /***/ }), -/* 928 */ +/* 938 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -123793,24 +110640,26 @@ module.exports = { * @fileoverview Rule to enforce spacing around colons of switch statements. * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Enforce spacing around colons of switch statements", recommended: false, - url: "https://eslint.org/docs/rules/switch-colon-spacing" + url: "https://eslint.org/docs/latest/rules/switch-colon-spacing" }, schema: [{ type: "object", @@ -123834,12 +110683,10 @@ module.exports = { unexpectedAfter: "Unexpected space(s) after this colon." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const options = context.options[0] || {}; const beforeSpacing = options.before === true; // false by default - const afterSpacing = options.after !== false; // true by default /** @@ -123849,24 +110696,23 @@ module.exports = { * @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. @@ -123875,26 +110721,20 @@ module.exports = { * @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 = astUtils.getSwitchCaseColonToken(node, sourceCode); const beforeToken = sourceCode.getTokenBefore(colonToken); const afterToken = sourceCode.getTokenAfter(colonToken); - if (!isValidSpacing(beforeToken, colonToken, beforeSpacing)) { context.report({ node, @@ -123903,7 +110743,6 @@ module.exports = { fix: fixer => fix(fixer, beforeToken, colonToken, beforeSpacing) }); } - if (!isValidSpacing(colonToken, afterToken, afterSpacing)) { context.report({ node, @@ -123913,14 +110752,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 929 */ +/* 939 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -123928,24 +110765,26 @@ module.exports = { * @fileoverview Rule to enforce description with the `Symbol` object * @author Jarek Rencz */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Require symbol descriptions", recommended: false, - url: "https://eslint.org/docs/rules/symbol-description" + url: "https://eslint.org/docs/latest/rules/symbol-description" }, fixable: null, schema: [], @@ -123953,8 +110792,9 @@ module.exports = { expected: "Expected Symbol to have a description." } }, - create(context) { + const sourceCode = context.sourceCode; + /** * Reports if node does not conform the rule in case rule is set to * report missing description @@ -123969,30 +110809,25 @@ module.exports = { }); } } - return { - "Program:exit"() { - const scope = context.getScope(); + "Program:exit"(node) { + const scope = sourceCode.getScope(node); 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); + const idNode = reference.identifier; + if (astUtils.isCallee(idNode)) { + checkArgument(idNode.parent); } }); } } - }; } - }; /***/ }), -/* 930 */ +/* 940 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -124000,24 +110835,26 @@ module.exports = { * @fileoverview Rule to enforce spacing around embedded expressions of template strings * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Require or disallow spacing around embedded expressions of template strings", recommended: false, - url: "https://eslint.org/docs/rules/template-curly-spacing" + url: "https://eslint.org/docs/latest/rules/template-curly-spacing" }, fixable: "whitespace", schema: [{ @@ -124030,30 +110867,27 @@ module.exports = { unexpectedAfter: "Unexpected space(s) after '${'." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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); - + includeComments: true + }), + hasSpace = sourceCode.isSpaceBetween(prevToken, token); if (!astUtils.isTokenOnSameLine(prevToken, token)) { return; } - if (always && !hasSpace) { context.report({ loc: { @@ -124067,7 +110901,6 @@ module.exports = { fix: fixer => fixer.insertTextBefore(token, " ") }); } - if (!always && hasSpace) { context.report({ loc: { @@ -124079,27 +110912,24 @@ module.exports = { }); } } + /** * 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); - + includeComments: true + }), + hasSpace = sourceCode.isSpaceBetween(token, nextToken); if (!astUtils.isTokenOnSameLine(token, nextToken)) { return; } - if (always && !hasSpace) { context.report({ loc: { @@ -124113,7 +110943,6 @@ module.exports = { fix: fixer => fixer.insertTextAfter(token, " ") }); } - if (!always && hasSpace) { context.report({ loc: { @@ -124125,21 +110954,18 @@ module.exports = { }); } } - return { TemplateElement(node) { const token = sourceCode.getFirstToken(node); checkSpacingBefore(token); checkSpacingAfter(token); } - }; } - }; /***/ }), -/* 931 */ +/* 941 */ /***/ ((module) => { "use strict"; @@ -124147,19 +110973,21 @@ module.exports = { * @fileoverview Rule to check spacing between template tags and their literals * @author Jonathan Wilsson */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "layout", docs: { description: "Require or disallow spacing between template tags and their literals", recommended: false, - url: "https://eslint.org/docs/rules/template-tag-spacing" + url: "https://eslint.org/docs/latest/rules/template-tag-spacing" }, fixable: "whitespace", schema: [{ @@ -124170,22 +110998,20 @@ module.exports = { missing: "Missing space between template tag and template literal." } }, - create(context) { const never = context.options[0] !== "always"; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + /** * 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, @@ -124194,17 +111020,15 @@ module.exports = { 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 + 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({ @@ -124214,24 +111038,20 @@ module.exports = { end: literalToken.loc.start }, messageId: "missing", - fix(fixer) { return fixer.insertTextAfter(tagToken, " "); } - }); } } - return { TaggedTemplateExpression: checkSpacing }; } - }; /***/ }), -/* 932 */ +/* 942 */ /***/ ((module) => { "use strict"; @@ -124239,19 +111059,20 @@ module.exports = { * @fileoverview Require or disallow Unicode BOM * @author Andrew Johnston */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "layout", docs: { description: "Require or disallow Unicode byte order mark (BOM)", recommended: false, - url: "https://eslint.org/docs/rules/unicode-bom" + url: "https://eslint.org/docs/latest/rules/unicode-bom" }, fixable: "whitespace", schema: [{ @@ -124262,51 +111083,45 @@ module.exports = { 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"; - + const sourceCode = context.sourceCode, + 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]); } - }); } } }; } - }; /***/ }), -/* 933 */ +/* 943 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -124314,11 +111129,15 @@ module.exports = { * @fileoverview Rule to flag comparisons to the value NaN * @author James Allardice */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -124327,24 +111146,22 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @param {ASTNode|null} node The node to check. * @returns {boolean} `true` if the node is 'NaN' identifier. */ - - function isNaNIdentifier(node) { return Boolean(node) && (astUtils.isSpecificId(node, "NaN") || astUtils.isSpecificMemberAccess(node, "Number", "NaN")); -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "problem", docs: { description: "Require calls to `isNaN()` when checking for `NaN`", recommended: true, - url: "https://eslint.org/docs/rules/use-isnan" + url: "https://eslint.org/docs/latest/rules/use-isnan" }, schema: [{ type: "object", @@ -124367,16 +111184,15 @@ module.exports = { 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({ @@ -124385,13 +111201,12 @@ module.exports = { }); } } + /** * 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({ @@ -124399,7 +111214,6 @@ module.exports = { messageId: "switchNaN" }); } - for (const switchCase of node.cases) { if (isNaNIdentifier(switchCase.test)) { context.report({ @@ -124409,19 +111223,16 @@ module.exports = { } } } + /** * Checks 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, @@ -124433,26 +111244,21 @@ module.exports = { } } } - const listeners = { BinaryExpression: checkBinaryExpression }; - if (enforceForSwitchCase) { listeners.SwitchStatement = checkSwitchStatement; } - if (enforceForIndexOf) { listeners.CallExpression = checkCallExpression; } - return listeners; } - }; /***/ }), -/* 934 */ +/* 944 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -124461,24 +111267,25 @@ module.exports = { * @author Nicholas C. Zakas * @deprecated in ESLint v5.10.0 */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const doctrine = __webpack_require__(945); -const doctrine = __webpack_require__(935); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: "Enforce valid JSDoc comments", recommended: false, - url: "https://eslint.org/docs/rules/valid-jsdoc" + url: "https://eslint.org/docs/latest/rules/valid-jsdoc" }, schema: [{ type: "object", @@ -124541,88 +111348,89 @@ module.exports = { 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; //-------------------------------------------------------------------------- + prefer = options.prefer || {}, + sourceCode = context.sourceCode, + // 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) + // 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)} + 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 @@ -124630,36 +111438,32 @@ module.exports = { * 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 @@ -124667,47 +111471,36 @@ module.exports = { * @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) { @@ -124719,38 +111512,35 @@ module.exports = { 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 = []; + 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 + 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, @@ -124770,10 +111560,8 @@ module.exports = { messageId: "syntaxError" }); } - return; } - jsdoc.tags.forEach(tag => { switch (tag.title.toLowerCase()) { case "param": @@ -124781,35 +111569,31 @@ module.exports = { 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 - + } + // check tag preferences if (Object.prototype.hasOwnProperty.call(prefer, tag.title) && tag.title !== prefer[tag.title]) { const entireTagRange = getAbsoluteRange(jsdocNode, tag); context.report({ @@ -124825,15 +111609,13 @@ module.exports = { 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 - + } + // validate the types if (checkPreferType && tag.type) { validateType(jsdocNode, tag.type); } @@ -124849,7 +111631,6 @@ module.exports = { } }); } - if (!param.description && requireParamDescription) { context.report({ node: jsdocNode, @@ -124860,7 +111641,6 @@ module.exports = { } }); } - if (paramTagsByName[param.name]) { context.report({ node: jsdocNode, @@ -124874,7 +111654,6 @@ module.exports = { paramTagsByName[param.name] = param; } }); - if (hasReturns) { if (!requireReturn && !functionData.returnPresent && (returnsTag.type === null || !isValidReturnType(returnsTag)) && !isAbstract) { context.report({ @@ -124892,7 +111671,6 @@ module.exports = { messageId: "missingReturnType" }); } - if (!isValidReturnType(returnsTag) && !returnsTag.description && requireReturnDescription) { context.report({ node: jsdocNode, @@ -124900,9 +111678,9 @@ module.exports = { }); } } - } // check for functions missing @returns - + } + // 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({ @@ -124913,18 +111691,17 @@ module.exports = { } }); } - } // check the parameters - + } + // 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 + 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, @@ -124947,10 +111724,8 @@ module.exports = { } }); } - if (options.matchDescription) { const regex = new RegExp(options.matchDescription, "u"); - if (!regex.test(jsdoc.description)) { context.report({ node: jsdocNode, @@ -124959,11 +111734,12 @@ module.exports = { } } } - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- - return { ArrowFunctionExpression: startFunction, FunctionExpression: startFunction, @@ -124978,11 +111754,10 @@ module.exports = { ReturnStatement: addReturn }; } - }; /***/ }), -/* 935 */ +/* 945 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* @@ -124991,215 +111766,168 @@ module.exports = { * @author Dan Tao * @author Andrew Eisenberg */ + (function () { 'use strict'; var typed, utility, jsdoc, esutils, hasOwnProperty; - esutils = __webpack_require__(619); - typed = __webpack_require__(936); - utility = __webpack_require__(937); - + esutils = __webpack_require__(640); + typed = __webpack_require__(946); + utility = __webpack_require__(947); function sliceSource(source, index, last) { return source.slice(index, last); } - hasOwnProperty = function () { var func = Object.prototype.hasOwnProperty; return function hasOwnProperty(obj, name) { return func.call(obj, name); }; }(); - function shallowCopy(obj) { var ret = {}, - key; - + key; for (key in obj) { if (obj.hasOwnProperty(key)) { ret[key] = obj[key]; } } - return ret; } - function isASCIIAlphanumeric(ch) { - return ch >= 0x61 - /* 'a' */ - && ch <= 0x7A - /* 'z' */ - || ch >= 0x41 - /* 'A' */ - && ch <= 0x5A - /* 'Z' */ - || ch >= 0x30 - /* '0' */ - && ch <= 0x39 - /* '9' */ - ; + return ch >= 0x61 /* 'a' */ && ch <= 0x7A /* 'z' */ || ch >= 0x41 /* 'A' */ && ch <= 0x5A /* 'Z' */ || ch >= 0x30 /* '0' */ && ch <= 0x39 /* '9' */; } function isParamTitle(title) { return title === 'param' || title === 'argument' || title === 'arg'; } - function isReturnTitle(title) { return title === 'return' || title === 'returns'; } - function isProperty(title) { return title === 'property' || title === 'prop'; } - function isNameParameterRequired(title) { return isParamTitle(title) || isProperty(title) || title === 'alias' || title === 'this' || title === 'mixes' || title === 'requires'; } - function isAllowedName(title) { return isNameParameterRequired(title) || title === 'const' || title === 'constant'; } - function isAllowedNested(title) { return isProperty(title) || isParamTitle(title); } - function isAllowedOptional(title) { return isProperty(title) || isParamTitle(title); } - function isTypeParameterRequired(title) { return isParamTitle(title) || isReturnTitle(title) || title === 'define' || title === 'enum' || title === 'implements' || title === 'this' || title === 'type' || title === 'typedef' || isProperty(title); - } // Consider deprecation instead using 'isTypeParameterRequired' and 'Rules' declaration to pick when a type is optional/required + } + + // Consider deprecation instead using 'isTypeParameterRequired' and 'Rules' declaration to pick when a type is optional/required // This would require changes to 'parseType' - - function isAllowedType(title) { return isTypeParameterRequired(title) || title === 'throws' || title === 'const' || title === 'constant' || title === 'namespace' || title === 'member' || title === 'var' || title === 'module' || title === 'constructor' || title === 'class' || title === 'extends' || title === 'augments' || title === 'public' || title === 'private' || title === 'protected'; - } // A regex character class that contains all whitespace except linebreak characters (\r, \n, \u2028, \u2029) - + } + // A regex character class that contains all whitespace except linebreak characters (\r, \n, \u2028, \u2029) var WHITESPACE = '[ \\f\\t\\v\\u00a0\\u1680\\u180e\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff]'; var STAR_MATCHER = '(' + WHITESPACE + '*(?:\\*' + WHITESPACE + '?)?)(.+|[\r\n\u2028\u2029])'; - function unwrapComment(doc) { // JSDoc comment is following form // /** // * ....... // */ - return doc. // remove /** - replace(/^\/\*\*?/, ''). // remove */ - replace(/\*\/$/, ''). // remove ' * ' at the beginning of a line - replace(new RegExp(STAR_MATCHER, 'g'), '$2'). // remove trailing whitespace + + return doc. + // remove /** + replace(/^\/\*\*?/, ''). + // remove */ + replace(/\*\/$/, ''). + // remove ' * ' at the beginning of a line + replace(new RegExp(STAR_MATCHER, 'g'), '$2'). + // remove trailing whitespace replace(/\s*$/, ''); } + /** * Converts an index in an "unwrapped" JSDoc comment to the corresponding index in the original "wrapped" version * @param {string} originalSource The original wrapped comment * @param {number} unwrappedIndex The index of a character in the unwrapped string * @returns {number} The index of the corresponding character in the original wrapped string */ - - function convertUnwrappedCommentIndex(originalSource, unwrappedIndex) { var replacedSource = originalSource.replace(/^\/\*\*?/, ''); var numSkippedChars = 0; var matcher = new RegExp(STAR_MATCHER, 'g'); var match; - while (match = matcher.exec(replacedSource)) { numSkippedChars += match[1].length; - if (match.index + match[0].length > unwrappedIndex + numSkippedChars) { return unwrappedIndex + numSkippedChars + originalSource.length - replacedSource.length; } } - return originalSource.replace(/\*\/$/, '').replace(/\s*$/, '').length; - } // JSDoc Tag Parser + } + // JSDoc Tag Parser (function (exports) { var Rules, index, lineNumber, length, source, originalSource, recoverable, sloppy, strict; - function advance() { var ch = source.charCodeAt(index); index += 1; - - if (esutils.code.isLineTerminator(ch) && !(ch === 0x0D - /* '\r' */ - && source.charCodeAt(index) === 0x0A - /* '\n' */ - )) { + if (esutils.code.isLineTerminator(ch) && !(ch === 0x0D /* '\r' */ && source.charCodeAt(index) === 0x0A /* '\n' */)) { lineNumber += 1; } - return String.fromCharCode(ch); } - function scanTitle() { - var title = ''; // waste '@' - + var title = ''; + // waste '@' advance(); - while (index < length && isASCIIAlphanumeric(source.charCodeAt(index))) { title += advance(); } - return title; } - function seekContent() { var ch, - waiting, - last = index; + waiting, + last = index; waiting = false; - while (last < length) { ch = source.charCodeAt(last); - - if (esutils.code.isLineTerminator(ch) && !(ch === 0x0D - /* '\r' */ - && source.charCodeAt(last + 1) === 0x0A - /* '\n' */ - )) { + if (esutils.code.isLineTerminator(ch) && !(ch === 0x0D /* '\r' */ && source.charCodeAt(last + 1) === 0x0A /* '\n' */)) { waiting = true; } else if (waiting) { - if (ch === 0x40 - /* '@' */ - ) { + if (ch === 0x40 /* '@' */) { break; } - if (!esutils.code.isWhiteSpace(ch)) { waiting = false; } } - last += 1; } - return last; - } // type expression may have nest brace, such as, + } + + // type expression may have nest brace, such as, // { { ok: string } } // // therefore, scanning type expression with balancing braces. - - function parseType(title, last, addRange) { var ch, - brace, - type, - startIndex, - direct = false; // search '{' + brace, + type, + startIndex, + direct = false; + // search '{' while (index < last) { ch = source.charCodeAt(index); - if (esutils.code.isWhiteSpace(ch)) { advance(); - } else if (ch === 0x7B - /* '{' */ - ) { + } else if (ch === 0x7B /* '{' */) { advance(); break; } else { @@ -125208,97 +111936,73 @@ module.exports = { break; } } - if (direct) { return null; - } // type expression { is found - + } + // type expression { is found brace = 1; type = ''; - while (index < last) { ch = source.charCodeAt(index); - if (esutils.code.isLineTerminator(ch)) { advance(); } else { - if (ch === 0x7D - /* '}' */ - ) { + if (ch === 0x7D /* '}' */) { brace -= 1; - if (brace === 0) { advance(); break; } - } else if (ch === 0x7B - /* '{' */ - ) { + } else if (ch === 0x7B /* '{' */) { brace += 1; } - if (type === '') { startIndex = index; } - type += advance(); } } - if (brace !== 0) { // braces is not balanced return utility.throwError('Braces are not balanced'); } - if (isAllowedOptional(title)) { return typed.parseParamType(type, { startIndex: convertIndex(startIndex), range: addRange }); } - return typed.parseType(type, { startIndex: convertIndex(startIndex), range: addRange }); } - function scanIdentifier(last) { var identifier; - if (!esutils.code.isIdentifierStartES5(source.charCodeAt(index)) && !source[index].match(/[0-9]/)) { return null; } - identifier = advance(); - while (index < last && esutils.code.isIdentifierPartES5(source.charCodeAt(index))) { identifier += advance(); } - return identifier; } - function skipWhiteSpace(last) { while (index < last && (esutils.code.isWhiteSpace(source.charCodeAt(index)) || esutils.code.isLineTerminator(source.charCodeAt(index)))) { advance(); } } - function parseName(last, allowBrackets, allowNestedParams) { var name = '', - useBrackets, - insideString; + useBrackets, + insideString; skipWhiteSpace(last); - if (index >= last) { return null; } - - if (source.charCodeAt(index) === 0x5B - /* '[' */ - ) { + if (source.charCodeAt(index) === 0x5B /* '[' */) { if (allowBrackets) { useBrackets = true; name = advance(); @@ -125306,67 +112010,41 @@ module.exports = { return null; } } - name += scanIdentifier(last); - if (allowNestedParams) { - if (source.charCodeAt(index) === 0x3A - /* ':' */ - && (name === 'module' || name === 'external' || name === 'event')) { + if (source.charCodeAt(index) === 0x3A /* ':' */ && (name === 'module' || name === 'external' || name === 'event')) { name += advance(); name += scanIdentifier(last); } - - if (source.charCodeAt(index) === 0x5B - /* '[' */ - && source.charCodeAt(index + 1) === 0x5D - /* ']' */ - ) { + if (source.charCodeAt(index) === 0x5B /* '[' */ && source.charCodeAt(index + 1) === 0x5D /* ']' */) { name += advance(); name += advance(); } - - while (source.charCodeAt(index) === 0x2E - /* '.' */ - || source.charCodeAt(index) === 0x2F - /* '/' */ - || source.charCodeAt(index) === 0x23 - /* '#' */ - || source.charCodeAt(index) === 0x2D - /* '-' */ - || source.charCodeAt(index) === 0x7E - /* '~' */ - ) { + while (source.charCodeAt(index) === 0x2E /* '.' */ || source.charCodeAt(index) === 0x2F /* '/' */ || source.charCodeAt(index) === 0x23 /* '#' */ || source.charCodeAt(index) === 0x2D /* '-' */ || source.charCodeAt(index) === 0x7E /* '~' */) { name += advance(); name += scanIdentifier(last); } } - if (useBrackets) { - skipWhiteSpace(last); // do we have a default value for this? - - if (source.charCodeAt(index) === 0x3D - /* '=' */ - ) { + skipWhiteSpace(last); + // do we have a default value for this? + if (source.charCodeAt(index) === 0x3D /* '=' */) { // consume the '='' symbol name += advance(); skipWhiteSpace(last); var ch; - var bracketDepth = 1; // scan in the default value + var bracketDepth = 1; + // scan in the default value while (index < last) { ch = source.charCodeAt(index); - if (esutils.code.isWhiteSpace(ch)) { if (!insideString) { skipWhiteSpace(last); ch = source.charCodeAt(index); } } - - if (ch === 0x27 - /* ''' */ - ) { + if (ch === 0x27 /* ''' */) { if (!insideString) { insideString = '\''; } else { @@ -125375,10 +112053,7 @@ module.exports = { } } } - - if (ch === 0x22 - /* '"' */ - ) { + if (ch === 0x22 /* '"' */) { if (!insideString) { insideString = '"'; } else { @@ -125387,62 +112062,41 @@ module.exports = { } } } - - if (ch === 0x5B - /* '[' */ - ) { + if (ch === 0x5B /* '[' */) { bracketDepth++; - } else if (ch === 0x5D - /* ']' */ - && --bracketDepth === 0) { + } else if (ch === 0x5D /* ']' */ && --bracketDepth === 0) { break; } - name += advance(); } } - skipWhiteSpace(last); - - if (index >= last || source.charCodeAt(index) !== 0x5D - /* ']' */ - ) { + if (index >= last || source.charCodeAt(index) !== 0x5D /* ']' */) { // we never found a closing ']' return null; - } // collect the last ']' - + } + // collect the last ']' name += advance(); } - return name; } - function skipToTag() { - while (index < length && source.charCodeAt(index) !== 0x40 - /* '@' */ - ) { + while (index < length && source.charCodeAt(index) !== 0x40 /* '@' */) { advance(); } - if (index >= length) { return false; } - - utility.assert(source.charCodeAt(index) === 0x40 - /* '@' */ - ); + utility.assert(source.charCodeAt(index) === 0x40 /* '@' */); return true; } - function convertIndex(rangeIndex) { if (source === originalSource) { return rangeIndex; } - return convertUnwrappedCommentIndex(originalSource, rangeIndex); } - function TagParser(options, title) { this._options = options; this._title = title.toLowerCase(); @@ -125450,44 +112104,36 @@ module.exports = { title: title, description: null }; - if (this._options.lineNumbers) { this._tag.lineNumber = lineNumber; } - this._first = index - title.length - 1; - this._last = 0; // space to save special information for title parsers. - + this._last = 0; + // space to save special information for title parsers. this._extra = {}; - } // addError(err, ...) - + } + // addError(err, ...) TagParser.prototype.addError = function addError(errorText) { var args = Array.prototype.slice.call(arguments, 1), - msg = errorText.replace(/%(\d)/g, function (whole, index) { - utility.assert(index < args.length, 'Message reference must be in range'); - return args[index]; - }); - + msg = errorText.replace(/%(\d)/g, function (whole, index) { + utility.assert(index < args.length, 'Message reference must be in range'); + return args[index]; + }); if (!this._tag.errors) { this._tag.errors = []; } - if (strict) { utility.throwError(msg); } - this._tag.errors.push(msg); - return recoverable; }; - TagParser.prototype.parseType = function () { // type required titles if (isTypeParameterRequired(this._title)) { try { this._tag.type = parseType(this._title, this._last, this._options.range); - if (!this._tag.type) { if (!isParamTitle(this._title) && !isReturnTitle(this._title)) { if (!this.addError('Missing or invalid tag type')) { @@ -125497,7 +112143,6 @@ module.exports = { } } catch (error) { this._tag.type = null; - if (!this.addError(error.message)) { return false; } @@ -125506,17 +112151,15 @@ module.exports = { // optional types try { this._tag.type = parseType(this._title, this._last, this._options.range); - } catch (e) {//For optional types, lets drop the thrown error when we hit the end of the file + } catch (e) { + //For optional types, lets drop the thrown error when we hit the end of the file } } - return true; }; - TagParser.prototype._parseNamePath = function (optional) { var name; name = parseName(this._last, sloppy && isAllowedOptional(this._title), true); - if (!name) { if (!optional) { if (!this.addError('Missing or invalid tag name')) { @@ -125524,33 +112167,29 @@ module.exports = { } } } - this._tag.name = name; return true; }; - TagParser.prototype.parseNamePath = function () { return this._parseNamePath(false); }; - TagParser.prototype.parseNamePathOptional = function () { return this._parseNamePath(true); }; - TagParser.prototype.parseName = function () { - var assign, name; // param, property requires name + var assign, name; + // param, property requires name if (isAllowedName(this._title)) { this._tag.name = parseName(this._last, sloppy && isAllowedOptional(this._title), isAllowedNested(this._title)); - if (!this._tag.name) { if (!isNameParameterRequired(this._title)) { return true; - } // it's possible the name has already been parsed but interpreted as a type + } + + // it's possible the name has already been parsed but interpreted as a type // it's also possible this is a sloppy declaration, in which case it will be // fixed at the end - - if (isParamTitle(this._title) && this._tag.type && this._tag.type.name) { this._extra.name = this._tag.type; this._tag.name = this._tag.type.name; @@ -125562,18 +112201,16 @@ module.exports = { } } else { name = this._tag.name; - if (name.charAt(0) === '[' && name.charAt(name.length - 1) === ']') { // extract the default value if there is one // example: @param {string} [somebody=John Doe] description assign = name.substring(1, name.length - 1).split('='); - if (assign.length > 1) { this._tag['default'] = assign.slice(1).join('='); } + this._tag.name = assign[0]; - this._tag.name = assign[0]; // convert to an optional type - + // convert to an optional type if (this._tag.type && this._tag.type.type !== 'OptionalType') { this._tag.type = { type: 'OptionalType', @@ -125583,41 +112220,32 @@ module.exports = { } } } - return true; }; - TagParser.prototype.parseDescription = function parseDescription() { var description = sliceSource(source, index, this._last).trim(); - if (description) { if (/^-\s+/.test(description)) { description = description.substring(2); } - this._tag.description = description; } - return true; }; - TagParser.prototype.parseCaption = function parseDescription() { var description = sliceSource(source, index, this._last).trim(); var captionStartTag = ''; var captionEndTag = ''; var captionStart = description.indexOf(captionStartTag); var captionEnd = description.indexOf(captionEndTag); - if (captionStart >= 0 && captionEnd >= 0) { this._tag.caption = description.substring(captionStart + captionStartTag.length, captionEnd).trim(); this._tag.description = description.substring(captionEnd + captionEndTag.length).trim(); } else { this._tag.description = description; } - return true; }; - TagParser.prototype.parseKind = function parseKind() { var kind, kinds; kinds = { @@ -125635,38 +112263,30 @@ module.exports = { }; kind = sliceSource(source, index, this._last).trim(); this._tag.kind = kind; - if (!hasOwnProperty(kinds, kind)) { if (!this.addError('Invalid kind name \'%0\'', kind)) { return false; } } - return true; }; - TagParser.prototype.parseAccess = function parseAccess() { var access; access = sliceSource(source, index, this._last).trim(); this._tag.access = access; - if (access !== 'private' && access !== 'protected' && access !== 'public') { if (!this.addError('Invalid access name \'%0\'', access)) { return false; } } - return true; }; - TagParser.prototype.parseThis = function parseThis() { // this name may be a name expression (e.g. {foo.bar}), // an union (e.g. {foo.bar|foo.baz}) or a name path (e.g. foo.bar) var value = sliceSource(source, index, this._last).trim(); - if (value && value.charAt(0) === '{') { var gotType = this.parseType(); - if (gotType && this._tag.type.type === 'NameExpression' || this._tag.type.type === 'UnionType') { this._tag.name = this._tag.type.name; return true; @@ -125677,55 +112297,44 @@ module.exports = { return this.parseNamePath(); } }; - TagParser.prototype.parseVariation = function parseVariation() { var variation, text; text = sliceSource(source, index, this._last).trim(); variation = parseFloat(text, 10); this._tag.variation = variation; - if (isNaN(variation)) { if (!this.addError('Invalid variation \'%0\'', text)) { return false; } } - return true; }; - TagParser.prototype.ensureEnd = function () { var shouldBeEmpty = sliceSource(source, index, this._last).trim(); - if (shouldBeEmpty) { if (!this.addError('Unknown content \'%0\'', shouldBeEmpty)) { return false; } } - return true; }; - TagParser.prototype.epilogue = function epilogue() { var description; - description = this._tag.description; // un-fix potentially sloppy declaration - + description = this._tag.description; + // un-fix potentially sloppy declaration if (isAllowedOptional(this._title) && !this._tag.type && description && description.charAt(0) === '[') { this._tag.type = this._extra.name; - if (!this._tag.name) { this._tag.name = undefined; } - if (!sloppy) { if (!this.addError('Missing or invalid tag name')) { return false; } } } - return true; }; - Rules = { // http://usejsdoc.org/tags-access.html 'access': ['parseAccess'], @@ -125798,115 +112407,101 @@ module.exports = { // http://usejsdoc.org/tags-version.html 'version': ['parseDescription'] }; - TagParser.prototype.parse = function parse() { - var i, iz, sequences, method; // empty title + var i, iz, sequences, method; + // empty title if (!this._title) { if (!this.addError('Missing or invalid title')) { return null; } - } // Seek to content last index. - + } + // Seek to content last index. this._last = seekContent(this._title); - if (this._options.range) { this._tag.range = [this._first, source.slice(0, this._last).replace(/\s*$/, '').length].map(convertIndex); } - if (hasOwnProperty(Rules, this._title)) { sequences = Rules[this._title]; } else { // default sequences sequences = ['parseType', 'parseName', 'parseDescription', 'epilogue']; } - for (i = 0, iz = sequences.length; i < iz; ++i) { method = sequences[i]; - if (!this[method]()) { return null; } } - return this._tag; }; - function parseTag(options) { - var title, parser, tag; // skip to tag + var title, parser, tag; + // skip to tag if (!skipToTag()) { return null; - } // scan title + } + // scan title + title = scanTitle(); - title = scanTitle(); // construct tag parser - + // construct tag parser parser = new TagParser(options, title); - tag = parser.parse(); // Seek global index to end of this tag. + tag = parser.parse(); + // Seek global index to end of this tag. while (index < parser._last) { advance(); } - return tag; - } // + } + + // // Parse JSDoc // - function scanJSDocDescription(preserveWhitespace) { var description = '', - ch, - atAllowed; + ch, + atAllowed; atAllowed = true; - while (index < length) { ch = source.charCodeAt(index); - - if (atAllowed && ch === 0x40 - /* '@' */ - ) { + if (atAllowed && ch === 0x40 /* '@' */) { break; } - if (esutils.code.isLineTerminator(ch)) { atAllowed = true; } else if (atAllowed && !esutils.code.isWhiteSpace(ch)) { atAllowed = false; } - description += advance(); } - return preserveWhitespace ? description : description.trim(); } - function parse(comment, options) { var tags = [], - tag, - description, - interestingTags, - i, - iz; - + tag, + description, + interestingTags, + i, + iz; if (options === undefined) { options = {}; } - if (typeof options.unwrap === 'boolean' && options.unwrap) { source = unwrapComment(comment); } else { source = comment; } + originalSource = comment; - originalSource = comment; // array of relevant tags - + // array of relevant tags if (options.tags) { if (Array.isArray(options.tags)) { interestingTags = {}; - for (i = 0, iz = options.tags.length; i < iz; i++) { if (typeof options.tags[i] === 'string') { interestingTags[options.tags[i]] = true; @@ -125918,7 +112513,6 @@ module.exports = { utility.throwError('Invalid "tags" parameter: ' + options.tags); } } - length = source.length; index = 0; lineNumber = 0; @@ -125926,28 +112520,22 @@ module.exports = { sloppy = options.sloppy; strict = options.strict; description = scanJSDocDescription(options.preserveWhitespace); - while (true) { tag = parseTag(options); - if (!tag) { break; } - if (!interestingTags || interestingTags.hasOwnProperty(tag.title)) { tags.push(tag); } } - return { description: description, tags: tags }; } - exports.parse = parse; })(jsdoc = {}); - exports.version = utility.VERSION; exports.parse = jsdoc.parse; exports.parseType = typed.parseType; @@ -125965,7 +112553,7 @@ module.exports = { /* vim: set sw=4 ts=4 et tw=80 : */ /***/ }), -/* 936 */ +/* 946 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* @@ -125974,13 +112562,15 @@ module.exports = { * @author Dan Tao * @author Andrew Eisenberg */ + // "typed", the Type Expression Parser for doctrine. + (function () { 'use strict'; var Syntax, Token, source, length, index, previous, token, value, esutils, utility, rangeOffset, addRange; - esutils = __webpack_require__(619); - utility = __webpack_require__(937); + esutils = __webpack_require__(640); + utility = __webpack_require__(947); Syntax = { NullableLiteral: 'NullableLiteral', AllLiteral: 'AllLiteral', @@ -126048,50 +112638,41 @@ module.exports = { // number EOF: 21 }; - function isTypeName(ch) { return '><(){}[],:*|?!='.indexOf(String.fromCharCode(ch)) === -1 && !esutils.code.isWhiteSpace(ch) && !esutils.code.isLineTerminator(ch); } - function Context(previous, index, token, value) { this._previous = previous; this._index = index; this._token = token; this._value = value; } - Context.prototype.restore = function () { previous = this._previous; index = this._index; token = this._token; value = this._value; }; - Context.save = function () { return new Context(previous, index, token, value); }; - function maybeAddRange(node, range) { if (addRange) { node.range = [range[0] + rangeOffset, range[1] + rangeOffset]; } - return node; } - function advance() { var ch = source.charAt(index); index += 1; return ch; } - function scanHexEscape(prefix) { var i, - len, - ch, - code = 0; + len, + ch, + code = 0; len = prefix === 'u' ? 4 : 2; - for (i = 0; i < len; ++i) { if (index < length && esutils.code.isHexDigit(source.charCodeAt(index))) { ch = advance(); @@ -126100,73 +112681,60 @@ module.exports = { return ''; } } - return String.fromCharCode(code); } - function scanString() { var str = '', - quote, - ch, - code, - unescaped, - restore; //TODO review removal octal = false - + quote, + ch, + code, + unescaped, + restore; //TODO review removal octal = false quote = source.charAt(index); ++index; - while (index < length) { ch = advance(); - if (ch === quote) { quote = ''; break; } else if (ch === '\\') { ch = advance(); - if (!esutils.code.isLineTerminator(ch.charCodeAt(0))) { switch (ch) { case 'n': str += '\n'; break; - case 'r': str += '\r'; break; - case 't': str += '\t'; break; - case 'u': case 'x': restore = index; unescaped = scanHexEscape(ch); - if (unescaped) { str += unescaped; } else { index = restore; str += ch; } - break; - case 'b': str += '\b'; break; - case 'f': str += '\f'; break; - case 'v': str += '\v'; break; - default: if (esutils.code.isOctalDigit(ch.charCodeAt(0))) { - code = '01234567'.indexOf(ch); // \0 is not octal escape sequence + code = '01234567'.indexOf(ch); + + // \0 is not octal escape sequence // Deprecating unused code. TODO review removal //if (code !== 0) { // octal = true; @@ -126174,25 +112742,22 @@ module.exports = { if (index < length && esutils.code.isOctalDigit(source.charCodeAt(index))) { //TODO Review Removal octal = true; - code = code * 8 + '01234567'.indexOf(advance()); // 3 digits are only allowed when string starts - // with 0, 1, 2, 3 + code = code * 8 + '01234567'.indexOf(advance()); + // 3 digits are only allowed when string starts + // with 0, 1, 2, 3 if ('0123'.indexOf(ch) >= 0 && index < length && esutils.code.isOctalDigit(source.charCodeAt(index))) { code = code * 8 + '01234567'.indexOf(advance()); } } - str += String.fromCharCode(code); } else { str += ch; } - break; } } else { - if (ch === '\r' && source.charCodeAt(index) === 0x0A - /* '\n' */ - ) { + if (ch === '\r' && source.charCodeAt(index) === 0x0A /* '\n' */) { ++index; } } @@ -126202,382 +112767,277 @@ module.exports = { str += ch; } } - if (quote !== '') { utility.throwError('unexpected quote'); } - value = str; return Token.STRING; } - function scanNumber() { var number, ch; number = ''; ch = source.charCodeAt(index); - - if (ch !== 0x2E - /* '.' */ - ) { + if (ch !== 0x2E /* '.' */) { number = advance(); ch = source.charCodeAt(index); - if (number === '0') { - if (ch === 0x78 - /* 'x' */ - || ch === 0x58 - /* 'X' */ - ) { + if (ch === 0x78 /* 'x' */ || ch === 0x58 /* 'X' */) { number += advance(); - while (index < length) { ch = source.charCodeAt(index); - if (!esutils.code.isHexDigit(ch)) { break; } - number += advance(); } - if (number.length <= 2) { // only 0x utility.throwError('unexpected token'); } - if (index < length) { ch = source.charCodeAt(index); - if (esutils.code.isIdentifierStartES5(ch)) { utility.throwError('unexpected token'); } } - value = parseInt(number, 16); return Token.NUMBER; } - if (esutils.code.isOctalDigit(ch)) { number += advance(); - while (index < length) { ch = source.charCodeAt(index); - if (!esutils.code.isOctalDigit(ch)) { break; } - number += advance(); } - if (index < length) { ch = source.charCodeAt(index); - if (esutils.code.isIdentifierStartES5(ch) || esutils.code.isDecimalDigit(ch)) { utility.throwError('unexpected token'); } } - value = parseInt(number, 8); return Token.NUMBER; } - if (esutils.code.isDecimalDigit(ch)) { utility.throwError('unexpected token'); } } - while (index < length) { ch = source.charCodeAt(index); - if (!esutils.code.isDecimalDigit(ch)) { break; } - number += advance(); } } - - if (ch === 0x2E - /* '.' */ - ) { + if (ch === 0x2E /* '.' */) { number += advance(); - while (index < length) { ch = source.charCodeAt(index); - if (!esutils.code.isDecimalDigit(ch)) { break; } - number += advance(); } } - - if (ch === 0x65 - /* 'e' */ - || ch === 0x45 - /* 'E' */ - ) { + if (ch === 0x65 /* 'e' */ || ch === 0x45 /* 'E' */) { number += advance(); ch = source.charCodeAt(index); - - if (ch === 0x2B - /* '+' */ - || ch === 0x2D - /* '-' */ - ) { + if (ch === 0x2B /* '+' */ || ch === 0x2D /* '-' */) { number += advance(); } - ch = source.charCodeAt(index); - if (esutils.code.isDecimalDigit(ch)) { number += advance(); - while (index < length) { ch = source.charCodeAt(index); - if (!esutils.code.isDecimalDigit(ch)) { break; } - number += advance(); } } else { utility.throwError('unexpected token'); } } - if (index < length) { ch = source.charCodeAt(index); - if (esutils.code.isIdentifierStartES5(ch)) { utility.throwError('unexpected token'); } } - value = parseFloat(number); return Token.NUMBER; } - function scanTypeName() { var ch, ch2; value = advance(); - while (index < length && isTypeName(source.charCodeAt(index))) { ch = source.charCodeAt(index); - - if (ch === 0x2E - /* '.' */ - ) { + if (ch === 0x2E /* '.' */) { if (index + 1 >= length) { return Token.ILLEGAL; } - ch2 = source.charCodeAt(index + 1); - - if (ch2 === 0x3C - /* '<' */ - ) { + if (ch2 === 0x3C /* '<' */) { break; } } - value += advance(); } - return Token.NAME; } - function next() { var ch; previous = index; - while (index < length && esutils.code.isWhiteSpace(source.charCodeAt(index))) { advance(); } - if (index >= length) { token = Token.EOF; return token; } - ch = source.charCodeAt(index); - switch (ch) { - case 0x27: - /* ''' */ - + case 0x27: /* ''' */ case 0x22: /* '"' */ token = scanString(); return token; - case 0x3A: /* ':' */ advance(); token = Token.COLON; return token; - case 0x2C: /* ',' */ advance(); token = Token.COMMA; return token; - case 0x28: /* '(' */ advance(); token = Token.LPAREN; return token; - case 0x29: /* ')' */ advance(); token = Token.RPAREN; return token; - case 0x5B: /* '[' */ advance(); token = Token.LBRACK; return token; - case 0x5D: /* ']' */ advance(); token = Token.RBRACK; return token; - case 0x7B: /* '{' */ advance(); token = Token.LBRACE; return token; - case 0x7D: /* '}' */ advance(); token = Token.RBRACE; return token; - case 0x2E: /* '.' */ if (index + 1 < length) { ch = source.charCodeAt(index + 1); - - if (ch === 0x3C - /* '<' */ - ) { + if (ch === 0x3C /* '<' */) { advance(); // '.' - advance(); // '<' - token = Token.DOT_LT; return token; } - - if (ch === 0x2E - /* '.' */ - && index + 2 < length && source.charCodeAt(index + 2) === 0x2E - /* '.' */ - ) { + if (ch === 0x2E /* '.' */ && index + 2 < length && source.charCodeAt(index + 2) === 0x2E /* '.' */) { advance(); // '.' - advance(); // '.' - advance(); // '.' - token = Token.REST; return token; } - if (esutils.code.isDecimalDigit(ch)) { token = scanNumber(); return token; } } - token = Token.ILLEGAL; return token; - case 0x3C: /* '<' */ advance(); token = Token.LT; return token; - case 0x3E: /* '>' */ advance(); token = Token.GT; return token; - case 0x2A: /* '*' */ advance(); token = Token.STAR; return token; - case 0x7C: /* '|' */ advance(); token = Token.PIPE; return token; - case 0x3F: /* '?' */ advance(); token = Token.QUESTION; return token; - case 0x21: /* '!' */ advance(); token = Token.BANG; return token; - case 0x3D: /* '=' */ advance(); token = Token.EQUAL; return token; - case 0x2D: /* '-' */ token = scanNumber(); return token; - default: if (esutils.code.isDecimalDigit(ch)) { token = scanNumber(); return token; - } // type string permits following case, + } + + // type string permits following case, // // namespace.module.MyClass // // this reduced 1 token TK_NAME - - utility.assert(isTypeName(ch)); token = scanTypeName(); return token; } } - function consume(target, text) { utility.assert(token === target, text || 'consumed token not matched'); next(); } - function expect(target, message) { if (token !== target) { utility.throwError(message || 'unexpected token'); } - next(); - } // UnionType := '(' TypeUnionList ')' + } + + // UnionType := '(' TypeUnionList ')' // // TypeUnionList := // <> @@ -126586,47 +113046,40 @@ module.exports = { // NonemptyTypeUnionList := // TypeExpression // | TypeExpression '|' NonemptyTypeUnionList - - function parseUnionType() { var elements, - startIndex = index - 1; + startIndex = index - 1; consume(Token.LPAREN, 'UnionType should start with ('); elements = []; - if (token !== Token.RPAREN) { while (true) { elements.push(parseTypeExpression()); - if (token === Token.RPAREN) { break; } - expect(Token.PIPE); } } - consume(Token.RPAREN, 'UnionType should end with )'); return maybeAddRange({ type: Syntax.UnionType, elements: elements }, [startIndex, previous]); - } // ArrayType := '[' ElementTypeList ']' + } + + // ArrayType := '[' ElementTypeList ']' // // ElementTypeList := // <> // | TypeExpression // | '...' TypeExpression // | TypeExpression ',' ElementTypeList - - function parseArrayType() { var elements, - startIndex = index - 1, - restStartIndex; + startIndex = index - 1, + restStartIndex; consume(Token.LBRACK, 'ArrayType should start with ['); elements = []; - while (token !== Token.RBRACK) { if (token === Token.REST) { restStartIndex = index - 3; @@ -126639,34 +113092,30 @@ module.exports = { } else { elements.push(parseTypeExpression()); } - if (token !== Token.RBRACK) { expect(Token.COMMA); } } - expect(Token.RBRACK); return maybeAddRange({ type: Syntax.ArrayType, elements: elements }, [startIndex, previous]); } - function parseFieldName() { var v = value; - if (token === Token.NAME || token === Token.STRING) { next(); return v; } - if (token === Token.NUMBER) { consume(Token.NUMBER); return String(v); } - utility.throwError('unexpected token'); - } // FieldType := + } + + // FieldType := // FieldName // | FieldName ':' TypeExpression // @@ -126675,13 +113124,10 @@ module.exports = { // | StringLiteral // | NumberLiteral // | ReservedIdentifier - - function parseFieldType() { var key, - rangeStart = previous; + rangeStart = previous; key = parseFieldName(); - if (token === Token.COLON) { consume(Token.COLON); return maybeAddRange({ @@ -126690,99 +113136,90 @@ module.exports = { value: parseTypeExpression() }, [rangeStart, previous]); } - return maybeAddRange({ type: Syntax.FieldType, key: key, value: null }, [rangeStart, previous]); - } // RecordType := '{' FieldTypeList '}' + } + + // RecordType := '{' FieldTypeList '}' // // FieldTypeList := // <> // | FieldType // | FieldType ',' FieldTypeList - - function parseRecordType() { var fields, - rangeStart = index - 1, - rangeEnd; + rangeStart = index - 1, + rangeEnd; consume(Token.LBRACE, 'RecordType should start with {'); fields = []; - if (token === Token.COMMA) { consume(Token.COMMA); } else { while (token !== Token.RBRACE) { fields.push(parseFieldType()); - if (token !== Token.RBRACE) { expect(Token.COMMA); } } } - rangeEnd = index; expect(Token.RBRACE); return maybeAddRange({ type: Syntax.RecordType, fields: fields }, [rangeStart, rangeEnd]); - } // NameExpression := + } + + // NameExpression := // Identifier // | TagIdentifier ':' Identifier // // Tag identifier is one of "module", "external" or "event" // Identifier is the same as Token.NAME, including any dots, something like // namespace.module.MyClass - - function parseNameExpression() { var name = value, - rangeStart = index - name.length; + rangeStart = index - name.length; expect(Token.NAME); - if (token === Token.COLON && (name === 'module' || name === 'external' || name === 'event')) { consume(Token.COLON); name += ':' + value; expect(Token.NAME); } - return maybeAddRange({ type: Syntax.NameExpression, name: name }, [rangeStart, previous]); - } // TypeExpressionList := + } + + // TypeExpressionList := // TopLevelTypeExpression // | TopLevelTypeExpression ',' TypeExpressionList - - function parseTypeExpressionList() { var elements = []; elements.push(parseTop()); - while (token === Token.COMMA) { consume(Token.COMMA); elements.push(parseTop()); } - return elements; - } // TypeName := + } + + // TypeName := // NameExpression // | NameExpression TypeApplication // // TypeApplication := // '.<' TypeExpressionList '>' // | '<' TypeExpressionList '>' // this is extension of doctrine - - function parseTypeName() { var expr, - applications, - startIndex = index - value.length; + applications, + startIndex = index - value.length; expr = parseNameExpression(); - if (token === Token.DOT_LT || token === Token.LT) { next(); applications = parseTypeExpressionList(); @@ -126793,29 +113230,28 @@ module.exports = { applications: applications }, [startIndex, previous]); } - return expr; - } // ResultType := + } + + // ResultType := // <> // | ':' void // | ':' TypeExpression // // BNF is above // but, we remove <> pattern, so token is always TypeToken::COLON - - function parseResultType() { consume(Token.COLON, 'ResultType should start with :'); - if (token === Token.NAME && value === 'void') { consume(Token.NAME); return { type: Syntax.VoidLiteral }; } - return parseTypeExpression(); - } // ParametersType := + } + + // ParametersType := // RestParameterType // | NonRestParametersType // | NonRestParametersType ',' RestParameterType @@ -126838,30 +113274,25 @@ module.exports = { // ParameterType := TypeExpression | Identifier ':' TypeExpression // // Identifier is "new" or "this" - - function parseParametersType() { var params = [], - optionalSequence = false, - expr, - rest = false, - startIndex, - restStartIndex = index - 3, - nameStartIndex; - + optionalSequence = false, + expr, + rest = false, + startIndex, + restStartIndex = index - 3, + nameStartIndex; while (token !== Token.RPAREN) { if (token === Token.REST) { // RestParameterType consume(Token.REST); rest = true; } - startIndex = previous; expr = parseTypeExpression(); - if (expr.type === Syntax.NameExpression && token === Token.COLON) { - nameStartIndex = previous - expr.name.length; // Identifier ':' TypeExpression - + nameStartIndex = previous - expr.name.length; + // Identifier ':' TypeExpression consume(Token.COLON); expr = maybeAddRange({ type: Syntax.ParameterType, @@ -126869,7 +113300,6 @@ module.exports = { expression: parseTypeExpression() }, [nameStartIndex, previous]); } - if (token === Token.EQUAL) { consume(Token.EQUAL); expr = maybeAddRange({ @@ -126882,47 +113312,43 @@ module.exports = { utility.throwError('unexpected token'); } } - if (rest) { expr = maybeAddRange({ type: Syntax.RestType, expression: expr }, [restStartIndex, previous]); } - params.push(expr); - if (token !== Token.RPAREN) { expect(Token.COMMA); } } - return params; - } // FunctionType := 'function' FunctionSignatureType + } + + // FunctionType := 'function' FunctionSignatureType // // FunctionSignatureType := // | TypeParameters '(' ')' ResultType // | TypeParameters '(' ParametersType ')' ResultType // | TypeParameters '(' 'this' ':' TypeName ')' ResultType // | TypeParameters '(' 'this' ':' TypeName ',' ParametersType ')' ResultType - - function parseFunctionType() { var isNew, - thisBinding, - params, - result, - fnType, - startIndex = index - value.length; + thisBinding, + params, + result, + fnType, + startIndex = index - value.length; utility.assert(token === Token.NAME && value === 'function', 'FunctionType should start with \'function\''); - consume(Token.NAME); // Google Closure Compiler is not implementing TypeParameters. - // So we do not. if we don't get '(', we see it as error. + consume(Token.NAME); + // Google Closure Compiler is not implementing TypeParameters. + // So we do not. if we don't get '(', we see it as error. expect(Token.LPAREN); isNew = false; params = []; thisBinding = null; - if (token !== Token.RPAREN) { // ParametersType or 'this' if (token === Token.NAME && (value === 'this' || value === 'new')) { @@ -126932,7 +113358,6 @@ module.exports = { consume(Token.NAME); expect(Token.COLON); thisBinding = parseTypeName(); - if (token === Token.COMMA) { consume(Token.COMMA); params = parseParametersType(); @@ -126941,31 +113366,27 @@ module.exports = { params = parseParametersType(); } } - expect(Token.RPAREN); result = null; - if (token === Token.COLON) { result = parseResultType(); } - fnType = maybeAddRange({ type: Syntax.FunctionType, params: params, result: result }, [startIndex, previous]); - if (thisBinding) { // avoid adding null 'new' and 'this' properties fnType['this'] = thisBinding; - if (isNew) { fnType['new'] = true; } } - return fnType; - } // BasicTypeExpression := + } + + // BasicTypeExpression := // '*' // | 'null' // | 'undefined' @@ -126974,44 +113395,34 @@ module.exports = { // | UnionType // | RecordType // | ArrayType - - function parseBasicTypeExpression() { var context, startIndex; - switch (token) { case Token.STAR: consume(Token.STAR); return maybeAddRange({ type: Syntax.AllLiteral }, [previous - 1, previous]); - case Token.LPAREN: return parseUnionType(); - case Token.LBRACK: return parseArrayType(); - case Token.LBRACE: return parseRecordType(); - case Token.NAME: startIndex = index - value.length; - if (value === 'null') { consume(Token.NAME); return maybeAddRange({ type: Syntax.NullLiteral }, [startIndex, previous]); } - if (value === 'undefined') { consume(Token.NAME); return maybeAddRange({ type: Syntax.UndefinedLiteral }, [startIndex, previous]); } - if (value === 'true' || value === 'false') { consume(Token.NAME); return maybeAddRange({ @@ -127019,9 +113430,7 @@ module.exports = { value: value === 'true' }, [startIndex, previous]); } - context = Context.save(); - if (value === 'function') { try { return parseFunctionType(); @@ -127029,27 +113438,25 @@ module.exports = { context.restore(); } } - return parseTypeName(); - case Token.STRING: next(); return maybeAddRange({ type: Syntax.StringLiteralType, value: value }, [previous - value.length - 2, previous]); - case Token.NUMBER: next(); return maybeAddRange({ type: Syntax.NumericLiteralType, value: value }, [previous - String(value).length, previous]); - default: utility.throwError('unexpected token'); } - } // TypeExpression := + } + + // TypeExpression := // BasicTypeExpression // | '?' BasicTypeExpression // | '!' BasicTypeExpression @@ -127057,21 +113464,16 @@ module.exports = { // | BasicTypeExpression '!' // | '?' // | BasicTypeExpression '[]' - - function parseTypeExpression() { var expr, rangeStart; - if (token === Token.QUESTION) { rangeStart = index - 1; consume(Token.QUESTION); - if (token === Token.COMMA || token === Token.EQUAL || token === Token.RBRACE || token === Token.RPAREN || token === Token.PIPE || token === Token.EOF || token === Token.RBRACK || token === Token.GT) { return maybeAddRange({ type: Syntax.NullableLiteral }, [rangeStart, previous]); } - return maybeAddRange({ type: Syntax.NullableType, expression: parseBasicTypeExpression(), @@ -127088,9 +113490,7 @@ module.exports = { } else { rangeStart = previous; } - expr = parseBasicTypeExpression(); - if (token === Token.BANG) { consume(Token.BANG); return maybeAddRange({ @@ -127099,7 +113499,6 @@ module.exports = { prefix: false }, [rangeStart, previous]); } - if (token === Token.QUESTION) { consume(Token.QUESTION); return maybeAddRange({ @@ -127108,7 +113507,6 @@ module.exports = { prefix: false }, [rangeStart, previous]); } - if (token === Token.LBRACK) { consume(Token.LBRACK); expect(Token.RBRACK, 'expected an array-style type declaration (' + value + '[])'); @@ -127121,9 +113519,10 @@ module.exports = { applications: [expr] }, [rangeStart, previous]); } - return expr; - } // TopLevelTypeExpression := + } + + // TopLevelTypeExpression := // TypeExpression // | TypeUnionList // @@ -127132,38 +113531,28 @@ module.exports = { // { number | string } // If strict to ES4, we should write it as // { (number|string) } - - function parseTop() { var expr, elements; expr = parseTypeExpression(); - if (token !== Token.PIPE) { return expr; } - elements = [expr]; consume(Token.PIPE); - while (true) { elements.push(parseTypeExpression()); - if (token !== Token.PIPE) { break; } - consume(Token.PIPE); } - return maybeAddRange({ type: Syntax.UnionType, elements: elements }, [0, index]); } - function parseTopParamType() { var expr; - if (token === Token.REST) { consume(Token.REST); return maybeAddRange({ @@ -127171,9 +113560,7 @@ module.exports = { expression: parseTop() }, [0, index]); } - expr = parseTop(); - if (token === Token.EQUAL) { consume(Token.EQUAL); return maybeAddRange({ @@ -127181,10 +113568,8 @@ module.exports = { expression: expr }, [0, index]); } - return expr; } - function parseType(src, opt) { var expr; source = src; @@ -127195,21 +113580,17 @@ module.exports = { rangeOffset = opt && opt.startIndex || 0; next(); expr = parseTop(); - if (opt && opt.midstream) { return { expression: expr, index: previous }; } - if (token !== Token.EOF) { utility.throwError('not reach to EOF'); } - return expr; } - function parseParamType(src, opt) { var expr; source = src; @@ -127220,216 +113601,161 @@ module.exports = { rangeOffset = opt && opt.startIndex || 0; next(); expr = parseTopParamType(); - if (opt && opt.midstream) { return { expression: expr, index: previous }; } - if (token !== Token.EOF) { utility.throwError('not reach to EOF'); } - return expr; } - function stringifyImpl(node, compact, topLevel) { var result, i, iz; - switch (node.type) { case Syntax.NullableLiteral: result = '?'; break; - case Syntax.AllLiteral: result = '*'; break; - case Syntax.NullLiteral: result = 'null'; break; - case Syntax.UndefinedLiteral: result = 'undefined'; break; - case Syntax.VoidLiteral: result = 'void'; break; - case Syntax.UnionType: if (!topLevel) { result = '('; } else { result = ''; } - for (i = 0, iz = node.elements.length; i < iz; ++i) { result += stringifyImpl(node.elements[i], compact); - if (i + 1 !== iz) { result += compact ? '|' : ' | '; } } - if (!topLevel) { result += ')'; } - break; - case Syntax.ArrayType: result = '['; - for (i = 0, iz = node.elements.length; i < iz; ++i) { result += stringifyImpl(node.elements[i], compact); - if (i + 1 !== iz) { result += compact ? ',' : ', '; } } - result += ']'; break; - case Syntax.RecordType: result = '{'; - for (i = 0, iz = node.fields.length; i < iz; ++i) { result += stringifyImpl(node.fields[i], compact); - if (i + 1 !== iz) { result += compact ? ',' : ', '; } } - result += '}'; break; - case Syntax.FieldType: if (node.value) { result = node.key + (compact ? ':' : ': ') + stringifyImpl(node.value, compact); } else { result = node.key; } - break; - case Syntax.FunctionType: result = compact ? 'function(' : 'function ('; - if (node['this']) { if (node['new']) { result += compact ? 'new:' : 'new: '; } else { result += compact ? 'this:' : 'this: '; } - result += stringifyImpl(node['this'], compact); - if (node.params.length !== 0) { result += compact ? ',' : ', '; } } - for (i = 0, iz = node.params.length; i < iz; ++i) { result += stringifyImpl(node.params[i], compact); - if (i + 1 !== iz) { result += compact ? ',' : ', '; } } - result += ')'; - if (node.result) { result += (compact ? ':' : ': ') + stringifyImpl(node.result, compact); } - break; - case Syntax.ParameterType: result = node.name + (compact ? ':' : ': ') + stringifyImpl(node.expression, compact); break; - case Syntax.RestType: result = '...'; - if (node.expression) { result += stringifyImpl(node.expression, compact); } - break; - case Syntax.NonNullableType: if (node.prefix) { result = '!' + stringifyImpl(node.expression, compact); } else { result = stringifyImpl(node.expression, compact) + '!'; } - break; - case Syntax.OptionalType: result = stringifyImpl(node.expression, compact) + '='; break; - case Syntax.NullableType: if (node.prefix) { result = '?' + stringifyImpl(node.expression, compact); } else { result = stringifyImpl(node.expression, compact) + '?'; } - break; - case Syntax.NameExpression: result = node.name; break; - case Syntax.TypeApplication: result = stringifyImpl(node.expression, compact) + '.<'; - for (i = 0, iz = node.applications.length; i < iz; ++i) { result += stringifyImpl(node.applications[i], compact); - if (i + 1 !== iz) { result += compact ? ',' : ', '; } } - result += '>'; break; - case Syntax.StringLiteralType: result = '"' + node.value + '"'; break; - case Syntax.NumericLiteralType: result = String(node.value); break; - case Syntax.BooleanLiteralType: result = String(node.value); break; - default: utility.throwError('Unknown type ' + node.type); } - return result; } - function stringify(node, options) { if (options == null) { options = {}; } - return stringifyImpl(node, options.compact, options.topLevel); } - exports.parseType = parseType; exports.parseParamType = parseParamType; exports.stringify = stringify; @@ -127438,53 +113764,49 @@ module.exports = { /* vim: set sw=4 ts=4 et tw=80 : */ /***/ }), -/* 937 */ +/* 947 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* * @fileoverview Utilities for Doctrine * @author Yusuke Suzuki */ + (function () { 'use strict'; var VERSION; - VERSION = (__webpack_require__(938).version); + VERSION = (__webpack_require__(948).version); exports.VERSION = VERSION; - function DoctrineError(message) { this.name = 'DoctrineError'; this.message = message; } - DoctrineError.prototype = function () { var Middle = function () {}; - Middle.prototype = Error.prototype; return new Middle(); }(); - DoctrineError.prototype.constructor = DoctrineError; exports.DoctrineError = DoctrineError; - function throwError(message) { throw new DoctrineError(message); } - exports.throwError = throwError; - exports.assert = __webpack_require__(503); + exports.assert = __webpack_require__(525); })(); + /* vim: set sw=4 ts=4 et tw=80 : */ /***/ }), -/* 938 */ +/* 948 */ /***/ ((module) => { "use strict"; module.exports = JSON.parse('{"name":"doctrine","description":"JSDoc parser","homepage":"https://github.com/eslint/doctrine","main":"lib/doctrine.js","version":"3.0.0","engines":{"node":">=6.0.0"},"directories":{"lib":"./lib"},"files":["lib"],"maintainers":[{"name":"Nicholas C. Zakas","email":"nicholas+npm@nczconsulting.com","web":"https://www.nczonline.net"},{"name":"Yusuke Suzuki","email":"utatane.tea@gmail.com","web":"https://github.com/Constellation"}],"repository":"eslint/doctrine","devDependencies":{"coveralls":"^3.0.1","dateformat":"^1.0.11","eslint":"^1.10.3","eslint-release":"^1.0.0","linefix":"^0.1.1","mocha":"^3.4.2","npm-license":"^0.3.1","nyc":"^10.3.2","semver":"^5.0.3","shelljs":"^0.5.3","shelljs-nodecli":"^0.1.1","should":"^5.0.1"},"license":"Apache-2.0","scripts":{"pretest":"npm run lint","test":"nyc mocha","coveralls":"nyc report --reporter=text-lcov | coveralls","lint":"eslint lib/","generate-release":"eslint-generate-release","generate-alpharelease":"eslint-generate-prerelease alpha","generate-betarelease":"eslint-generate-prerelease beta","generate-rcrelease":"eslint-generate-prerelease rc","publish-release":"eslint-publish-release"},"dependencies":{"esutils":"^2.0.2"}}'); /***/ }), -/* 939 */ +/* 949 */ /***/ ((module) => { "use strict"; @@ -127492,19 +113814,20 @@ module.exports = JSON.parse('{"name":"doctrine","description":"JSDoc parser","ho * @fileoverview Ensures that the results of typeof are compared against a valid string * @author Ian Christian Myers */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "problem", docs: { description: "Enforce comparing `typeof` expressions against valid strings", recommended: true, - url: "https://eslint.org/docs/rules/valid-typeof" + url: "https://eslint.org/docs/latest/rules/valid-typeof" }, hasSuggestions: true, schema: [{ @@ -127523,52 +113846,50 @@ module.exports = { suggestString: 'Use `"{{type}}"` instead of `{{type}}`.' } }, - create(context) { const VALID_TYPES = new Set(["symbol", "undefined", "object", "boolean", "number", "string", "function", "bigint"]), - OPERATORS = new Set(["==", "===", "!=", "!=="]); + OPERATORS = new Set(["==", "===", "!=", "!=="]); + const sourceCode = context.sourceCode; const requireStringLiterals = context.options[0] && context.options[0].requireStringLiterals; let globalScope; + /** * 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 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 { - Program() { - globalScope = context.getScope(); + Program(node) { + globalScope = sourceCode.getScope(node); }, - UnaryExpression(node) { if (isTypeofExpression(node)) { - const parent = context.getAncestors().pop(); - + const { + parent + } = node; if (parent.type === "BinaryExpression" && OPERATORS.has(parent.operator)) { 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.has(value)) { context.report({ node: sibling, @@ -127584,11 +113905,9 @@ module.exports = { data: { type: "undefined" }, - fix(fixer) { return fixer.replaceText(sibling, '"undefined"'); } - }] }); } else if (requireStringLiterals && !isTypeofExpression(sibling)) { @@ -127600,14 +113919,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 940 */ +/* 950 */ /***/ ((module) => { "use strict"; @@ -127616,26 +113933,26 @@ module.exports = { * @author Danny Fritz * @author Gyandeep Singh */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "suggestion", docs: { description: "Require `var` declarations be placed at the top of their containing scope", recommended: false, - url: "https://eslint.org/docs/rules/vars-on-top" + url: "https://eslint.org/docs/latest/rules/vars-on-top" }, schema: [], messages: { top: "All 'var' declarations must be at the top of the function scope." } }, - create(context) { //-------------------------------------------------------------------------- // Helpers @@ -127649,38 +113966,36 @@ module.exports = { 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 and imports. Static blocks don't have either. + let i = 0; + // Skip over directives and imports. Static blocks don't have either. if (node.parent.type !== "StaticBlock") { for (; i < l; ++i) { if (!looksLikeDirective(statements[i]) && !looksLikeImport(statements[i])) { @@ -127688,27 +114003,23 @@ module.exports = { } } } - 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({ @@ -127717,35 +114028,32 @@ module.exports = { }); } } + /** * Checks whether variable is on top at functional block scope level * @param {ASTNode} node The node to check * @returns {void} */ - - function blockScopeVarCheck(node) { const { parent } = node; - if (parent.type === "BlockStatement" && /Function/u.test(parent.parent.type) && isVarOnTop(node, parent.body)) { return; } - if (parent.type === "StaticBlock" && isVarOnTop(node, parent.body)) { return; } - context.report({ node, messageId: "top" }); - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // Public API //-------------------------------------------------------------------------- - return { "VariableDeclaration[kind='var']"(node) { if (node.parent.type === "ExportNamedDeclaration") { @@ -127756,14 +114064,12 @@ module.exports = { blockScopeVarCheck(node); } } - }; } - }; /***/ }), -/* 941 */ +/* 951 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -127771,13 +114077,16 @@ module.exports = { * @fileoverview Rule to flag when IIFE is not wrapped in parens * @author Ilya Volodin */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const astUtils = __webpack_require__(639); +const eslintUtils = __webpack_require__(594); -const astUtils = __webpack_require__(618); - -const eslintUtils = __webpack_require__(571); //---------------------------------------------------------------------- +//---------------------------------------------------------------------- // Helpers //---------------------------------------------------------------------- @@ -127787,25 +114096,23 @@ const eslintUtils = __webpack_require__(571); //-------------------------------- * @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 //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "layout", docs: { description: "Require parentheses around immediate `function` invocations", recommended: false, - url: "https://eslint.org/docs/rules/wrap-iife" + url: "https://eslint.org/docs/latest/rules/wrap-iife" }, schema: [{ enum: ["outside", "inside", "any"] @@ -127826,106 +114133,93 @@ module.exports = { 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(); + const sourceCode = context.sourceCode; + /** * 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); - + 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. @@ -127936,18 +114230,15 @@ module.exports = { const parenAfter = sourceCode.getTokenAfter(innerNode); return fixer.replaceTextRange([parenAfter.range[0], node.range[1]], `${sourceCode.getText().slice(parenAfter.range[1], node.range[1])})`); } - }); } } - }; } - }; /***/ }), -/* 942 */ +/* 952 */ /***/ ((module) => { "use strict"; @@ -127955,19 +114246,21 @@ module.exports = { * @fileoverview Rule to flag when regex literals are not wrapped in parens * @author Matt DuVall */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "layout", docs: { description: "Require parenthesis around regex literals", recommended: false, - url: "https://eslint.org/docs/rules/wrap-regex" + url: "https://eslint.org/docs/latest/rules/wrap-regex" }, schema: [], fixable: "code", @@ -127975,21 +114268,19 @@ module.exports = { requireParens: "Wrap the regexp literal in parens to disambiguate the slash." } }, - create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; return { Literal(node) { const token = sourceCode.getFirstToken(node), - nodeType = token.type; - + 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 === ")")) { + const { + parent + } = node; + if (parent.type === "MemberExpression" && parent.object === node && !(beforeToken && beforeToken.value === "(" && afterToken && afterToken.value === ")")) { context.report({ node, messageId: "requireParens", @@ -127998,14 +114289,12 @@ module.exports = { } } } - }; } - }; /***/ }), -/* 943 */ +/* 953 */ /***/ ((module) => { "use strict"; @@ -128013,19 +114302,21 @@ module.exports = { * @fileoverview Rule to check the spacing around the * in yield* expressions. * @author Bryan Smith */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - module.exports = { meta: { type: "layout", docs: { description: "Require or disallow spacing around the `*` in `yield*` expressions", recommended: false, - url: "https://eslint.org/docs/rules/yield-star-spacing" + url: "https://eslint.org/docs/latest/rules/yield-star-spacing" }, fixable: "whitespace", schema: [{ @@ -128051,10 +114342,8 @@ module.exports = { unexpectedAfter: "Unexpected space after *." } }, - create(context) { - const sourceCode = context.getSourceCode(); - + const sourceCode = context.sourceCode; const mode = function (option) { if (!option || typeof option === "string") { return { @@ -128076,9 +114365,9 @@ module.exports = { } }[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". @@ -128088,52 +114377,42 @@ module.exports = { * 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]; @@ -128141,16 +114420,14 @@ module.exports = { checkSpacing("before", yieldToken, starToken); checkSpacing("after", starToken, nextToken); } - return { YieldExpression: checkExpression }; } - }; /***/ }), -/* 944 */ +/* 954 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -128158,11 +114435,14 @@ module.exports = { * @fileoverview Rule to require or disallow yoda comparisons * @author Nicholas C. Zakas */ - //-------------------------------------------------------------------------- + + +//-------------------------------------------------------------------------- // Requirements //-------------------------------------------------------------------------- +const astUtils = __webpack_require__(639); -const astUtils = __webpack_require__(618); //-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -128171,32 +114451,29 @@ const astUtils = __webpack_require__(618); //----------------------------------- * @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 ["<", "<="].includes(operator); } + /** * Determines whether a non-Literal node is a negative number that should be * treated as if it were a single Literal node. @@ -128204,31 +114481,28 @@ function isRangeTestOperator(operator) { * @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. @@ -128240,13 +114514,10 @@ function looksLikeLiteral(node) { * a Template Literal without expression. * 4. Otherwise `null`. */ - - function getNormalizedLiteral(node) { if (node.type === "Literal") { return node; } - if (isNegativeNumericLiteral(node)) { return { type: "Literal", @@ -128254,7 +114525,6 @@ function getNormalizedLiteral(node) { raw: `-${node.argument.value}` }; } - if (isStaticTemplateLiteral(node)) { return { type: "Literal", @@ -128262,22 +114532,21 @@ function getNormalizedLiteral(node) { raw: node.quasis[0].value.raw }; } - return null; -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ - - module.exports = { meta: { type: "suggestion", docs: { description: 'Require or disallow "Yoda" conditions', recommended: false, - url: "https://eslint.org/docs/rules/yoda" + url: "https://eslint.org/docs/latest/rules/yoda" }, schema: [{ enum: ["always", "never"] @@ -128300,13 +114569,13 @@ module.exports = { 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(); + const sourceCode = context.sourceCode; + /** * Determines whether node represents a range test. * A range test is a "between" test like `(0 <= x && x < 1)` or an "outside" @@ -128317,76 +114586,63 @@ module.exports = { * @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; + 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 = { "===": "===", "!==": "!==", @@ -128397,12 +114653,12 @@ module.exports = { "<=": ">=", ">=": "<=" }; + /** * 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 operatorToken = sourceCode.getFirstTokenBetween(node.left, node.right, token => token.value === node.operator); const lastLeftToken = sourceCode.getTokenBefore(operatorToken); @@ -128416,27 +114672,26 @@ module.exports = { const tokenAfter = sourceCode.getTokenAfter(node); let prefix = ""; let suffix = ""; - if (tokenBefore && tokenBefore.range[1] === node.range[0] && !astUtils.canTokensBeAdjacent(tokenBefore, firstRightToken)) { prefix = " "; } - if (tokenAfter && node.range[1] === tokenAfter.range[0] && !astUtils.canTokensBeAdjacent(lastLeftToken, tokenAfter)) { suffix = " "; } - return prefix + rightText + textBeforeOperator + OPERATOR_FLIP_MAP[operatorToken.value] + textAfterOperator + leftText + suffix; - } //-------------------------------------------------------------------------- + } + + //-------------------------------------------------------------------------- // 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. + const expectedNonLiteral = always ? node.right : node.left; - if ((expectedNonLiteral.type === "Literal" || looksLikeLiteral(expectedNonLiteral)) && !(expectedLiteral.type === "Literal" || looksLikeLiteral(expectedLiteral)) && !(!isEqualityOperator(node.operator) && onlyEquality) && isComparisonOperator(node.operator) && !(exceptRange && isRangeTest(context.getAncestors().pop()))) { + // 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(node.parent))) { context.report({ node, messageId: "expected", @@ -128448,14 +114703,12 @@ module.exports = { }); } } - }; } - }; /***/ }), -/* 945 */ +/* 955 */ /***/ ((module) => { function webpackEmptyContext(req) { @@ -128465,11 +114718,11 @@ function webpackEmptyContext(req) { } webpackEmptyContext.keys = () => ([]); webpackEmptyContext.resolve = webpackEmptyContext; -webpackEmptyContext.id = 945; +webpackEmptyContext.id = 955; module.exports = webpackEmptyContext; /***/ }), -/* 946 */ +/* 956 */ /***/ ((module) => { "use strict"; @@ -128477,7 +114730,10 @@ module.exports = webpackEmptyContext; * @fileoverview A variant of EventEmitter which does not give listeners information about each other * @author Teddy Katz */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Typedefs //------------------------------------------------------------------------------ @@ -128501,7 +114757,6 @@ module.exports = webpackEmptyContext; * `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({ @@ -128512,26 +114767,22 @@ module.exports = () => { listeners[eventName] = [listener]; } }, - emit(eventName) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } - if (eventName in listeners) { listeners[eventName].forEach(listener => listener(...args)); } }, - eventNames() { return Object.keys(listeners); } - }); }; /***/ }), -/* 947 */ +/* 957 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -128539,16 +114790,19 @@ module.exports = () => { * @fileoverview An object that caches and applies source code fixes. * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const debug = __webpack_require__(589)("eslint:source-code-fixer"); -const debug = __webpack_require__(566)("eslint:source-code-fixer"); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - const BOM = "\uFEFF"; + /** * Compares items in a messages array by range. * @param {Message} a The first message. @@ -128556,10 +114810,10 @@ const BOM = "\uFEFF"; * @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. @@ -128567,11 +114821,11 @@ function compareMessagesByFixRange(a, b) { * @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 //------------------------------------------------------------------------------ @@ -128579,11 +114833,10 @@ function compareMessagesByLocation(a, b) { * 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. @@ -128592,11 +114845,8 @@ function SourceCodeFixer() { * @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 { @@ -128604,43 +114854,43 @@ SourceCodeFixer.applyFixes = function (sourceText, messages, shouldFix) { messages, output: sourceText }; - } // clone the array - + } + // clone the array const remainingMessages = [], - fixes = [], - bom = sourceText.startsWith(BOM) ? BOM : "", - text = bom ? sourceText.slice(1) : sourceText; + fixes = [], + bom = sourceText.startsWith(BOM) ? BOM : "", + text = bom ? sourceText.slice(1) : sourceText; let lastPos = Number.NEGATIVE_INFINITY, - output = bom; + 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 + 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. - + } + // Remove BOM. if (start < 0 && end >= 0 || start === 0 && fix.text.startsWith(BOM)) { output = ""; - } // Make output to this fix. - + } + // 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); @@ -128648,25 +114898,22 @@ SourceCodeFixer.applyFixes = function (sourceText, messages, shouldFix) { 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, @@ -128674,7 +114921,6 @@ SourceCodeFixer.applyFixes = function (sourceText, messages, shouldFix) { output }; } - debug("No fixes to apply"); return { fixed: false, @@ -128682,11 +114928,10 @@ SourceCodeFixer.applyFixes = function (sourceText, messages, shouldFix) { output: bom + text }; }; - module.exports = SourceCodeFixer; /***/ }), -/* 948 */ +/* 958 */ /***/ ((module) => { "use strict"; @@ -128694,12 +114939,14 @@ module.exports = SourceCodeFixer; * @fileoverview Tracks performance of individual rules. * @author Brandon Mills */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ /* c8 ignore next */ - /** * Align the string to left * @param {string} str string to evaluate @@ -128708,12 +114955,11 @@ module.exports = SourceCodeFixer; * @returns {string} modified string * @private */ - function alignLeft(str, len, ch) { return str + new Array(len - str.length + 1).join(ch || " "); } -/* c8 ignore next */ +/* c8 ignore next */ /** * Align the string to right * @param {string} str string to evaluate @@ -128722,47 +114968,41 @@ function alignLeft(str, len, ch) { * @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]; + /** * Decide how many rules to show in the output list. * @returns {number} the number of rules to show */ - function getListSize() { const MINIMUM_SIZE = 10; - if (typeof process.env.TIMING !== "string") { return MINIMUM_SIZE; } - if (process.env.TIMING.toLowerCase() === "all") { return Number.POSITIVE_INFINITY; } - const TIMING_ENV_VAR_AS_INTEGER = Number.parseInt(process.env.TIMING, 10); return TIMING_ENV_VAR_AS_INTEGER > 10 ? TIMING_ENV_VAR_AS_INTEGER : MINIMUM_SIZE; } -/* c8 ignore next */ +/* c8 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 => { @@ -128778,10 +115018,8 @@ function display(data) { 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; } @@ -128794,11 +115032,11 @@ function display(data) { }).join("|")); console.log(table.join("\n")); // eslint-disable-line no-console -- Debugging function } + /* c8 ignore next */ - - module.exports = function () { const data = Object.create(null); + /** * Time the run * @param {any} key key from the data object @@ -128806,12 +115044,10 @@ module.exports = function () { * @returns {Function} function to be executed * @private */ - function time(key, fn) { if (typeof data[key] === "undefined") { data[key] = 0; } - return function () { let t = process.hrtime(); const result = fn(...arguments); @@ -128820,13 +115056,11 @@ module.exports = function () { return result; }; } - if (enabled) { process.on("exit", () => { display(data); }); } - return { time, enabled, @@ -128835,14 +115069,14 @@ module.exports = function () { }(); /***/ }), -/* 949 */ +/* 959 */ /***/ ((module) => { "use strict"; module.exports = JSON.parse('{"rules":{"generator-star":["generator-star-spacing"],"global-strict":["strict"],"no-arrow-condition":["no-confusing-arrow","no-constant-condition"],"no-comma-dangle":["comma-dangle"],"no-empty-class":["no-empty-character-class"],"no-empty-label":["no-labels"],"no-extra-strict":["strict"],"no-reserved-keys":["quote-props"],"no-space-before-semi":["semi-spacing"],"no-wrap-func":["no-extra-parens"],"space-after-function-name":["space-before-function-paren"],"space-after-keywords":["keyword-spacing"],"space-before-function-parentheses":["space-before-function-paren"],"space-before-keywords":["keyword-spacing"],"space-in-brackets":["object-curly-spacing","array-bracket-spacing","computed-property-spacing"],"space-return-throw-case":["keyword-spacing"],"space-unary-word-ops":["space-unary-ops"],"spaced-line-comment":["spaced-comment"]}}'); /***/ }), -/* 950 */ +/* 960 */ /***/ ((module) => { "use strict"; @@ -128850,7 +115084,10 @@ module.exports = JSON.parse('{"rules":{"generator-star":["generator-star-spacing * @fileoverview Shared functions to work with configs. * @author Nicholas C. Zakas */ - //----------------------------------------------------------------------------- + + + +//----------------------------------------------------------------------------- // Functions //----------------------------------------------------------------------------- @@ -128860,10 +115097,10 @@ module.exports = JSON.parse('{"rules":{"generator-star":["generator-star-spacing * @returns {{pluginName:string,ruleName:string}} The plugin and rule * parts of the ruleId; */ - function parseRuleId(ruleId) { - let pluginName, ruleName; // distinguish between core rules and plugin rules + let pluginName, ruleName; + // distinguish between core rules and plugin rules if (ruleId.includes("/")) { // mimic scoped npm packages if (ruleId.startsWith("@")) { @@ -128871,18 +115108,17 @@ function parseRuleId(ruleId) { } else { pluginName = ruleId.slice(0, ruleId.indexOf("/")); } - ruleName = ruleId.slice(pluginName.length + 1); } else { pluginName = "@"; ruleName = ruleId; } - return { pluginName, ruleName }; } + /** * Retrieves a rule instance from a given config based on the ruleId. * @param {string} ruleId The rule ID to look for. @@ -128890,38 +115126,33 @@ function parseRuleId(ruleId) { * @returns {import("../shared/types").Rule|undefined} The rule if found * or undefined if not. */ - - function getRuleFromConfig(ruleId, config) { const { pluginName, ruleName } = parseRuleId(ruleId); const plugin = config.plugins && config.plugins[pluginName]; - let rule = plugin && plugin.rules && plugin.rules[ruleName]; // normalize function rules into objects + let rule = plugin && plugin.rules && plugin.rules[ruleName]; + // normalize function rules into objects if (rule && typeof rule === "function") { rule = { create: rule }; } - return rule; } + /** * 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; - if (Array.isArray(schema)) { if (schema.length) { return { @@ -128931,21 +115162,21 @@ function getRuleOptionsSchema(rule) { maxItems: schema.length }; } - return { type: "array", minItems: 0, maxItems: 0 }; - } // Given a full schema, leave it alone - + } + // Given a full schema, leave it alone return schema || null; -} //----------------------------------------------------------------------------- +} + +//----------------------------------------------------------------------------- // Exports //----------------------------------------------------------------------------- - module.exports = { parseRuleId, getRuleFromConfig, @@ -128953,7 +115184,7 @@ module.exports = { }; /***/ }), -/* 951 */ +/* 961 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -128961,40 +115192,39 @@ module.exports = { * @fileoverview Flat Config Array * @author Nicholas C. Zakas */ - //----------------------------------------------------------------------------- + + + +//----------------------------------------------------------------------------- // Requirements //----------------------------------------------------------------------------- - const { ConfigArray, ConfigArraySymbol -} = __webpack_require__(952); - +} = __webpack_require__(962); const { flatConfigSchema -} = __webpack_require__(961); - +} = __webpack_require__(971); const { RuleValidator -} = __webpack_require__(962); - +} = __webpack_require__(972); const { defaultConfig -} = __webpack_require__(965); +} = __webpack_require__(975); +const jsPlugin = __webpack_require__(976); -const recommendedConfig = __webpack_require__(966); //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- // Helpers //----------------------------------------------------------------------------- - const ruleValidator = new RuleValidator(); + /** * Splits a plugin identifier in the form a/b/c into two parts: a/b and c. * @param {string} identifier The identifier to parse. * @returns {{objectName: string, pluginName: string}} The parts of the plugin * name. */ - function splitPluginIdentifier(identifier) { const parts = identifier.split("/"); return { @@ -129003,14 +115233,46 @@ function splitPluginIdentifier(identifier) { }; } -const originalBaseConfig = Symbol("originalBaseConfig"); //----------------------------------------------------------------------------- +/** + * Returns the name of an object in the config by reading its `meta` key. + * @param {Object} object The object to check. + * @returns {string?} The name of the object if found or `null` if there + * is no name. + */ +function getObjectId(object) { + // first check old-style name + let name = object.name; + if (!name) { + if (!object.meta) { + return null; + } + name = object.meta.name; + if (!name) { + return null; + } + } + + // now check for old-style version + let version = object.version; + if (!version) { + version = object.meta && object.meta.version; + } + + // if there's a version then append that + if (version) { + return `${name}@${version}`; + } + return name; +} +const originalBaseConfig = Symbol("originalBaseConfig"); + +//----------------------------------------------------------------------------- // Exports //----------------------------------------------------------------------------- /** * Represents an array containing configuration information for ESLint. */ - class FlatConfigArray extends ConfigArray { /** * Creates a new instance. @@ -129028,36 +115290,34 @@ class FlatConfigArray extends ConfigArray { basePath, schema: flatConfigSchema }); - if (baseConfig[Symbol.iterator]) { this.unshift(...baseConfig); } else { this.unshift(baseConfig); } + /** - * The baes config used to build the config array. + * The base config used to build the config array. * @type {Array} */ - - this[originalBaseConfig] = baseConfig; Object.defineProperty(this, originalBaseConfig, { writable: false }); + /** * Determines if `ignores` fields should be honored. * If true, then all `ignores` fields are honored. * if false, then only `ignores` fields in the baseConfig are honored. * @type {boolean} */ - this.shouldIgnore = shouldIgnore; Object.defineProperty(this, "shouldIgnore", { writable: false }); } - /* eslint-disable class-methods-use-this -- Desired as instance method */ + /* eslint-disable class-methods-use-this -- Desired as instance method */ /** * Replaces a config with another config to allow us to put strings * in the config array that will be replaced by objects before @@ -129065,28 +115325,27 @@ class FlatConfigArray extends ConfigArray { * @param {Object} config The config to preprocess. * @returns {Object} The preprocessed config. */ - - [ConfigArraySymbol.preprocessConfig](config) { if (config === "eslint:recommended") { - return recommendedConfig; + // if we are in a Node.js environment warn the user + if (typeof process !== "undefined" && process.emitWarning) { + process.emitWarning("The 'eslint:recommended' string configuration is deprecated and will be replaced by the @eslint/js package's 'recommended' config."); + } + return jsPlugin.configs.recommended; + } + if (config === "eslint:all") { + // if we are in a Node.js environment warn the user + if (typeof process !== "undefined" && process.emitWarning) { + process.emitWarning("The 'eslint:all' string configuration is deprecated and will be replaced by the @eslint/js package's 'all' config."); + } + return jsPlugin.configs.all; } - if (config === "eslint:all") { - /* - * Load `eslint-all.js` here instead of at the top level to avoid loading all rule modules - * when it isn't necessary. `eslint-all.js` reads `meta` of rule objects to filter out deprecated ones, - * so requiring `eslint-all.js` module loads all rule modules as a consequence. - */ - return __webpack_require__(967); - } /* * If `shouldIgnore` is false, we remove any ignore patterns specified * in the config so long as it's not a default config and it doesn't * have a `files` entry. */ - - if (!this.shouldIgnore && !this[originalBaseConfig].includes(config) && config.ignores && !config.files) { /* eslint-disable-next-line no-unused-vars -- need to strip off other keys */ const { @@ -129095,9 +115354,9 @@ class FlatConfigArray extends ConfigArray { } = config; return otherKeys; } - return config; } + /** * Finalizes the config by replacing plugin references with their objects * and validating rule option schemas. @@ -129105,8 +115364,6 @@ class FlatConfigArray extends ConfigArray { * @returns {Object} The finalized config. * @throws {TypeError} If the config is invalid. */ - - [ConfigArraySymbol.finalizeConfig](config) { const { plugins, @@ -129115,27 +115372,24 @@ class FlatConfigArray extends ConfigArray { } = config; let parserName, processorName; let invalidParser = false, - invalidProcessor = false; // Check parser value + invalidProcessor = false; + // Check parser value if (languageOptions && languageOptions.parser) { - if (typeof languageOptions.parser === "string") { - const { - pluginName, - objectName: localParserName - } = splitPluginIdentifier(languageOptions.parser); - parserName = languageOptions.parser; - - if (!plugins || !plugins[pluginName] || !plugins[pluginName].parsers || !plugins[pluginName].parsers[localParserName]) { - throw new TypeError(`Key "parser": Could not find "${localParserName}" in plugin "${pluginName}".`); + const { + parser + } = languageOptions; + if (typeof parser === "object") { + parserName = getObjectId(parser); + if (!parserName) { + invalidParser = true; } - - languageOptions.parser = plugins[pluginName].parsers[localParserName]; } else { invalidParser = true; } - } // Check processor value - + } + // Check processor value if (processor) { if (typeof processor === "string") { const { @@ -129143,34 +115397,43 @@ class FlatConfigArray extends ConfigArray { objectName: localProcessorName } = splitPluginIdentifier(processor); processorName = processor; - if (!plugins || !plugins[pluginName] || !plugins[pluginName].processors || !plugins[pluginName].processors[localProcessorName]) { throw new TypeError(`Key "processor": Could not find "${localProcessorName}" in plugin "${pluginName}".`); } - config.processor = plugins[pluginName].processors[localProcessorName]; + } else if (typeof processor === "object") { + processorName = getObjectId(processor); + if (!processorName) { + invalidProcessor = true; + } } else { invalidProcessor = true; } } + ruleValidator.validate(config); - ruleValidator.validate(config); // apply special logic for serialization into JSON - + // apply special logic for serialization into JSON /* eslint-disable object-shorthand -- shorthand would change "this" value */ - Object.defineProperty(config, "toJSON", { value: function () { if (invalidParser) { - throw new Error("Caching is not supported when parser is an object."); + throw new Error("Could not serialize parser object (missing 'meta' object)."); } - if (invalidProcessor) { - throw new Error("Caching is not supported when processor is an object."); + throw new Error("Could not serialize processor object (missing 'meta' object)."); } - - return { ...this, - plugins: Object.keys(plugins), - languageOptions: { ...languageOptions, + return { + ...this, + plugins: Object.entries(plugins).map(_ref => { + let [namespace, plugin] = _ref; + const pluginId = getObjectId(plugin); + if (!pluginId) { + return namespace; + } + return `${namespace}:${pluginId}`; + }), + languageOptions: { + ...languageOptions, parser: parserName }, processor: processorName @@ -129182,14 +115445,12 @@ class FlatConfigArray extends ConfigArray { return config; } /* eslint-enable class-methods-use-this -- Desired as instance method */ - - } exports.FlatConfigArray = FlatConfigArray; /***/ }), -/* 952 */ +/* 962 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -129198,22 +115459,19 @@ exports.FlatConfigArray = FlatConfigArray; Object.defineProperty(exports, "__esModule", ({ value: true })); - function _interopDefault(ex) { return ex && typeof ex === 'object' && 'default' in ex ? ex['default'] : ex; } +var path = _interopDefault(__webpack_require__(523)); +var minimatch = _interopDefault(__webpack_require__(963)); +var createDebug = _interopDefault(__webpack_require__(589)); +var objectSchema = __webpack_require__(967); -var path = _interopDefault(__webpack_require__(501)); - -var minimatch = _interopDefault(__webpack_require__(953)); - -var createDebug = _interopDefault(__webpack_require__(566)); - -var objectSchema = __webpack_require__(957); /** * @fileoverview ConfigSchema * @author Nicholas C. Zakas */ + //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ @@ -129224,28 +115482,26 @@ var objectSchema = __webpack_require__(957); * @returns {void} * @throws {TypeError} When the value is not an array. */ - - function assertIsArray(value) { if (!Array.isArray(value)) { throw new TypeError('Expected value to be an array.'); } } + /** * Assets that a given value is an array containing only strings and functions. * @param {*} value The value to check. * @returns {void} * @throws {TypeError} When the value is not an array of strings and functions. */ - - function assertIsArrayOfStringsAndFunctions(value, name) { assertIsArray(value); - if (value.some(item => typeof item !== 'string' && typeof item !== 'function')) { throw new TypeError('Expected array to only contain strings.'); } -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Exports //------------------------------------------------------------------------------ @@ -129253,34 +115509,28 @@ function assertIsArrayOfStringsAndFunctions(value, name) { * The base schema that every ConfigArray uses. * @type Object */ - - const baseSchema = Object.freeze({ name: { required: false, - merge() { return undefined; }, - validate(value) { if (typeof value !== 'string') { throw new TypeError('Property must be a string.'); } } - }, files: { required: false, - merge() { return undefined; }, - validate(value) { // first check if it's an array - assertIsArray(value); // then check each member + assertIsArray(value); + // then check each member value.forEach(item => { if (Array.isArray(item)) { assertIsArrayOfStringsAndFunctions(item); @@ -129289,41 +115539,78 @@ const baseSchema = Object.freeze({ } }); } - }, ignores: { required: false, - merge() { return undefined; }, - validate: assertIsArrayOfStringsAndFunctions } }); + /** * @fileoverview ConfigArray * @author Nicholas C. Zakas */ + //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ +const Minimatch = minimatch.Minimatch; +const minimatchCache = new Map(); +const negatedMinimatchCache = new Map(); const debug = createDebug('@hwc/config-array'); const MINIMATCH_OPTIONS = { // matchBase: true, dot: true }; const CONFIG_TYPES = new Set(['array', 'function']); + /** * Shorthand for checking if a value is a string. * @param {any} value The value to check. * @returns {boolean} True if a string, false if not. */ - function isString(value) { return typeof value === 'string'; } + +/** + * Asserts that the files key of a config object is a nonempty array. + * @param {object} config The config object to check. + * @returns {void} + * @throws {TypeError} If the files key isn't a nonempty array. + */ +function assertNonEmptyFilesArray(config) { + if (!Array.isArray(config.files) || config.files.length === 0) { + throw new TypeError('The files key must be a non-empty array.'); + } +} + +/** + * Wrapper around minimatch that caches minimatch patterns for + * faster matching speed over multiple file path evaluations. + * @param {string} filepath The file path to match. + * @param {string} pattern The glob pattern to match against. + * @param {object} options The minimatch options to use. + * @returns + */ +function doMatch(filepath, pattern) { + let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + let cache = minimatchCache; + if (options.flipNegate) { + cache = negatedMinimatchCache; + } + let matcher = cache.get(pattern); + if (!matcher) { + matcher = new Minimatch(pattern, Object.assign({}, MINIMATCH_OPTIONS, options)); + cache.set(pattern, matcher); + } + return matcher.match(filepath); +} + /** * Normalizes a `ConfigArray` by flattening it and executing any functions * that are found inside. @@ -129334,31 +115621,24 @@ function isString(value) { * @returns {Promise} A flattened array containing only config objects. * @throws {TypeError} When a config function returns a function. */ - - async function normalize(items, context, extraConfigTypes) { const allowFunctions = extraConfigTypes.includes('function'); const allowArrays = extraConfigTypes.includes('array'); - async function* flatTraverse(array) { for (let item of array) { if (typeof item === 'function') { if (!allowFunctions) { throw new TypeError('Unexpected function.'); } - item = item(context); - if (item.then) { item = await item; } } - if (Array.isArray(item)) { if (!allowArrays) { throw new TypeError('Unexpected array.'); } - yield* flatTraverse(item); } else if (typeof item === 'function') { throw new TypeError('A config function can only return an object or array.'); @@ -129367,21 +115647,19 @@ async function normalize(items, context, extraConfigTypes) { } } } + /* * Async iterables cannot be used with the spread operator, so we need to manually * create the array to return. */ - - const asyncIterable = await flatTraverse(items); const configs = []; - for await (const config of asyncIterable) { configs.push(config); } - return configs; } + /** * Normalizes a `ConfigArray` by flattening it and executing any functions * that are found inside. @@ -129392,31 +115670,24 @@ async function normalize(items, context, extraConfigTypes) { * @returns {Array} A flattened array containing only config objects. * @throws {TypeError} When a config function returns a function. */ - - function normalizeSync(items, context, extraConfigTypes) { const allowFunctions = extraConfigTypes.includes('function'); const allowArrays = extraConfigTypes.includes('array'); - function* flatTraverse(array) { for (let item of array) { if (typeof item === 'function') { if (!allowFunctions) { throw new TypeError('Unexpected function.'); } - item = item(context); - if (item.then) { throw new TypeError('Async config functions are not supported.'); } } - if (Array.isArray(item)) { if (!allowArrays) { throw new TypeError('Unexpected array.'); } - yield* flatTraverse(item); } else if (typeof item === 'function') { throw new TypeError('A config function can only return an object or array.'); @@ -129425,9 +115696,9 @@ function normalizeSync(items, context, extraConfigTypes) { } } } - return [...flatTraverse(items)]; } + /** * Determines if a given file path should be ignored based on the given * matcher. @@ -129436,49 +115707,36 @@ function normalizeSync(items, context, extraConfigTypes) { * @param {string} relativeFilePath The relative path of the file to check. * @returns {boolean} True if the path should be ignored and false if not. */ - - -function shouldIgnoreFilePath(ignores, filePath, relativeFilePath) { +function shouldIgnorePath(ignores, filePath, relativeFilePath) { // all files outside of the basePath are ignored if (relativeFilePath.startsWith('..')) { return true; } - - let shouldIgnore = false; - - for (const matcher of ignores) { - if (typeof matcher === 'function') { - shouldIgnore = shouldIgnore || matcher(filePath); - continue; - } - /* - * If there's a negated pattern, that means anything matching - * must NOT be ignored. To do that, we need to use the `flipNegate` - * option for minimatch to check if the filepath matches the - * pattern specified after the !, and if that result is true, - * then we return false immediately because this file should - * never be ignored. - */ - - - if (matcher.startsWith('!')) { - /* - * The file must already be ignored in order to apply a negated - * pattern, because negated patterns simply remove files that - * would already be ignored. - */ - if (shouldIgnore && minimatch(relativeFilePath, matcher, { ...MINIMATCH_OPTIONS, - flipNegate: true - })) { - return false; + return ignores.reduce((ignored, matcher) => { + if (!ignored) { + if (typeof matcher === 'function') { + return matcher(filePath); } - } else { - shouldIgnore = shouldIgnore || minimatch(relativeFilePath, matcher, MINIMATCH_OPTIONS); - } - } - return shouldIgnore; + // don't check negated patterns because we're not ignored yet + if (!matcher.startsWith('!')) { + return doMatch(relativeFilePath, matcher); + } + + // otherwise we're still not ignored + return false; + } + + // only need to check negated patterns because we're ignored + if (typeof matcher === 'string' && matcher.startsWith('!')) { + return !doMatch(relativeFilePath, matcher, { + flipNegate: true + }); + } + return ignored; + }, false); } + /** * Determines if a given file path is matched by a config. If the config * has no `files` field, then it matches; otherwise, if a `files` field @@ -129489,103 +115747,95 @@ function shouldIgnoreFilePath(ignores, filePath, relativeFilePath) { * @returns {boolean} True if the file path is matched by the config, * false if not. */ - - function pathMatches(filePath, basePath, config) { /* * For both files and ignores, functions are passed the absolute * file path while strings are compared against the relative * file path. */ - const relativeFilePath = path.relative(basePath, filePath); // if files isn't an array, throw an error - - if (!Array.isArray(config.files) || config.files.length === 0) { - throw new TypeError('The files key must be a non-empty array.'); - } // match both strings and functions + const relativeFilePath = path.relative(basePath, filePath); + // if files isn't an array, throw an error + assertNonEmptyFilesArray(config); + // match both strings and functions const match = pattern => { if (isString(pattern)) { - return minimatch(relativeFilePath, pattern, MINIMATCH_OPTIONS); + return doMatch(relativeFilePath, pattern); } - if (typeof pattern === 'function') { return pattern(filePath); } - throw new TypeError(`Unexpected matcher type ${pattern}.`); - }; // check for all matches to config.files - + }; + // check for all matches to config.files let filePathMatchesPattern = config.files.some(pattern => { if (Array.isArray(pattern)) { return pattern.every(match); } - return match(pattern); }); + /* * If the file path matches the config.files patterns, then check to see * if there are any files to ignore. */ - if (filePathMatchesPattern && config.ignores) { - filePathMatchesPattern = !shouldIgnoreFilePath(config.ignores, filePath, relativeFilePath); + filePathMatchesPattern = !shouldIgnorePath(config.ignores, filePath, relativeFilePath); } - return filePathMatchesPattern; } + /** * Ensures that a ConfigArray has been normalized. * @param {ConfigArray} configArray The ConfigArray to check. * @returns {void} * @throws {Error} When the `ConfigArray` is not normalized. */ - - function assertNormalized(configArray) { // TODO: Throw more verbose error if (!configArray.isNormalized()) { throw new Error('ConfigArray must be normalized to perform this operation.'); } } + /** * Ensures that config types are valid. * @param {Array} extraConfigTypes The config types to check. * @returns {void} * @throws {Error} When the config types array is invalid. */ - - function assertExtraConfigTypes(extraConfigTypes) { if (extraConfigTypes.length > 2) { throw new TypeError('configTypes must be an array with at most two items.'); } - for (const configType of extraConfigTypes) { if (!CONFIG_TYPES.has(configType)) { throw new TypeError(`Unexpected config type "${configType}" found. Expected one of: "object", "array", "function".`); } } -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ - const ConfigArraySymbol = { isNormalized: Symbol('isNormalized'), configCache: Symbol('configCache'), schema: Symbol('schema'), finalizeConfig: Symbol('finalizeConfig'), preprocessConfig: Symbol('preprocessConfig') -}; // used to store calculate data for faster lookup +}; +// used to store calculate data for faster lookup const dataCache = new WeakMap(); + /** * Represents an array of config objects and provides method for working with * those config objects. */ - class ConfigArray extends Array { /** * Creates a new instance of ConfigArray. @@ -129606,126 +115856,126 @@ class ConfigArray extends Array { extraConfigTypes = [] } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; super(); - /** - * Tracks if the array has been normalized. - * @property isNormalized - * @type boolean - * @private - */ + /** + * Tracks if the array has been normalized. + * @property isNormalized + * @type boolean + * @private + */ this[ConfigArraySymbol.isNormalized] = normalized; - /** - * The schema used for validating and merging configs. - * @property schema - * @type ObjectSchema - * @private - */ - this[ConfigArraySymbol.schema] = new objectSchema.ObjectSchema({ ...customSchema, - ...baseSchema - }); /** - * The path of the config file that this array was loaded from. - * This is used to calculate filename matches. - * @property basePath - * @type string - */ + * The schema used for validating and merging configs. + * @property schema + * @type ObjectSchema + * @private + */ + this[ConfigArraySymbol.schema] = new objectSchema.ObjectSchema(Object.assign({}, customSchema, baseSchema)); + /** + * The path of the config file that this array was loaded from. + * This is used to calculate filename matches. + * @property basePath + * @type string + */ this.basePath = basePath; assertExtraConfigTypes(extraConfigTypes); - /** - * The supported config types. - * @property configTypes - * @type Array - */ + /** + * The supported config types. + * @property configTypes + * @type Array + */ this.extraConfigTypes = Object.freeze([...extraConfigTypes]); + /** - * A cache to store calculated configs for faster repeat lookup. - * @property configCache - * @type Map - * @private - */ - - this[ConfigArraySymbol.configCache] = new Map(); // init cache + * A cache to store calculated configs for faster repeat lookup. + * @property configCache + * @type Map + * @private + */ + this[ConfigArraySymbol.configCache] = new Map(); + // init cache dataCache.set(this, { - explicitMatches: new Map() - }); // load the configs into this array + explicitMatches: new Map(), + directoryMatches: new Map(), + files: undefined, + ignores: undefined + }); + // load the configs into this array if (Array.isArray(configs)) { this.push(...configs); } else { this.push(configs); } } + /** - * Prevent normal array methods from creating a new `ConfigArray` instance. - * This is to ensure that methods such as `slice()` won't try to create a - * new instance of `ConfigArray` behind the scenes as doing so may throw - * an error due to the different constructor signature. - * @returns {Function} The `Array` constructor. - */ - - + * Prevent normal array methods from creating a new `ConfigArray` instance. + * This is to ensure that methods such as `slice()` won't try to create a + * new instance of `ConfigArray` behind the scenes as doing so may throw + * an error due to the different constructor signature. + * @returns {Function} The `Array` constructor. + */ static get [Symbol.species]() { return Array; } + /** - * Returns the `files` globs from every config object in the array. - * This can be used to determine which files will be matched by a - * config array or to use as a glob pattern when no patterns are provided - * for a command line interface. - * @returns {Array} An array of matchers. - */ - - + * Returns the `files` globs from every config object in the array. + * This can be used to determine which files will be matched by a + * config array or to use as a glob pattern when no patterns are provided + * for a command line interface. + * @returns {Array} An array of matchers. + */ get files() { - assertNormalized(this); // if this data has been cached, retrieve it + assertNormalized(this); + // if this data has been cached, retrieve it const cache = dataCache.get(this); - if (cache.files) { return cache.files; - } // otherwise calculate it + } + // otherwise calculate it const result = []; - for (const config of this) { if (config.files) { config.files.forEach(filePattern => { result.push(filePattern); }); } - } // store result - + } + // store result cache.files = result; dataCache.set(this, cache); return result; } + /** - * Returns ignore matchers that should always be ignored regardless of - * the matching `files` fields in any configs. This is necessary to mimic - * the behavior of things like .gitignore and .eslintignore, allowing a - * globbing operation to be faster. - * @returns {string[]} An array of string patterns and functions to be ignored. - */ - - + * Returns ignore matchers that should always be ignored regardless of + * the matching `files` fields in any configs. This is necessary to mimic + * the behavior of things like .gitignore and .eslintignore, allowing a + * globbing operation to be faster. + * @returns {string[]} An array of string patterns and functions to be ignored. + */ get ignores() { - assertNormalized(this); // if this data has been cached, retrieve it + assertNormalized(this); + // if this data has been cached, retrieve it const cache = dataCache.get(this); - if (cache.ignores) { return cache.ignores; - } // otherwise calculate it + } + // otherwise calculate it const result = []; - for (const config of this) { /* * We only count ignores if there are no other keys in the object. @@ -129733,235 +115983,365 @@ class ConfigArray extends Array { * are additional keys, then ignores act like exclusions. */ if (config.ignores && Object.keys(config).length === 1) { - result.push(...config.ignores); + /* + * If there are directory ignores, then we need to double up + * the patterns to be ignored. For instance, `foo` will also + * need `foo/**` in order to account for subdirectories. + */ + config.ignores.forEach(ignore => { + result.push(ignore); + if (typeof ignore === 'string') { + // unignoring files won't work unless we unignore directories too + if (ignore.startsWith('!')) { + if (ignore.endsWith('/**')) { + result.push(ignore.slice(0, ignore.length - 3)); + } else if (ignore.endsWith('/*')) { + result.push(ignore.slice(0, ignore.length - 2)); + } + } + + // directories should work with or without a trailing slash + if (ignore.endsWith('/')) { + result.push(ignore.slice(0, ignore.length - 1)); + result.push(ignore + '**'); + } else if (!ignore.endsWith('*')) { + result.push(ignore + '/**'); + } + } + }); } - } // store result - + } + // store result cache.ignores = result; dataCache.set(this, cache); return result; } + /** - * Indicates if the config array has been normalized. - * @returns {boolean} True if the config array is normalized, false if not. - */ - - + * Indicates if the config array has been normalized. + * @returns {boolean} True if the config array is normalized, false if not. + */ isNormalized() { return this[ConfigArraySymbol.isNormalized]; } + /** - * Normalizes a config array by flattening embedded arrays and executing - * config functions. - * @param {ConfigContext} context The context object for config functions. - * @returns {Promise} The current ConfigArray instance. - */ - - + * Normalizes a config array by flattening embedded arrays and executing + * config functions. + * @param {ConfigContext} context The context object for config functions. + * @returns {Promise} The current ConfigArray instance. + */ async normalize() { let context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - if (!this.isNormalized()) { const normalizedConfigs = await normalize(this, context, this.extraConfigTypes); this.length = 0; this.push(...normalizedConfigs.map(this[ConfigArraySymbol.preprocessConfig].bind(this))); - this[ConfigArraySymbol.isNormalized] = true; // prevent further changes + this[ConfigArraySymbol.isNormalized] = true; + // prevent further changes Object.freeze(this); } - return this; } + /** - * Normalizes a config array by flattening embedded arrays and executing - * config functions. - * @param {ConfigContext} context The context object for config functions. - * @returns {ConfigArray} The current ConfigArray instance. - */ - - + * Normalizes a config array by flattening embedded arrays and executing + * config functions. + * @param {ConfigContext} context The context object for config functions. + * @returns {ConfigArray} The current ConfigArray instance. + */ normalizeSync() { let context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - if (!this.isNormalized()) { const normalizedConfigs = normalizeSync(this, context, this.extraConfigTypes); this.length = 0; this.push(...normalizedConfigs.map(this[ConfigArraySymbol.preprocessConfig].bind(this))); - this[ConfigArraySymbol.isNormalized] = true; // prevent further changes + this[ConfigArraySymbol.isNormalized] = true; + // prevent further changes Object.freeze(this); } - return this; } + /** - * Finalizes the state of a config before being cached and returned by - * `getConfig()`. Does nothing by default but is provided to be - * overridden by subclasses as necessary. - * @param {Object} config The config to finalize. - * @returns {Object} The finalized config. - */ - - + * Finalizes the state of a config before being cached and returned by + * `getConfig()`. Does nothing by default but is provided to be + * overridden by subclasses as necessary. + * @param {Object} config The config to finalize. + * @returns {Object} The finalized config. + */ [ConfigArraySymbol.finalizeConfig](config) { return config; } + /** - * Preprocesses a config during the normalization process. This is the - * method to override if you want to convert an array item before it is - * validated for the first time. For example, if you want to replace a - * string with an object, this is the method to override. - * @param {Object} config The config to preprocess. - * @returns {Object} The config to use in place of the argument. - */ - - + * Preprocesses a config during the normalization process. This is the + * method to override if you want to convert an array item before it is + * validated for the first time. For example, if you want to replace a + * string with an object, this is the method to override. + * @param {Object} config The config to preprocess. + * @returns {Object} The config to use in place of the argument. + */ [ConfigArraySymbol.preprocessConfig](config) { return config; } + /** - * Determines if a given file path explicitly matches a `files` entry - * and also doesn't match an `ignores` entry. Configs that don't have - * a `files` property are not considered an explicit match. - * @param {string} filePath The complete path of a file to check. - * @returns {boolean} True if the file path matches a `files` entry - * or false if not. - */ - - + * Determines if a given file path explicitly matches a `files` entry + * and also doesn't match an `ignores` entry. Configs that don't have + * a `files` property are not considered an explicit match. + * @param {string} filePath The complete path of a file to check. + * @returns {boolean} True if the file path matches a `files` entry + * or false if not. + */ isExplicitMatch(filePath) { assertNormalized(this); - const cache = dataCache.get(this); // first check the cache to avoid duplicate work + const cache = dataCache.get(this); + // first check the cache to avoid duplicate work let result = cache.explicitMatches.get(filePath); - if (typeof result == 'boolean') { return result; - } // TODO: Maybe move elsewhere? Maybe combine with getConfig() logic? - + } + // TODO: Maybe move elsewhere? Maybe combine with getConfig() logic? const relativeFilePath = path.relative(this.basePath, filePath); + if (shouldIgnorePath(this.ignores, filePath, relativeFilePath)) { + debug(`Ignoring ${filePath}`); - if (shouldIgnoreFilePath(this.ignores, filePath, relativeFilePath)) { - debug(`Ignoring ${filePath}`); // cache and return result - + // cache and return result cache.explicitMatches.set(filePath, false); return false; - } // filePath isn't automatically ignored, so try to find a match + } + // filePath isn't automatically ignored, so try to find a match for (const config of this) { if (!config.files) { continue; } - if (pathMatches(filePath, this.basePath, config)) { debug(`Matching config found for ${filePath}`); cache.explicitMatches.set(filePath, true); return true; } } - return false; } + /** - * Returns the config object for a given file path. - * @param {string} filePath The complete path of a file to get a config for. - * @returns {Object} The config object for this file. - */ - - + * Returns the config object for a given file path. + * @param {string} filePath The complete path of a file to get a config for. + * @returns {Object} The config object for this file. + */ getConfig(filePath) { - assertNormalized(this); // first check the cache to avoid duplicate work - - let finalConfig = this[ConfigArraySymbol.configCache].get(filePath); + assertNormalized(this); + const cache = this[ConfigArraySymbol.configCache]; + // first check the cache for a filename match to avoid duplicate work + let finalConfig = cache.get(filePath); if (finalConfig) { return finalConfig; - } // TODO: Maybe move elsewhere? + } + // next check to see if the file should be ignored - const relativeFilePath = path.relative(this.basePath, filePath); + // check if this should be ignored due to its directory + if (this.isDirectoryIgnored(path.dirname(filePath))) { + debug(`Ignoring ${filePath} based on directory pattern`); - if (shouldIgnoreFilePath(this.ignores, filePath, relativeFilePath)) { - debug(`Ignoring ${filePath}`); // cache and return result - finalConfig is undefined at this point - - this[ConfigArraySymbol.configCache].set(filePath, finalConfig); + // cache and return result - finalConfig is undefined at this point + cache.set(filePath, finalConfig); return finalConfig; - } // filePath isn't automatically ignored, so try to construct config + } + // TODO: Maybe move elsewhere? + const relativeFilePath = path.relative(this.basePath, filePath); + if (shouldIgnorePath(this.ignores, filePath, relativeFilePath)) { + debug(`Ignoring ${filePath} based on file pattern`); - const matchingConfigs = []; + // cache and return result - finalConfig is undefined at this point + cache.set(filePath, finalConfig); + return finalConfig; + } + + // filePath isn't automatically ignored, so try to construct config + + const matchingConfigIndices = []; let matchFound = false; - - for (const config of this) { + const universalPattern = /\/\*{1,2}$/; + this.forEach((config, index) => { if (!config.files) { - debug(`Universal config found for ${filePath}`); - matchingConfigs.push(config); - continue; + debug(`Anonymous universal config found for ${filePath}`); + matchingConfigIndices.push(index); + return; + } + assertNonEmptyFilesArray(config); + + /* + * If a config has a files pattern ending in /** or /*, and the + * filePath only matches those patterns, then the config is only + * applied if there is another config where the filePath matches + * a file with a specific extensions such as *.js. + */ + + const universalFiles = config.files.filter(pattern => universalPattern.test(pattern)); + + // universal patterns were found so we need to check the config twice + if (universalFiles.length) { + debug('Universal files patterns found. Checking carefully.'); + const nonUniversalFiles = config.files.filter(pattern => !universalPattern.test(pattern)); + + // check that the config matches without the non-universal files first + if (nonUniversalFiles.length && pathMatches(filePath, this.basePath, { + files: nonUniversalFiles, + ignores: config.ignores + })) { + debug(`Matching config found for ${filePath}`); + matchingConfigIndices.push(index); + matchFound = true; + return; + } + + // if there wasn't a match then check if it matches with universal files + if (universalFiles.length && pathMatches(filePath, this.basePath, { + files: universalFiles, + ignores: config.ignores + })) { + debug(`Matching config found for ${filePath}`); + matchingConfigIndices.push(index); + return; + } + + // if we make here, then there was no match + return; } + // the normal case if (pathMatches(filePath, this.basePath, config)) { debug(`Matching config found for ${filePath}`); - matchingConfigs.push(config); + matchingConfigIndices.push(index); matchFound = true; - continue; + return; } - } // if matching both files and ignores, there will be no config to create - + }); + // if matching both files and ignores, there will be no config to create if (!matchFound) { - debug(`No matching configs found for ${filePath}`); // cache and return result - finalConfig is undefined at this point + debug(`No matching configs found for ${filePath}`); - this[ConfigArraySymbol.configCache].set(filePath, finalConfig); + // cache and return result - finalConfig is undefined at this point + cache.set(filePath, finalConfig); return finalConfig; - } // otherwise construct the config + } + // check to see if there is a config cached by indices + finalConfig = cache.get(matchingConfigIndices.toString()); + if (finalConfig) { + // also store for filename for faster lookup next time + cache.set(filePath, finalConfig); + return finalConfig; + } - finalConfig = matchingConfigs.reduce((result, config) => { - return this[ConfigArraySymbol.schema].merge(result, config); + // otherwise construct the config + + finalConfig = matchingConfigIndices.reduce((result, index) => { + return this[ConfigArraySymbol.schema].merge(result, this[index]); }, {}, this); finalConfig = this[ConfigArraySymbol.finalizeConfig](finalConfig); - this[ConfigArraySymbol.configCache].set(filePath, finalConfig); + cache.set(filePath, finalConfig); + cache.set(matchingConfigIndices.toString(), finalConfig); return finalConfig; } + /** - * Determines if the given filepath is ignored based on the configs. - * @param {string} filePath The complete path of a file to check. - * @returns {boolean} True if the path is ignored, false if not. - */ - - + * Determines if the given filepath is ignored based on the configs. + * @param {string} filePath The complete path of a file to check. + * @returns {boolean} True if the path is ignored, false if not. + * @deprecated Use `isFileIgnored` instead. + */ isIgnored(filePath) { + return this.isFileIgnored(filePath); + } + + /** + * Determines if the given filepath is ignored based on the configs. + * @param {string} filePath The complete path of a file to check. + * @returns {boolean} True if the path is ignored, false if not. + */ + isFileIgnored(filePath) { return this.getConfig(filePath) === undefined; } -} + /** + * Determines if the given directory is ignored based on the configs. + * This checks only default `ignores` that don't have `files` in the + * same config. A pattern such as `/foo` be considered to ignore the directory + * while a pattern such as `/foo/**` is not considered to ignore the + * directory because it is matching files. + * @param {string} directoryPath The complete path of a directory to check. + * @returns {boolean} True if the directory is ignored, false if not. Will + * return true for any directory that is not inside of `basePath`. + * @throws {Error} When the `ConfigArray` is not normalized. + */ + isDirectoryIgnored(directoryPath) { + assertNormalized(this); + const relativeDirectoryPath = path.relative(this.basePath, directoryPath).replace(/\\/g, '/'); + if (relativeDirectoryPath.startsWith('..')) { + return true; + } + // first check the cache + const cache = dataCache.get(this).directoryMatches; + if (cache.has(relativeDirectoryPath)) { + return cache.get(relativeDirectoryPath); + } + const directoryParts = relativeDirectoryPath.split('/'); + let relativeDirectoryToCheck = ''; + let result = false; + + /* + * In order to get the correct gitignore-style ignores, where an + * ignored parent directory cannot have any descendants unignored, + * we need to check every directory starting at the parent all + * the way down to the actual requested directory. + * + * We aggressively cache all of this info to make sure we don't + * have to recalculate everything for every call. + */ + do { + relativeDirectoryToCheck += directoryParts.shift() + '/'; + result = shouldIgnorePath(this.ignores, path.join(this.basePath, relativeDirectoryToCheck), relativeDirectoryToCheck); + cache.set(relativeDirectoryToCheck, result); + } while (!result && directoryParts.length); + + // also cache the result for the requested path + cache.set(relativeDirectoryPath, result); + return result; + } +} exports.ConfigArray = ConfigArray; exports.ConfigArraySymbol = ConfigArraySymbol; /***/ }), -/* 953 */ +/* 963 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = minimatch; minimatch.Minimatch = Minimatch; - var path = function () { try { - return __webpack_require__(501); + return __webpack_require__(523); } catch (e) {} }() || { sep: '/' }; - minimatch.sep = path.sep; var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; - -var expand = __webpack_require__(954); - +var expand = __webpack_require__(964); var plTypes = { '!': { open: '(?:(?!(?:', @@ -129983,40 +116363,44 @@ var plTypes = { open: '(?:', close: ')' } -}; // any single thing other than / +}; + +// any single thing other than / // don't need to escape / when using new RegExp() +var qmark = '[^/]'; -var qmark = '[^/]'; // * => any number of characters +// * => any number of characters +var star = qmark + '*?'; -var star = qmark + '*?'; // ** when dots are allowed. Anything goes, except .. and . +// ** when dots are allowed. Anything goes, except .. and . // not (^ or / followed by one or two dots followed by $ or /), // followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'; -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'; // not a ^ or / followed by a dot, +// not a ^ or / followed by a dot, // followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'; -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'; // characters that need to be escaped in RegExp. - -var reSpecials = charSet('().*{}+?[]^$\\!'); // "abc" -> { a:true, b:true, c:true } +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!'); +// "abc" -> { a:true, b:true, c:true } function charSet(s) { return s.split('').reduce(function (set, c) { set[c] = true; return set; }, {}); -} // normalizes slashes. - +} +// normalizes slashes. var slashSplit = /\/+/; minimatch.filter = filter; - function filter(pattern, options) { options = options || {}; return function (p, i, list) { return minimatch(p, pattern, options); }; } - function ext(a, b) { b = b || {}; var t = {}; @@ -130028,77 +116412,62 @@ function ext(a, b) { }); return t; } - minimatch.defaults = function (def) { if (!def || typeof def !== 'object' || !Object.keys(def).length) { return minimatch; } - var orig = minimatch; - var m = function minimatch(p, pattern, options) { return orig(p, pattern, ext(def, options)); }; - m.Minimatch = function Minimatch(pattern, options) { return new orig.Minimatch(pattern, ext(def, options)); }; - m.Minimatch.defaults = function defaults(options) { return orig.defaults(ext(def, options)).Minimatch; }; - m.filter = function filter(pattern, options) { return orig.filter(pattern, ext(def, options)); }; - m.defaults = function defaults(options) { return orig.defaults(ext(def, options)); }; - m.makeRe = function makeRe(pattern, options) { return orig.makeRe(pattern, ext(def, options)); }; - m.braceExpand = function braceExpand(pattern, options) { return orig.braceExpand(pattern, ext(def, options)); }; - m.match = function (list, pattern, options) { return orig.match(list, pattern, ext(def, options)); }; - return m; }; - Minimatch.defaults = function (def) { return minimatch.defaults(def).Minimatch; }; - function minimatch(p, pattern, options) { assertValidPattern(pattern); - if (!options) options = {}; // shortcut: comments match nothing. + if (!options) options = {}; + // shortcut: comments match nothing. if (!options.nocomment && pattern.charAt(0) === '#') { return false; } - return new Minimatch(pattern, options).match(p); } - function Minimatch(pattern, options) { if (!(this instanceof Minimatch)) { return new Minimatch(pattern, options); } - assertValidPattern(pattern); if (!options) options = {}; - pattern = pattern.trim(); // windows support: need to use /, not \ + pattern = pattern.trim(); + // windows support: need to use /, not \ if (!options.allowWindowsEscape && path.sep !== '/') { pattern = pattern.split(path.sep).join('/'); } - this.options = options; this.set = []; this.pattern = pattern; @@ -130106,76 +116475,76 @@ function Minimatch(pattern, options) { this.negate = false; this.comment = false; this.empty = false; - this.partial = !!options.partial; // make the set of regexps etc. + this.partial = !!options.partial; + // make the set of regexps etc. this.make(); } - Minimatch.prototype.debug = function () {}; - Minimatch.prototype.make = make; - function make() { var pattern = this.pattern; - var options = this.options; // empty patterns and comments match nothing. + var options = this.options; + // empty patterns and comments match nothing. if (!options.nocomment && pattern.charAt(0) === '#') { this.comment = true; return; } - if (!pattern) { this.empty = true; return; - } // step 1: figure out negation, etc. + } + // step 1: figure out negation, etc. + this.parseNegate(); - this.parseNegate(); // step 2: expand braces - + // step 2: expand braces var set = this.globSet = this.braceExpand(); if (options.debug) this.debug = function debug() { console.error.apply(console, arguments); }; - this.debug(this.pattern, set); // step 3: now we have a set, so turn each one into a series of path-portion + this.debug(this.pattern, set); + + // step 3: now we have a set, so turn each one into a series of path-portion // matching patterns. // These will be regexps, except in the case of "**", which is // set to the GLOBSTAR object for globstar behavior, // and will not contain any / characters - set = this.globParts = set.map(function (s) { return s.split(slashSplit); }); - this.debug(this.pattern, set); // glob --> regexps + this.debug(this.pattern, set); + // glob --> regexps set = set.map(function (s, si, set) { return s.map(this.parse, this); }, this); - this.debug(this.pattern, set); // filter out everything that didn't compile properly. + this.debug(this.pattern, set); + // filter out everything that didn't compile properly. set = set.filter(function (s) { return s.indexOf(false) === -1; }); this.debug(this.pattern, set); this.set = set; } - Minimatch.prototype.parseNegate = parseNegate; - function parseNegate() { var pattern = this.pattern; var negate = false; var options = this.options; var negateOffset = 0; if (options.nonegate) return; - for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === '!'; i++) { negate = !negate; negateOffset++; } - if (negateOffset) this.pattern = pattern.substr(negateOffset); this.negate = negate; -} // Brace expansion: +} + +// Brace expansion: // a{b,c}d -> abd acd // a{b,}c -> abc ac // a{0..3}d -> a0d a1d a2d a3d @@ -130185,14 +116554,10 @@ function parseNegate() { // Invalid sets are not expanded. // a{2..}b -> a{2..}b // a{b}c -> a{b}c - - minimatch.braceExpand = function (pattern, options) { return braceExpand(pattern, options); }; - Minimatch.prototype.braceExpand = braceExpand; - function braceExpand(pattern, options) { if (!options) { if (this instanceof Minimatch) { @@ -130201,30 +116566,28 @@ function braceExpand(pattern, options) { options = {}; } } - pattern = typeof pattern === 'undefined' ? this.pattern : pattern; - assertValidPattern(pattern); // Thanks to Yeting Li for - // improving this regexp to avoid a ReDOS vulnerability. + assertValidPattern(pattern); + // Thanks to Yeting Li for + // improving this regexp to avoid a ReDOS vulnerability. if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { // shortcut. no need to expand. return [pattern]; } - return expand(pattern); } - var MAX_PATTERN_LENGTH = 1024 * 64; - var assertValidPattern = function (pattern) { if (typeof pattern !== 'string') { throw new TypeError('invalid pattern'); } - if (pattern.length > MAX_PATTERN_LENGTH) { throw new TypeError('pattern is too long'); } -}; // parse a component of the expanded set. +}; + +// parse a component of the expanded set. // At this point, no pattern may contain "/" in it // so we're going to return a 2d array, where each entry is the full // pattern, split on '/', and then turned into a regular expression. @@ -130235,37 +116598,33 @@ var assertValidPattern = function (pattern) { // when it is the *only* thing in a path portion. Otherwise, any series // of * is equivalent to a single *. Globstar behavior is enabled by // default, and can be disabled by setting options.noglobstar. - - Minimatch.prototype.parse = parse; var SUBPARSE = {}; - function parse(pattern, isSub) { assertValidPattern(pattern); - var options = this.options; // shortcuts + var options = this.options; + // shortcuts if (pattern === '**') { if (!options.noglobstar) return GLOBSTAR;else pattern = '*'; } - if (pattern === '') return ''; var re = ''; var hasMagic = !!options.nocase; - var escaping = false; // ? => one single character - + var escaping = false; + // ? => one single character var patternListStack = []; var negativeLists = []; var stateChar; var inClass = false; var reClassStart = -1; - var classStart = -1; // . and .. never match anything that doesn't start with ., + var classStart = -1; + // . and .. never match anything that doesn't start with ., // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything // not (start or / followed by . or .. followed by / or end) : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' : '(?!\\.)'; var self = this; - function clearStateChar() { if (stateChar) { // we had some state-tracking character @@ -130275,31 +116634,27 @@ function parse(pattern, isSub) { re += star; hasMagic = true; break; - case '?': re += qmark; hasMagic = true; break; - default: re += '\\' + stateChar; break; } - self.debug('clearStateChar %j %j', stateChar, re); stateChar = false; } } - for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c); // skip over any that are escaped. + this.debug('%s\t%s %s %j', pattern, i, re, c); + // skip over any that are escaped. if (escaping && reSpecials[c]) { re += '\\' + c; escaping = false; continue; } - switch (c) { /* istanbul ignore next */ case '/': @@ -130308,112 +116663,100 @@ function parse(pattern, isSub) { // Should already be path-split by now. return false; } - case '\\': clearStateChar(); escaping = true; continue; + // the various stateChar values // for the "extglob" stuff. - case '?': case '*': case '+': case '@': case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c); // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c); + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp if (inClass) { this.debug(' in class'); if (c === '!' && i === classStart + 1) c = '^'; re += c; continue; - } // if we already have a stateChar, then it means + } + + // if we already have a stateChar, then it means // that there was something like ** or +? in there. // Handle the stateChar, then proceed with this one. - - self.debug('call clearStateChar %j', stateChar); clearStateChar(); - stateChar = c; // if extglob is disabled, then +(asdf|foo) isn't a thing. + stateChar = c; + // if extglob is disabled, then +(asdf|foo) isn't a thing. // just clear the statechar *now*, rather than even diving into // the patternList stuff. - if (options.noext) clearStateChar(); continue; - case '(': if (inClass) { re += '('; continue; } - if (!stateChar) { re += '\\('; continue; } - patternListStack.push({ type: stateChar, start: i - 1, reStart: re.length, open: plTypes[stateChar].open, close: plTypes[stateChar].close - }); // negation is (?:(?!js)[^/]*) - + }); + // negation is (?:(?!js)[^/]*) re += stateChar === '!' ? '(?:(?!(?:' : '(?:'; this.debug('plType %j %j', stateChar, re); stateChar = false; continue; - case ')': if (inClass || !patternListStack.length) { re += '\\)'; continue; } - clearStateChar(); hasMagic = true; - var pl = patternListStack.pop(); // negation is (?:(?!js)[^/]*) + var pl = patternListStack.pop(); + // negation is (?:(?!js)[^/]*) // The others are (?:) - re += pl.close; - if (pl.type === '!') { negativeLists.push(pl); } - pl.reEnd = re.length; continue; - case '|': if (inClass || !patternListStack.length || escaping) { re += '\\|'; escaping = false; continue; } - clearStateChar(); re += '|'; continue; - // these are mostly the same in regexp and glob + // these are mostly the same in regexp and glob case '[': // swallow any state-tracking char before the [ clearStateChar(); - if (inClass) { re += '\\' + c; continue; } - inClass = true; classStart = i; reClassStart = re.length; re += c; continue; - case ']': // a right bracket shall lose its special // meaning and represent itself in @@ -130423,7 +116766,9 @@ function parse(pattern, isSub) { re += '\\' + c; escaping = false; continue; - } // handle the case where we left a class open. + } + + // handle the case where we left a class open. // "[z-a]" is valid, equivalent to "\[z-a\]" // split where the last [ was, make sure we don't have // an invalid re. if so, re-walk the contents of the @@ -130432,10 +116777,7 @@ function parse(pattern, isSub) { // TODO: It would probably be faster to determine this // without a try/catch and a new RegExp, but it's tricky // to do safely. For now, this is safe and works. - - var cs = pattern.substring(classStart + 1, i); - try { RegExp('[' + cs + ']'); } catch (er) { @@ -130445,33 +116787,28 @@ function parse(pattern, isSub) { hasMagic = hasMagic || sp[1]; inClass = false; continue; - } // finish up the class. - + } + // finish up the class. hasMagic = true; inClass = false; re += c; continue; - default: // swallow any state char that wasn't consumed clearStateChar(); - if (escaping) { // no need escaping = false; } else if (reSpecials[c] && !(c === '^' && inClass)) { re += '\\'; } - re += c; } // switch - } // for + // handle the case where we left a class open. // "[abc" is valid, equivalent to "\[abc" - - if (inClass) { // split where the last [ was, and escape it // this is a huge pita. We now have to re-walk @@ -130481,153 +116818,138 @@ function parse(pattern, isSub) { sp = this.parse(cs, SUBPARSE); re = re.substr(0, reClassStart) + '\\[' + sp[0]; hasMagic = hasMagic || sp[1]; - } // handle the case where we had a +( thing at the *end* + } + + // handle the case where we had a +( thing at the *end* // of the pattern. // each pattern list stack adds 3 chars, and we need to go through // and escape any | chars that were passed through as-is for the regexp. // Go through and escape them, taking care not to double-escape any // | chars that were already escaped. - - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { var tail = re.slice(pl.reStart + pl.open.length); - this.debug('setting tail', re, pl); // maybe some even number of \, then maybe 1 \, followed by a | - + this.debug('setting tail', re, pl); + // maybe some even number of \, then maybe 1 \, followed by a | tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { if (!$2) { // the | isn't already escaped, so escape it. $2 = '\\'; - } // need to escape all those slashes *again*, without escaping the + } + + // need to escape all those slashes *again*, without escaping the // one that we need for escaping the | character. As it works out, // escaping an even number of slashes can be done by simply repeating // it exactly after itself. That's why this trick works. // // I am sorry that you have to see this. - - return $1 + $1 + $2 + '|'; }); this.debug('tail=%j\n %s', tail, tail, pl, re); var t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type; hasMagic = true; re = re.slice(0, pl.reStart) + t + '\\(' + tail; - } // handle trailing things that only matter at the very end. - + } + // handle trailing things that only matter at the very end. clearStateChar(); - if (escaping) { // trailing \\ re += '\\\\'; - } // only need to apply the nodot start if the re starts with + } + + // only need to apply the nodot start if the re starts with // something that could conceivably capture a dot - - var addPatternStart = false; - switch (re.charAt(0)) { case '[': case '.': case '(': addPatternStart = true; - } // Hack to work around lack of negative lookbehind in JS + } + + // Hack to work around lack of negative lookbehind in JS // A pattern like: *.!(x).!(y|z) needs to ensure that a name // like 'a.xyz.yz' doesn't match. So, the first negative // lookahead, has to look ALL the way ahead, to the end of // the pattern. - - for (var n = negativeLists.length - 1; n > -1; n--) { var nl = negativeLists[n]; var nlBefore = re.slice(0, nl.reStart); var nlFirst = re.slice(nl.reStart, nl.reEnd - 8); var nlLast = re.slice(nl.reEnd - 8, nl.reEnd); var nlAfter = re.slice(nl.reEnd); - nlLast += nlAfter; // Handle nested stuff like *(*.js|!(*.json)), where open parens + nlLast += nlAfter; + + // Handle nested stuff like *(*.js|!(*.json)), where open parens // mean that we should *not* include the ) in the bit that is considered // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1; var cleanAfter = nlAfter; - for (i = 0; i < openParensBefore; i++) { cleanAfter = cleanAfter.replace(/\)[+*?]?/, ''); } - nlAfter = cleanAfter; var dollar = ''; - if (nlAfter === '' && isSub !== SUBPARSE) { dollar = '$'; } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; re = newRe; - } // if the re is not "" at this point, then we need to make sure + } + + // if the re is not "" at this point, then we need to make sure // it doesn't match against an empty path part. // Otherwise a/* will match a/, which it should not. - - if (re !== '' && hasMagic) { re = '(?=.)' + re; } - if (addPatternStart) { re = patternStart + re; - } // parsing just a piece of a larger pattern. - + } + // parsing just a piece of a larger pattern. if (isSub === SUBPARSE) { return [re, hasMagic]; - } // skip the regexp for non-magical patterns + } + + // skip the regexp for non-magical patterns // unescape anything in it, though, so that it'll be // an exact match against a file etc. - - if (!hasMagic) { return globUnescape(pattern); } - var flags = options.nocase ? 'i' : ''; - try { var regExp = new RegExp('^' + re + '$', flags); - } catch (er) - /* istanbul ignore next - should be impossible */ - { + } catch (er) /* istanbul ignore next - should be impossible */{ // If it was an invalid regular expression, then it can't match // anything. This trick looks for a character after the end of // the string, which is of course impossible, except in multi-line // mode, but it's not a /m regex. return new RegExp('$.'); } - regExp._glob = pattern; regExp._src = re; return regExp; } - minimatch.makeRe = function (pattern, options) { return new Minimatch(pattern, options || {}).makeRe(); }; - Minimatch.prototype.makeRe = makeRe; - function makeRe() { - if (this.regexp || this.regexp === false) return this.regexp; // at this point, this.set is a 2d array of partial + if (this.regexp || this.regexp === false) return this.regexp; + + // at this point, this.set is a 2d array of partial // pattern strings, or "**". // // It's better to use .match(). This function shouldn't // be used, really, but it's pretty convenient sometimes, // when you just want to work with a regex. - var set = this.set; - if (!set.length) { this.regexp = false; return this.regexp; } - var options = this.options; var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; var flags = options.nocase ? 'i' : ''; @@ -130635,97 +116957,90 @@ function makeRe() { return pattern.map(function (p) { return p === GLOBSTAR ? twoStar : typeof p === 'string' ? regExpEscape(p) : p._src; }).join('\\\/'); - }).join('|'); // must match entire pattern + }).join('|'); + + // must match entire pattern // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$'; - re = '^(?:' + re + ')$'; // can match anything, as long as it's not this. - + // can match anything, as long as it's not this. if (this.negate) re = '^(?!' + re + ').*$'; - try { this.regexp = new RegExp(re, flags); - } catch (ex) - /* istanbul ignore next - should be impossible */ - { + } catch (ex) /* istanbul ignore next - should be impossible */{ this.regexp = false; } - return this.regexp; } - minimatch.match = function (list, pattern, options) { options = options || {}; var mm = new Minimatch(pattern, options); list = list.filter(function (f) { return mm.match(f); }); - if (mm.options.nonull && !list.length) { list.push(pattern); } - return list; }; - Minimatch.prototype.match = function match(f, partial) { if (typeof partial === 'undefined') partial = this.partial; - this.debug('match', f, this.pattern); // short-circuit in the case of busted things. + this.debug('match', f, this.pattern); + // short-circuit in the case of busted things. // comments, etc. - if (this.comment) return false; if (this.empty) return f === ''; if (f === '/' && partial) return true; - var options = this.options; // windows: need to use /, not \ + var options = this.options; + // windows: need to use /, not \ if (path.sep !== '/') { f = f.split(path.sep).join('/'); - } // treat the test path as a set of pathparts. - + } + // treat the test path as a set of pathparts. f = f.split(slashSplit); - this.debug(this.pattern, 'split', f); // just ONE of the pattern sets in this.set needs to match + this.debug(this.pattern, 'split', f); + + // just ONE of the pattern sets in this.set needs to match // in order for it to be valid. If negating, then just one // match means that we have failed. // Either way, return on the first hit. var set = this.set; - this.debug(this.pattern, 'set', set); // Find the basename of the path by looking for the last non-empty segment + this.debug(this.pattern, 'set', set); + // Find the basename of the path by looking for the last non-empty segment var filename; var i; - for (i = f.length - 1; i >= 0; i--) { filename = f[i]; if (filename) break; } - for (i = 0; i < set.length; i++) { var pattern = set[i]; var file = f; - if (options.matchBase && pattern.length === 1) { file = [filename]; } - var hit = this.matchOne(file, pattern, partial); - if (hit) { if (options.flipNegate) return true; return !this.negate; } - } // didn't get any hits. this is success if it's a negative + } + + // didn't get any hits. this is success if it's a negative // pattern, failure otherwise. - - if (options.flipNegate) return false; return this.negate; -}; // set partial to true to test if, for example, +}; + +// set partial to true to test if, for example, // "/a/b" matches the start of "/*/b/*/d" // Partial means, if you run out of file before you run // out of pattern, then that's fine, as long as all // the parts match. - - Minimatch.prototype.matchOne = function (file, pattern, partial) { var options = this.options; this.debug('matchOne', { @@ -130734,20 +117049,20 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { pattern: pattern }); this.debug('matchOne', file.length, pattern.length); - for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { this.debug('matchOne loop'); var p = pattern[pi]; var f = file[fi]; - this.debug(pattern, p, f); // should be impossible. + this.debug(pattern, p, f); + + // should be impossible. // some invalid regexp stuff in the set. - /* istanbul ignore if */ - if (p === false) return false; - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]); // "**" + this.debug('GLOBSTAR', [pattern, p, f]); + + // "**" // a/**/b/**/c would match the following: // a/b/x/y/z/c // a/x/y/z/b/c @@ -130769,33 +117084,31 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { // - matchOne(y/z/c, c) -> no // - matchOne(z/c, c) -> no // - matchOne(c, c) yes, hit - var fr = fi; var pr = pi + 1; - if (pr === pl) { - this.debug('** at the end'); // a ** at the end will just swallow the rest. + this.debug('** at the end'); + // a ** at the end will just swallow the rest. // We have found a match. // however, it will not swallow /.x, unless // options.dot is set. // . and .. are *never* matched by **, for explosively // exponential reasons. - for (; fi < fl; fi++) { if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false; } - return true; - } // ok, let's see if we can swallow whatever we can. - + } + // ok, let's see if we can swallow whatever we can. while (fr < fl) { var swallowee = file[fr]; - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index. + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); + // XXX remove this slice. Just pass the start index. if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee); // found a match. - + this.debug('globstar found match!', fr, fl, swallowee); + // found a match. return true; } else { // can't swallow "." or ".." ever. @@ -130803,33 +117116,30 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') { this.debug('dot detected!', file, fr, pattern, pr); break; - } // ** swallows a segment, and continue. - + } + // ** swallows a segment, and continue. this.debug('globstar swallow a segment, and continue'); fr++; } - } // no match was found. + } + + // no match was found. // However, in partial mode, we can't say this is necessarily over. // If there's more *pattern* left, then - /* istanbul ignore if */ - - if (partial) { // ran out of file this.debug('\n>>> no match, partial?', file, fr, pattern, pr); if (fr === fl) return true; } - return false; - } // something other than ** + } + + // something other than ** // non-magic patterns just have to match exactly // patterns with magic have been turned into regexps. - - var hit; - if (typeof p === 'string') { hit = f === p; this.debug('string match', p, f, hit); @@ -130837,9 +117147,10 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { hit = f.match(p); this.debug('pattern match', p, f, hit); } - if (!hit) return false; - } // Note: ending in / means that we'll get a final "" + } + + // Note: ending in / means that we'll get a final "" // at the end of the pattern. This can only match a // corresponding "" at the end of the file. // If the file ends in /, then it can only match a @@ -130849,9 +117160,8 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { // [^/]*? pattern, except in partial mode, where it might // simply not be reached yet. // However, a/b/ should still satisfy a/* + // now either we fell off the end of the pattern, or we're done. - - if (fi === fl && pi === pl) { // ran out of pattern and filename at the same time. // an exact hit! @@ -130861,61 +117171,52 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { // this is ok if we're doing the match as part of // a glob fs traversal. return partial; - } else - /* istanbul ignore else */ - if (pi === pl) { + } else /* istanbul ignore else */if (pi === pl) { // ran out of pattern, still have file left. // this is only acceptable if we're on the very last // empty segment of a file with a trailing slash. // a/* should match a/b/ return fi === fl - 1 && file[fi] === ''; - } // should be unreachable. + } + // should be unreachable. /* istanbul ignore next */ - - throw new Error('wtf?'); -}; // replace stuff like \* with * - +}; +// replace stuff like \* with * function globUnescape(s) { return s.replace(/\\(.)/g, '$1'); } - function regExpEscape(s) { return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); } /***/ }), -/* 954 */ +/* 964 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var concatMap = __webpack_require__(955); - -var balanced = __webpack_require__(956); - +var concatMap = __webpack_require__(965); +var balanced = __webpack_require__(966); module.exports = expandTop; var escSlash = '\0SLASH' + Math.random() + '\0'; var escOpen = '\0OPEN' + Math.random() + '\0'; var escClose = '\0CLOSE' + Math.random() + '\0'; var escComma = '\0COMMA' + Math.random() + '\0'; var escPeriod = '\0PERIOD' + Math.random() + '\0'; - function numeric(str) { return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); } - function escapeBraces(str) { return str.split('\\\\').join(escSlash).split('\\{').join(escOpen).split('\\}').join(escClose).split('\\,').join(escComma).split('\\.').join(escPeriod); } - function unescapeBraces(str) { return str.split(escSlash).join('\\').split(escOpen).join('{').split(escClose).join('}').split(escComma).join(',').split(escPeriod).join('.'); -} // Basically just str.split(","), but handling cases +} + +// Basically just str.split(","), but handling cases // where we have nested braced sections, which should be // treated as individual members, like {a,{b,c},d} - - function parseCommaParts(str) { if (!str) return ['']; var parts = []; @@ -130927,51 +117228,42 @@ function parseCommaParts(str) { var p = pre.split(','); p[p.length - 1] += '{' + body + '}'; var postParts = parseCommaParts(post); - if (post.length) { p[p.length - 1] += postParts.shift(); p.push.apply(p, postParts); } - parts.push.apply(parts, p); return parts; } - function expandTop(str) { - if (!str) return []; // I don't know why Bash 4.3 does this, but it does. + if (!str) return []; + + // I don't know why Bash 4.3 does this, but it does. // Anything starting with {} will have the first two bytes preserved // but *only* at the top level, so {},a}b will not expand to anything, // but a{},b}c will be expanded to [a}c,abc]. // One could argue that this is a bug in Bash, but since the goal of // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { str = '\\{\\}' + str.substr(2); } - return expand(escapeBraces(str), true).map(unescapeBraces); } - function identity(e) { return e; } - function embrace(str) { return '{' + str + '}'; } - function isPadded(el) { return /^-?0\d/.test(el); } - function lte(i, y) { return i <= y; } - function gte(i, y) { return i >= y; } - function expand(str, isTop) { var expansions = []; var m = balanced('{', '}', str); @@ -130980,28 +117272,22 @@ function expand(str, isTop) { var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); var isSequence = isNumericSequence || isAlphaSequence; var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { // {a},b} if (m.post.match(/,.*\}/)) { str = m.pre + '{' + m.body + escClose + m.post; return expand(str); } - return [str]; } - var n; - if (isSequence) { n = m.body.split(/\.\./); } else { n = parseCommaParts(m.body); - if (n.length === 1) { // x{{a,b}}y ==> x{a}y x{b}y n = expand(n[0], false).map(embrace); - if (n.length === 1) { var post = m.post.length ? expand(m.post, false) : ['']; return post.map(function (p) { @@ -131009,15 +117295,15 @@ function expand(str, isTop) { }); } } - } // at this point, n is the parts, and we know it's not a comma set + } + + // at this point, n is the parts, and we know it's not a comma set // with a single entry. + // no need to expand pre, since it is guaranteed to be free of brace-sets - - var pre = m.pre; var post = m.post.length ? expand(m.post, false) : ['']; var N; - if (isSequence) { var x = numeric(n[0]); var y = numeric(n[1]); @@ -131025,34 +117311,27 @@ function expand(str, isTop) { var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; var test = lte; var reverse = y < x; - if (reverse) { incr *= -1; test = gte; } - var pad = n.some(isPadded); N = []; - for (var i = x; test(i, y); i += incr) { var c; - if (isAlphaSequence) { c = String.fromCharCode(i); if (c === '\\') c = ''; } else { c = String(i); - if (pad) { var need = width - c.length; - if (need > 0) { var z = new Array(need + 1).join('0'); if (i < 0) c = '-' + z + c.slice(1);else c = z + c; } } } - N.push(c); } } else { @@ -131060,45 +117339,39 @@ function expand(str, isTop) { return expand(el, false); }); } - for (var j = 0; j < N.length; j++) { for (var k = 0; k < post.length; k++) { var expansion = pre + N[j] + post[k]; if (!isTop || isSequence || expansion) expansions.push(expansion); } } - return expansions; } /***/ }), -/* 955 */ +/* 965 */ /***/ ((module) => { module.exports = function (xs, fn) { var res = []; - for (var i = 0; i < xs.length; i++) { var x = fn(xs[i], i); if (isArray(x)) res.push.apply(res, x);else res.push(x); } - return res; }; - var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; /***/ }), -/* 956 */ +/* 966 */ /***/ ((module) => { "use strict"; module.exports = balanced; - function balanced(a, b, str) { if (a instanceof RegExp) a = maybeMatch(a, str); if (b instanceof RegExp) b = maybeMatch(b, str); @@ -131111,28 +117384,22 @@ function balanced(a, b, str) { post: str.slice(r[1] + b.length) }; } - function maybeMatch(reg, str) { var m = str.match(reg); return m ? m[0] : null; } - balanced.range = range; - function range(a, b, str) { var begs, beg, left, right, result; var ai = str.indexOf(a); var bi = str.indexOf(b, ai + 1); var i = ai; - if (ai >= 0 && bi > 0) { if (a === b) { return [ai, bi]; } - begs = []; left = str.length; - while (i >= 0 && !result) { if (i == ai) { begs.push(i); @@ -131141,62 +117408,61 @@ function range(a, b, str) { result = [begs.pop(), bi]; } else { beg = begs.pop(); - if (beg < left) { left = beg; right = bi; } - bi = str.indexOf(b, i + 1); } - i = ai < bi && ai >= 0 ? ai : bi; } - if (begs.length) { result = [left, right]; } } - return result; } /***/ }), -/* 957 */ +/* 967 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /** * @filedescription Object Schema Package */ -exports.ObjectSchema = __webpack_require__(958).ObjectSchema; -exports.MergeStrategy = __webpack_require__(959).MergeStrategy; -exports.ValidationStrategy = __webpack_require__(960).ValidationStrategy; + +exports.ObjectSchema = __webpack_require__(968).ObjectSchema; +exports.MergeStrategy = __webpack_require__(969).MergeStrategy; +exports.ValidationStrategy = __webpack_require__(970).ValidationStrategy; /***/ }), -/* 958 */ +/* 968 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * @filedescription Object Schema */ - //----------------------------------------------------------------------------- + + + +//----------------------------------------------------------------------------- // Requirements //----------------------------------------------------------------------------- - const { MergeStrategy -} = __webpack_require__(959); - +} = __webpack_require__(969); const { ValidationStrategy -} = __webpack_require__(960); //----------------------------------------------------------------------------- +} = __webpack_require__(970); + +//----------------------------------------------------------------------------- // Private //----------------------------------------------------------------------------- - const strategies = Symbol("strategies"); const requiredKeys = Symbol("requiredKeys"); + /** * Validates a schema strategy. * @param {string} name The name of the key this strategy is for. @@ -131213,10 +117479,8 @@ const requiredKeys = Symbol("requiredKeys"); * @throws {Error} When the strategy is missing a merge() method. * @throws {Error} When the strategy is missing a validate() method. */ - function validateDefinition(name, strategy) { let hasSchema = false; - if (strategy.schema) { if (typeof strategy.schema === "object") { hasSchema = true; @@ -131224,7 +117488,6 @@ function validateDefinition(name, strategy) { throw new TypeError("Schema must be an object."); } } - if (typeof strategy.merge === "string") { if (!(strategy.merge in MergeStrategy)) { throw new TypeError(`Definition for key "${name}" missing valid merge strategy.`); @@ -131232,7 +117495,6 @@ function validateDefinition(name, strategy) { } else if (!hasSchema && typeof strategy.merge !== "function") { throw new TypeError(`Definition for key "${name}" must have a merge property.`); } - if (typeof strategy.validate === "string") { if (!(strategy.validate in ValidationStrategy)) { throw new TypeError(`Definition for key "${name}" missing valid validation strategy.`); @@ -131240,15 +117502,15 @@ function validateDefinition(name, strategy) { } else if (!hasSchema && typeof strategy.validate !== "function") { throw new TypeError(`Definition for key "${name}" must have a validate() method.`); } -} //----------------------------------------------------------------------------- +} + +//----------------------------------------------------------------------------- // Class //----------------------------------------------------------------------------- /** * Represents an object validation/merging schema. */ - - class ObjectSchema { /** * Creates a new instance. @@ -131257,76 +117519,75 @@ class ObjectSchema { if (!definitions) { throw new Error("Schema definitions missing."); } + /** * Track all strategies in the schema by key. * @type {Map} * @property strategies */ - - this[strategies] = new Map(); + /** * Separately track any keys that are required for faster validation. * @type {Map} * @property requiredKeys */ + this[requiredKeys] = new Map(); - this[requiredKeys] = new Map(); // add in all strategies - + // add in all strategies for (const key of Object.keys(definitions)) { - validateDefinition(key, definitions[key]); // normalize merge and validate methods if subschema is present + validateDefinition(key, definitions[key]); + // normalize merge and validate methods if subschema is present if (typeof definitions[key].schema === "object") { const schema = new ObjectSchema(definitions[key].schema); - definitions[key] = { ...definitions[key], - + definitions[key] = { + ...definitions[key], merge() { let first = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; let second = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return schema.merge(first, second); }, - validate(value) { ValidationStrategy.object(value); schema.validate(value); } - }; - } // normalize the merge method in case there's a string - + } + // normalize the merge method in case there's a string if (typeof definitions[key].merge === "string") { - definitions[key] = { ...definitions[key], + definitions[key] = { + ...definitions[key], merge: MergeStrategy[definitions[key].merge] }; } + ; - ; // normalize the validate method in case there's a string - + // normalize the validate method in case there's a string if (typeof definitions[key].validate === "string") { - definitions[key] = { ...definitions[key], + definitions[key] = { + ...definitions[key], validate: ValidationStrategy[definitions[key].validate] }; } - ; this[strategies].set(key, definitions[key]); - if (definitions[key].required) { this[requiredKeys].set(key, definitions[key]); } } } + /** * Determines if a strategy has been registered for the given object key. * @param {string} key The object key to find a strategy for. * @returns {boolean} True if the key has a strategy registered, false if not. */ - - hasKey(key) { return this[strategies].has(key); } + /** * Merges objects together to create a new object comprised of the keys * of the all objects. Keys are merged based on the each key's merge @@ -131335,30 +117596,23 @@ class ObjectSchema { * @returns {Object} A new object with a mix of all objects' keys. * @throws {Error} If any object is invalid. */ - - merge() { for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) { objects[_key] = arguments[_key]; } - // double check arguments if (objects.length < 2) { throw new Error("merge() requires at least two arguments."); } - if (objects.some(object => object == null || typeof object !== "object")) { throw new Error("All arguments must be objects."); } - return objects.reduce((result, object) => { this.validate(object); - for (const [key, strategy] of this[strategies]) { try { if (key in result || key in object) { const value = strategy.merge.call(this, result[key], object[key]); - if (value !== undefined) { result[key] = value; } @@ -131368,72 +117622,71 @@ class ObjectSchema { throw ex; } } - return result; }, {}); } + /** * Validates an object's keys based on the validate strategy for each key. * @param {Object} object The object to validate. * @returns {void} * @throws {Error} When the object is invalid. */ - - validate(object) { // check existing keys first for (const key of Object.keys(object)) { // check to see if the key is defined if (!this.hasKey(key)) { throw new Error(`Unexpected key "${key}" found.`); - } // validate existing keys + } + // validate existing keys + const strategy = this[strategies].get(key); - const strategy = this[strategies].get(key); // first check to see if any other keys are required - + // first check to see if any other keys are required if (Array.isArray(strategy.requires)) { if (!strategy.requires.every(otherKey => otherKey in object)) { throw new Error(`Key "${key}" requires keys "${strategy.requires.join("\", \"")}".`); } - } // now apply remaining validation strategy - + } + // now apply remaining validation strategy try { strategy.validate.call(strategy, object[key]); } catch (ex) { ex.message = `Key "${key}": ` + ex.message; throw ex; } - } // ensure required keys aren't missing - + } + // ensure required keys aren't missing for (const [key] of this[requiredKeys]) { if (!(key in object)) { throw new Error(`Missing required key "${key}".`); } } } - } - exports.ObjectSchema = ObjectSchema; /***/ }), -/* 959 */ +/* 969 */ /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * @filedescription Merge Strategy */ - //----------------------------------------------------------------------------- + + + +//----------------------------------------------------------------------------- // Class //----------------------------------------------------------------------------- /** * Container class for several different merge strategies. */ - class MergeStrategy { /** * Merges two keys by overwriting the first with the second. @@ -131444,6 +117697,7 @@ class MergeStrategy { static overwrite(value1, value2) { return value2; } + /** * Merges two keys by replacing the first with the second only if the * second is defined. @@ -131451,15 +117705,13 @@ class MergeStrategy { * @param {*} value2 The value from the second object key. * @returns {*} The second value if it is defined. */ - - static replace(value1, value2) { if (typeof value2 !== "undefined") { return value2; } - return value1; } + /** * Merges two properties by assigning properties from the second to the first. * @param {*} value1 The value from the first object key. @@ -131467,32 +117719,30 @@ class MergeStrategy { * @returns {*} A new object containing properties from both value1 and * value2. */ - - static assign(value1, value2) { return Object.assign({}, value1, value2); } - } - exports.MergeStrategy = MergeStrategy; /***/ }), -/* 960 */ +/* 970 */ /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * @filedescription Validation Strategy */ - //----------------------------------------------------------------------------- + + + +//----------------------------------------------------------------------------- // Class //----------------------------------------------------------------------------- /** * Container class for several different validation strategies. */ - class ValidationStrategy { /** * Validates that a value is an array. @@ -131505,91 +117755,83 @@ class ValidationStrategy { throw new TypeError("Expected an array."); } } + /** * Validates that a value is a boolean. * @param {*} value The value to validate. * @returns {void} * @throws {TypeError} If the value is invalid. */ - - static boolean(value) { if (typeof value !== "boolean") { throw new TypeError("Expected a Boolean."); } } + /** * Validates that a value is a number. * @param {*} value The value to validate. * @returns {void} * @throws {TypeError} If the value is invalid. */ - - static number(value) { if (typeof value !== "number") { throw new TypeError("Expected a number."); } } + /** * Validates that a value is a object. * @param {*} value The value to validate. * @returns {void} * @throws {TypeError} If the value is invalid. */ - - static object(value) { if (!value || typeof value !== "object") { throw new TypeError("Expected an object."); } } + /** * Validates that a value is a object or null. * @param {*} value The value to validate. * @returns {void} * @throws {TypeError} If the value is invalid. */ - - static "object?"(value) { if (typeof value !== "object") { throw new TypeError("Expected an object or null."); } } + /** * Validates that a value is a string. * @param {*} value The value to validate. * @returns {void} * @throws {TypeError} If the value is invalid. */ - - static string(value) { if (typeof value !== "string") { throw new TypeError("Expected a string."); } } + /** * Validates that a value is a non-empty string. * @param {*} value The value to validate. * @returns {void} * @throws {TypeError} If the value is invalid. */ - - static "string!"(value) { if (typeof value !== "string" || value.length === 0) { throw new TypeError("Expected a non-empty string."); } } - } - exports.ValidationStrategy = ValidationStrategy; /***/ }), -/* 961 */ +/* 971 */ /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -131597,7 +117839,10 @@ exports.ValidationStrategy = ValidationStrategy; * @fileoverview Flat config schema * @author Nicholas C. Zakas */ - //----------------------------------------------------------------------------- + + + +//----------------------------------------------------------------------------- // Type Definitions //----------------------------------------------------------------------------- @@ -131608,43 +117853,40 @@ exports.ValidationStrategy = ValidationStrategy; * @property {Function|string} validate The function or name of the function to call * to validate the value of this property. */ + //----------------------------------------------------------------------------- // Helpers //----------------------------------------------------------------------------- - const ruleSeverities = new Map([[0, 0], ["off", 0], [1, 1], ["warn", 1], [2, 2], ["error", 2]]); const globalVariablesValues = new Set([true, "true", "writable", "writeable", false, "false", "readonly", "readable", null, "off"]); + /** * Check if a value is a non-null object. * @param {any} value The value to check. * @returns {boolean} `true` if the value is a non-null object. */ - function isNonNullObject(value) { return typeof value === "object" && value !== null; } + /** * Check if a value is undefined. * @param {any} value The value to check. * @returns {boolean} `true` if the value is undefined. */ - - function isUndefined(value) { return typeof value === "undefined"; } + /** * Deeply merges two objects. * @param {Object} first The base object. * @param {Object} second The overrides object. * @returns {Object} An object with properties from both first and second. */ - - function deepMerge() { let first = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; let second = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - /* * If the second value is an array, just return it. We don't merge * arrays because order matters and we can't know the correct order. @@ -131652,27 +117894,24 @@ function deepMerge() { if (Array.isArray(second)) { return second; } + /* * First create a result object where properties from the second object * overwrite properties from the first. This sets up a baseline to use * later rather than needing to inspect and change every property * individually. */ - - - const result = { ...first, + const result = { + ...first, ...second }; - for (const key of Object.keys(second)) { // avoid hairy edge case if (key === "__proto__") { continue; } - const firstValue = first[key]; const secondValue = second[key]; - if (isNonNullObject(firstValue)) { result[key] = deepMerge(firstValue, secondValue); } else if (isUndefined(firstValue)) { @@ -131683,209 +117922,209 @@ function deepMerge() { } } } - return result; } + /** * Normalizes the rule options config for a given rule by ensuring that * it is an array and that the first item is 0, 1, or 2. * @param {Array|string|number} ruleOptions The rule options config. * @returns {Array} An array of rule options. */ - - function normalizeRuleOptions(ruleOptions) { const finalOptions = Array.isArray(ruleOptions) ? ruleOptions.slice(0) : [ruleOptions]; finalOptions[0] = ruleSeverities.get(finalOptions[0]); return finalOptions; -} //----------------------------------------------------------------------------- +} + +//----------------------------------------------------------------------------- // Assertions //----------------------------------------------------------------------------- /** - * Validates that a value is a valid rule options entry. - * @param {any} value The value to check. - * @returns {void} - * @throws {TypeError} If the value isn't a valid rule options. + * The error type when a rule's options are configured with an invalid type. */ - - -function assertIsRuleOptions(value) { - if (typeof value !== "string" && typeof value !== "number" && !Array.isArray(value)) { - throw new TypeError("Expected a string, number, or array."); +class InvalidRuleOptionsError extends Error { + /** + * @param {string} ruleId Rule name being configured. + * @param {any} value The invalid value. + */ + constructor(ruleId, value) { + super(`Key "${ruleId}": Expected severity of "off", 0, "warn", 1, "error", or 2.`); + this.messageTemplate = "invalid-rule-options"; + this.messageData = { + ruleId, + value + }; } } + +/** + * Validates that a value is a valid rule options entry. + * @param {string} ruleId Rule name being configured. + * @param {any} value The value to check. + * @returns {void} + * @throws {InvalidRuleOptionsError} If the value isn't a valid rule options. + */ +function assertIsRuleOptions(ruleId, value) { + if (typeof value !== "string" && typeof value !== "number" && !Array.isArray(value)) { + throw new InvalidRuleOptionsError(ruleId, value); + } +} + +/** + * The error type when a rule's severity is invalid. + */ +class InvalidRuleSeverityError extends Error { + /** + * @param {string} ruleId Rule name being configured. + * @param {any} value The invalid value. + */ + constructor(ruleId, value) { + super(`Key "${ruleId}": Expected severity of "off", 0, "warn", 1, "error", or 2.`); + this.messageTemplate = "invalid-rule-severity"; + this.messageData = { + ruleId, + value + }; + } +} + /** * Validates that a value is valid rule severity. + * @param {string} ruleId Rule name being configured. * @param {any} value The value to check. * @returns {void} - * @throws {TypeError} If the value isn't a valid rule severity. + * @throws {InvalidRuleSeverityError} If the value isn't a valid rule severity. */ - - -function assertIsRuleSeverity(value) { +function assertIsRuleSeverity(ruleId, value) { const severity = typeof value === "string" ? ruleSeverities.get(value.toLowerCase()) : ruleSeverities.get(value); - if (typeof severity === "undefined") { - throw new TypeError("Expected severity of \"off\", 0, \"warn\", 1, \"error\", or 2."); + throw new InvalidRuleSeverityError(ruleId, value); } } + /** * Validates that a given string is the form pluginName/objectName. * @param {string} value The string to check. * @returns {void} * @throws {TypeError} If the string isn't in the correct format. */ - - function assertIsPluginMemberName(value) { if (!/[@a-z0-9-_$]+(?:\/(?:[a-z0-9-_$]+))+$/iu.test(value)) { throw new TypeError(`Expected string in the form "pluginName/objectName" but found "${value}".`); } } + /** * Validates that a value is an object. * @param {any} value The value to check. * @returns {void} * @throws {TypeError} If the value isn't an object. */ - - function assertIsObject(value) { if (!isNonNullObject(value)) { throw new TypeError("Expected an object."); } } -/** - * Validates that a value is an object or a string. - * @param {any} value The value to check. - * @returns {void} - * @throws {TypeError} If the value isn't an object or a string. - */ - -function assertIsObjectOrString(value) { - if ((!value || typeof value !== "object") && typeof value !== "string") { - throw new TypeError("Expected an object or string."); - } -} //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- // Low-Level Schemas //----------------------------------------------------------------------------- /** @type {ObjectPropertySchema} */ - - const booleanSchema = { merge: "replace", validate: "boolean" }; -/** @type {ObjectPropertySchema} */ +/** @type {ObjectPropertySchema} */ const deepObjectAssignSchema = { merge() { let first = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; let second = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return deepMerge(first, second); }, - validate: "object" -}; //----------------------------------------------------------------------------- +}; + +//----------------------------------------------------------------------------- // High-Level Schemas //----------------------------------------------------------------------------- /** @type {ObjectPropertySchema} */ - const globalsSchema = { merge: "assign", - validate(value) { assertIsObject(value); - for (const key of Object.keys(value)) { // avoid hairy edge case if (key === "__proto__") { continue; } - if (key !== key.trim()) { throw new TypeError(`Global "${key}" has leading or trailing whitespace.`); } - if (!globalVariablesValues.has(value[key])) { throw new TypeError(`Key "${key}": Expected "readonly", "writable", or "off".`); } } } - }; -/** @type {ObjectPropertySchema} */ +/** @type {ObjectPropertySchema} */ const parserSchema = { merge: "replace", - validate(value) { - assertIsObjectOrString(value); - - if (typeof value === "object" && typeof value.parse !== "function" && typeof value.parseForESLint !== "function") { - throw new TypeError("Expected object to have a parse() or parseForESLint() method."); - } - - if (typeof value === "string") { - assertIsPluginMemberName(value); + if (!value || typeof value !== "object" || typeof value.parse !== "function" && typeof value.parseForESLint !== "function") { + throw new TypeError("Expected object with parse() or parseForESLint() method."); } } - }; -/** @type {ObjectPropertySchema} */ +/** @type {ObjectPropertySchema} */ const pluginsSchema = { merge() { let first = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; let second = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; const keys = new Set([...Object.keys(first), ...Object.keys(second)]); - const result = {}; // manually validate that plugins are not redefined + const result = {}; + // manually validate that plugins are not redefined for (const key of keys) { // avoid hairy edge case if (key === "__proto__") { continue; } - if (key in first && key in second && first[key] !== second[key]) { throw new TypeError(`Cannot redefine plugin "${key}".`); } - result[key] = second[key] || first[key]; } - return result; }, - validate(value) { // first check the value to be sure it's an object if (value === null || typeof value !== "object") { throw new TypeError("Expected an object."); - } // second check the keys to make sure they are objects - + } + // second check the keys to make sure they are objects for (const key of Object.keys(value)) { // avoid hairy edge case if (key === "__proto__") { continue; } - if (value[key] === null || typeof value[key] !== "object") { throw new TypeError(`Key "${key}": Expected an object.`); } } } - }; -/** @type {ObjectPropertySchema} */ +/** @type {ObjectPropertySchema} */ const processorSchema = { merge: "replace", - validate(value) { if (typeof value === "string") { assertIsPluginMemberName(value); @@ -131897,18 +118136,17 @@ const processorSchema = { throw new TypeError("Expected an object or a string."); } } - }; -/** @type {ObjectPropertySchema} */ +/** @type {ObjectPropertySchema} */ const rulesSchema = { merge() { let first = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; let second = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - const result = { ...first, + const result = { + ...first, ...second }; - for (const ruleId of Object.keys(result)) { // avoid hairy edge case if (ruleId === "__proto__") { @@ -131916,101 +118154,85 @@ const rulesSchema = { delete result.__proto__; continue; } - result[ruleId] = normalizeRuleOptions(result[ruleId]); + /* * If either rule config is missing, then the correct * config is already present and we just need to normalize * the severity. */ - if (!(ruleId in first) || !(ruleId in second)) { continue; } - const firstRuleOptions = normalizeRuleOptions(first[ruleId]); const secondRuleOptions = normalizeRuleOptions(second[ruleId]); + /* * If the second rule config only has a severity (length of 1), * then use that severity and keep the rest of the options from * the first rule config. */ - if (secondRuleOptions.length === 1) { result[ruleId] = [secondRuleOptions[0], ...firstRuleOptions.slice(1)]; continue; } + /* * In any other situation, then the second rule config takes * precedence. That means the value at `result[ruleId]` is * already correct and no further work is necessary. */ - } return result; }, - validate(value) { assertIsObject(value); - let lastRuleId; // Performance: One try-catch has less overhead than one per loop iteration - try { - /* - * We are not checking the rule schema here because there is no - * guarantee that the rule definition is present at this point. Instead - * we wait and check the rule schema during the finalization step - * of calculating a config. - */ - for (const ruleId of Object.keys(value)) { - // avoid hairy edge case - if (ruleId === "__proto__") { - continue; - } - - lastRuleId = ruleId; - const ruleOptions = value[ruleId]; - assertIsRuleOptions(ruleOptions); - - if (Array.isArray(ruleOptions)) { - assertIsRuleSeverity(ruleOptions[0]); - } else { - assertIsRuleSeverity(ruleOptions); - } + /* + * We are not checking the rule schema here because there is no + * guarantee that the rule definition is present at this point. Instead + * we wait and check the rule schema during the finalization step + * of calculating a config. + */ + for (const ruleId of Object.keys(value)) { + // avoid hairy edge case + if (ruleId === "__proto__") { + continue; + } + const ruleOptions = value[ruleId]; + assertIsRuleOptions(ruleId, ruleOptions); + if (Array.isArray(ruleOptions)) { + assertIsRuleSeverity(ruleId, ruleOptions[0]); + } else { + assertIsRuleSeverity(ruleId, ruleOptions); } - } catch (error) { - error.message = `Key "${lastRuleId}": ${error.message}`; - throw error; } } - }; -/** @type {ObjectPropertySchema} */ +/** @type {ObjectPropertySchema} */ const ecmaVersionSchema = { merge: "replace", - validate(value) { if (typeof value === "number" || value === "latest") { return; } - throw new TypeError("Expected a number or \"latest\"."); } - }; -/** @type {ObjectPropertySchema} */ +/** @type {ObjectPropertySchema} */ const sourceTypeSchema = { merge: "replace", - validate(value) { if (typeof value !== "string" || !/^(?:script|module|commonjs)$/u.test(value)) { throw new TypeError("Expected \"script\", \"module\", or \"commonjs\"."); } } +}; -}; //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- // Full schema //----------------------------------------------------------------------------- @@ -132037,7 +118259,7 @@ exports.flatConfigSchema = { }; /***/ }), -/* 962 */ +/* 972 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -132045,19 +118267,21 @@ exports.flatConfigSchema = { * @fileoverview Rule Validator * @author Nicholas C. Zakas */ - //----------------------------------------------------------------------------- + + + +//----------------------------------------------------------------------------- // Requirements //----------------------------------------------------------------------------- - -const ajv = __webpack_require__(963)(); - +const ajv = __webpack_require__(973)(); const { parseRuleId, getRuleFromConfig, getRuleOptionsSchema -} = __webpack_require__(950); +} = __webpack_require__(960); +const ruleReplacements = __webpack_require__(959); -const ruleReplacements = __webpack_require__(949); //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- // Helpers //----------------------------------------------------------------------------- @@ -132070,8 +118294,6 @@ const ruleReplacements = __webpack_require__(949); //--------------------------- * @throws {TypeError} For missing plugin or rule. * @returns {void} */ - - function throwRuleNotFoundError(_ref, config) { let { pluginName, @@ -132079,36 +118301,38 @@ function throwRuleNotFoundError(_ref, config) { } = _ref; const ruleId = pluginName === "@" ? ruleName : `${pluginName}/${ruleName}`; const errorMessageHeader = `Key "rules": Key "${ruleId}"`; - let errorMessage = `${errorMessageHeader}: Could not find plugin "${pluginName}".`; // if the plugin exists then we need to check if the rule exists + let errorMessage = `${errorMessageHeader}: Could not find plugin "${pluginName}".`; + // if the plugin exists then we need to check if the rule exists if (config.plugins && config.plugins[pluginName]) { const replacementRuleName = ruleReplacements.rules[ruleName]; - if (pluginName === "@" && replacementRuleName) { errorMessage = `${errorMessageHeader}: Rule "${ruleName}" was removed and replaced by "${replacementRuleName}".`; } else { - errorMessage = `${errorMessageHeader}: Could not find "${ruleName}" in plugin "${pluginName}".`; // otherwise, let's see if we can find the rule name elsewhere + errorMessage = `${errorMessageHeader}: Could not find "${ruleName}" in plugin "${pluginName}".`; + // otherwise, let's see if we can find the rule name elsewhere for (const [otherPluginName, otherPlugin] of Object.entries(config.plugins)) { if (otherPlugin.rules && otherPlugin.rules[ruleName]) { errorMessage += ` Did you mean "${otherPluginName}/${ruleName}"?`; break; } } - } // falls through to throw error + } + // falls through to throw error } throw new TypeError(errorMessage); -} //----------------------------------------------------------------------------- +} + +//----------------------------------------------------------------------------- // Exports //----------------------------------------------------------------------------- /** * Implements validation functionality for the rules portion of a config. */ - - class RuleValidator { /** * Creates a new instance. @@ -132121,6 +118345,7 @@ class RuleValidator { */ this.validators = new WeakMap(); } + /** * Validates all of the rule configurations in a config against each * rule's schema. @@ -132129,18 +118354,16 @@ class RuleValidator { * @returns {void} * @throws {Error} If a rule's configuration does not match its schema. */ - - validate(config) { if (!config.rules) { return; } - for (const [ruleId, ruleOptions] of Object.entries(config.rules)) { // check for edge case if (ruleId === "__proto__") { continue; } + /* * If a rule is disabled, we don't do any validation. This allows * users to safely set any value to 0 or "off" without worrying @@ -132150,45 +118373,35 @@ class RuleValidator { * this validation occurs after FlatConfigArray has merged and * normalized values. */ - - if (ruleOptions[0] === 0) { continue; } - const rule = getRuleFromConfig(ruleId, config); - if (!rule) { throwRuleNotFoundError(parseRuleId(ruleId), config); - } // Precompile and cache validator the first time - + } + // Precompile and cache validator the first time if (!this.validators.has(rule)) { const schema = getRuleOptionsSchema(rule); - if (schema) { this.validators.set(rule, ajv.compile(schema)); } } - const validateRule = this.validators.get(rule); - if (validateRule) { validateRule(ruleOptions.slice(1)); - if (validateRule.errors) { throw new Error(`Key "rules": Key "${ruleId}": ${validateRule.errors.map(error => `\tValue ${JSON.stringify(error.data)} ${error.message}.\n`).join("")}`); } } } } - } - exports.RuleValidator = RuleValidator; /***/ }), -/* 963 */ +/* 973 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -132196,16 +118409,18 @@ exports.RuleValidator = RuleValidator; * @fileoverview The instance of Ajv validator. * @author Evgeny Poberezkin */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const Ajv = __webpack_require__(540), + metaSchema = __webpack_require__(974); -const Ajv = __webpack_require__(517), - metaSchema = __webpack_require__(964); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ - module.exports = function () { let additionalOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; const ajv = new Ajv({ @@ -132217,21 +118432,21 @@ module.exports = function () { schemaId: "auto", ...additionalOptions }); - ajv.addMetaSchema(metaSchema); // eslint-disable-next-line no-underscore-dangle -- Ajv's API - + ajv.addMetaSchema(metaSchema); + // eslint-disable-next-line no-underscore-dangle -- Ajv's API ajv._opts.defaultMeta = metaSchema.id; return ajv; }; /***/ }), -/* 964 */ +/* 974 */ /***/ ((module) => { "use strict"; module.exports = JSON.parse('{"id":"http://json-schema.org/draft-04/schema#","$schema":"http://json-schema.org/draft-04/schema#","description":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"positiveInteger":{"type":"integer","minimum":0},"positiveIntegerDefault0":{"allOf":[{"$ref":"#/definitions/positiveInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true}},"type":"object","properties":{"id":{"type":"string"},"$schema":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"multipleOf":{"type":"number","minimum":0,"exclusiveMinimum":true},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"$ref":"#/definitions/positiveInteger"},"minLength":{"$ref":"#/definitions/positiveIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"anyOf":[{"type":"boolean"},{"$ref":"#"}],"default":{}},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/positiveInteger"},"minItems":{"$ref":"#/definitions/positiveIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"$ref":"#/definitions/positiveInteger"},"minProperties":{"$ref":"#/definitions/positiveIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"anyOf":[{"type":"boolean"},{"$ref":"#"}],"default":{}},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"dependencies":{"exclusiveMaximum":["maximum"],"exclusiveMinimum":["minimum"]},"default":{}}'); /***/ }), -/* 965 */ +/* 975 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -132239,22 +118454,21 @@ module.exports = JSON.parse('{"id":"http://json-schema.org/draft-04/schema#","$s * @fileoverview Default configuration * @author Nicholas C. Zakas */ - //----------------------------------------------------------------------------- + + + +//----------------------------------------------------------------------------- // Requirements //----------------------------------------------------------------------------- +const Rules = __webpack_require__(636); -const Rules = __webpack_require__(615); //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- // Helpers //----------------------------------------------------------------------------- - exports.defaultConfig = [{ plugins: { "@": { - parsers: { - espree: __webpack_require__(508) - }, - /* * Because we try to delay loading rules until absolutely * necessary, a proxy allows us to hook into the lazy-loading @@ -132265,24 +118479,24 @@ exports.defaultConfig = [{ get(target, property) { return Rules.get(property); }, - has(target, property) { return Rules.has(property); } - }) } }, languageOptions: { sourceType: "module", ecmaVersion: "latest", - parser: "@/espree", + parser: __webpack_require__(530), parserOptions: {} } -}, // default ignores are listed here +}, +// default ignores are listed here { - ignores: ["**/node_modules/**", ".git/**"] -}, // intentionally empty config to ensure these files are globbed by default + ignores: ["**/node_modules/", ".git/"] +}, +// intentionally empty config to ensure these files are globbed by default { files: ["**/*.js", "**/*.mjs"] }, { @@ -132294,7 +118508,313 @@ exports.defaultConfig = [{ }]; /***/ }), -/* 966 */ +/* 976 */ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +/** + * @fileoverview Main package entrypoint. + * @author Nicholas C. Zakas + */ + + + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ +module.exports = { + configs: { + all: __webpack_require__(977), + recommended: __webpack_require__(978) + } +}; + +/***/ }), +/* 977 */ +/***/ ((module) => { + +"use strict"; +/* + * WARNING: This file is autogenerated using the tools/update-eslint-all.js + * script. Do not edit manually. + */ + + +/* eslint quote-props: off -- autogenerated so don't lint */ +module.exports = Object.freeze({ + "rules": { + "accessor-pairs": "error", + "array-bracket-newline": "error", + "array-bracket-spacing": "error", + "array-callback-return": "error", + "array-element-newline": "error", + "arrow-body-style": "error", + "arrow-parens": "error", + "arrow-spacing": "error", + "block-scoped-var": "error", + "block-spacing": "error", + "brace-style": "error", + "camelcase": "error", + "capitalized-comments": "error", + "class-methods-use-this": "error", + "comma-dangle": "error", + "comma-spacing": "error", + "comma-style": "error", + "complexity": "error", + "computed-property-spacing": "error", + "consistent-return": "error", + "consistent-this": "error", + "constructor-super": "error", + "curly": "error", + "default-case": "error", + "default-case-last": "error", + "default-param-last": "error", + "dot-location": "error", + "dot-notation": "error", + "eol-last": "error", + "eqeqeq": "error", + "for-direction": "error", + "func-call-spacing": "error", + "func-name-matching": "error", + "func-names": "error", + "func-style": "error", + "function-call-argument-newline": "error", + "function-paren-newline": "error", + "generator-star-spacing": "error", + "getter-return": "error", + "grouped-accessor-pairs": "error", + "guard-for-in": "error", + "id-denylist": "error", + "id-length": "error", + "id-match": "error", + "implicit-arrow-linebreak": "error", + "indent": "error", + "init-declarations": "error", + "jsx-quotes": "error", + "key-spacing": "error", + "keyword-spacing": "error", + "line-comment-position": "error", + "linebreak-style": "error", + "lines-around-comment": "error", + "lines-between-class-members": "error", + "logical-assignment-operators": "error", + "max-classes-per-file": "error", + "max-depth": "error", + "max-len": "error", + "max-lines": "error", + "max-lines-per-function": "error", + "max-nested-callbacks": "error", + "max-params": "error", + "max-statements": "error", + "max-statements-per-line": "error", + "multiline-comment-style": "error", + "multiline-ternary": "error", + "new-cap": "error", + "new-parens": "error", + "newline-per-chained-call": "error", + "no-alert": "error", + "no-array-constructor": "error", + "no-async-promise-executor": "error", + "no-await-in-loop": "error", + "no-bitwise": "error", + "no-caller": "error", + "no-case-declarations": "error", + "no-class-assign": "error", + "no-compare-neg-zero": "error", + "no-cond-assign": "error", + "no-confusing-arrow": "error", + "no-console": "error", + "no-const-assign": "error", + "no-constant-binary-expression": "error", + "no-constant-condition": "error", + "no-constructor-return": "error", + "no-continue": "error", + "no-control-regex": "error", + "no-debugger": "error", + "no-delete-var": "error", + "no-div-regex": "error", + "no-dupe-args": "error", + "no-dupe-class-members": "error", + "no-dupe-else-if": "error", + "no-dupe-keys": "error", + "no-duplicate-case": "error", + "no-duplicate-imports": "error", + "no-else-return": "error", + "no-empty": "error", + "no-empty-character-class": "error", + "no-empty-function": "error", + "no-empty-pattern": "error", + "no-empty-static-block": "error", + "no-eq-null": "error", + "no-eval": "error", + "no-ex-assign": "error", + "no-extend-native": "error", + "no-extra-bind": "error", + "no-extra-boolean-cast": "error", + "no-extra-label": "error", + "no-extra-parens": "error", + "no-extra-semi": "error", + "no-fallthrough": "error", + "no-floating-decimal": "error", + "no-func-assign": "error", + "no-global-assign": "error", + "no-implicit-coercion": "error", + "no-implicit-globals": "error", + "no-implied-eval": "error", + "no-import-assign": "error", + "no-inline-comments": "error", + "no-inner-declarations": "error", + "no-invalid-regexp": "error", + "no-invalid-this": "error", + "no-irregular-whitespace": "error", + "no-iterator": "error", + "no-label-var": "error", + "no-labels": "error", + "no-lone-blocks": "error", + "no-lonely-if": "error", + "no-loop-func": "error", + "no-loss-of-precision": "error", + "no-magic-numbers": "error", + "no-misleading-character-class": "error", + "no-mixed-operators": "error", + "no-mixed-spaces-and-tabs": "error", + "no-multi-assign": "error", + "no-multi-spaces": "error", + "no-multi-str": "error", + "no-multiple-empty-lines": "error", + "no-negated-condition": "error", + "no-nested-ternary": "error", + "no-new": "error", + "no-new-func": "error", + "no-new-native-nonconstructor": "error", + "no-new-object": "error", + "no-new-symbol": "error", + "no-new-wrappers": "error", + "no-nonoctal-decimal-escape": "error", + "no-obj-calls": "error", + "no-octal": "error", + "no-octal-escape": "error", + "no-param-reassign": "error", + "no-plusplus": "error", + "no-promise-executor-return": "error", + "no-proto": "error", + "no-prototype-builtins": "error", + "no-redeclare": "error", + "no-regex-spaces": "error", + "no-restricted-exports": "error", + "no-restricted-globals": "error", + "no-restricted-imports": "error", + "no-restricted-properties": "error", + "no-restricted-syntax": "error", + "no-return-assign": "error", + "no-return-await": "error", + "no-script-url": "error", + "no-self-assign": "error", + "no-self-compare": "error", + "no-sequences": "error", + "no-setter-return": "error", + "no-shadow": "error", + "no-shadow-restricted-names": "error", + "no-sparse-arrays": "error", + "no-tabs": "error", + "no-template-curly-in-string": "error", + "no-ternary": "error", + "no-this-before-super": "error", + "no-throw-literal": "error", + "no-trailing-spaces": "error", + "no-undef": "error", + "no-undef-init": "error", + "no-undefined": "error", + "no-underscore-dangle": "error", + "no-unexpected-multiline": "error", + "no-unmodified-loop-condition": "error", + "no-unneeded-ternary": "error", + "no-unreachable": "error", + "no-unreachable-loop": "error", + "no-unsafe-finally": "error", + "no-unsafe-negation": "error", + "no-unsafe-optional-chaining": "error", + "no-unused-expressions": "error", + "no-unused-labels": "error", + "no-unused-private-class-members": "error", + "no-unused-vars": "error", + "no-use-before-define": "error", + "no-useless-backreference": "error", + "no-useless-call": "error", + "no-useless-catch": "error", + "no-useless-computed-key": "error", + "no-useless-concat": "error", + "no-useless-constructor": "error", + "no-useless-escape": "error", + "no-useless-rename": "error", + "no-useless-return": "error", + "no-var": "error", + "no-void": "error", + "no-warning-comments": "error", + "no-whitespace-before-property": "error", + "no-with": "error", + "nonblock-statement-body-position": "error", + "object-curly-newline": "error", + "object-curly-spacing": "error", + "object-property-newline": "error", + "object-shorthand": "error", + "one-var": "error", + "one-var-declaration-per-line": "error", + "operator-assignment": "error", + "operator-linebreak": "error", + "padded-blocks": "error", + "padding-line-between-statements": "error", + "prefer-arrow-callback": "error", + "prefer-const": "error", + "prefer-destructuring": "error", + "prefer-exponentiation-operator": "error", + "prefer-named-capture-group": "error", + "prefer-numeric-literals": "error", + "prefer-object-has-own": "error", + "prefer-object-spread": "error", + "prefer-promise-reject-errors": "error", + "prefer-regex-literals": "error", + "prefer-rest-params": "error", + "prefer-spread": "error", + "prefer-template": "error", + "quote-props": "error", + "quotes": "error", + "radix": "error", + "require-atomic-updates": "error", + "require-await": "error", + "require-unicode-regexp": "error", + "require-yield": "error", + "rest-spread-spacing": "error", + "semi": "error", + "semi-spacing": "error", + "semi-style": "error", + "sort-imports": "error", + "sort-keys": "error", + "sort-vars": "error", + "space-before-blocks": "error", + "space-before-function-paren": "error", + "space-in-parens": "error", + "space-infix-ops": "error", + "space-unary-ops": "error", + "spaced-comment": "error", + "strict": "error", + "switch-colon-spacing": "error", + "symbol-description": "error", + "template-curly-spacing": "error", + "template-tag-spacing": "error", + "unicode-bom": "error", + "use-isnan": "error", + "valid-typeof": "error", + "vars-on-top": "error", + "wrap-iife": "error", + "wrap-regex": "error", + "yield-star-spacing": "error", + "yoda": "error" + } +}); + +/***/ }), +/* 978 */ /***/ ((module) => { "use strict"; @@ -132304,12 +118824,13 @@ exports.defaultConfig = [{ * @author Nicholas C. Zakas */ + + /* eslint sort-keys: ["error", "asc"] -- Long, so make more readable */ /** @type {import("../lib/shared/types").ConfigData} */ - -module.exports = { - rules: { +module.exports = Object.freeze({ + rules: Object.freeze({ "constructor-super": "error", "for-direction": "error", "getter-return": "error", @@ -132371,46 +118892,11 @@ module.exports = { "require-yield": "error", "use-isnan": "error", "valid-typeof": "error" - } -}; + }) +}); /***/ }), -/* 967 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -/** - * @fileoverview Config to enable all rules. - * @author Robert Fletcher - */ - //------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const builtInRules = __webpack_require__(615); //------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - - -const allRules = {}; - -for (const [ruleId, rule] of builtInRules) { - if (!rule.meta.deprecated) { - allRules[ruleId] = "error"; - } -} //------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -/** @type {import("../lib/shared/types").ConfigData} */ - - -module.exports = { - rules: allRules -}; - -/***/ }), -/* 968 */ +/* 979 */ /***/ ((module) => { "use strict"; @@ -132418,10 +118904,12 @@ module.exports = { * @fileoverview Globals for ecmaVersion/sourceType * @author Nicholas C. Zakas */ - //----------------------------------------------------------------------------- + + + +//----------------------------------------------------------------------------- // Globals //----------------------------------------------------------------------------- - const commonjs = { exports: true, global: false, @@ -132467,10 +118955,12 @@ const es3 = { URIError: false, valueOf: false }; -const es5 = { ...es3, +const es5 = { + ...es3, JSON: false }; -const es2015 = { ...es5, +const es2015 = { + ...es5, ArrayBuffer: false, DataView: false, Float32Array: false, @@ -132490,35 +118980,48 @@ const es2015 = { ...es5, Uint8ClampedArray: false, WeakMap: false, WeakSet: false -}; // no new globals in ES2016 - -const es2016 = { ...es2015 }; -const es2017 = { ...es2016, + +// no new globals in ES2016 +const es2016 = { + ...es2015 +}; +const es2017 = { + ...es2016, Atomics: false, SharedArrayBuffer: false -}; // no new globals in ES2018 - -const es2018 = { ...es2017 -}; // no new globals in ES2019 - -const es2019 = { ...es2018 }; -const es2020 = { ...es2019, + +// no new globals in ES2018 +const es2018 = { + ...es2017 +}; + +// no new globals in ES2019 +const es2019 = { + ...es2018 +}; +const es2020 = { + ...es2019, BigInt: false, BigInt64Array: false, BigUint64Array: false, globalThis: false }; -const es2021 = { ...es2020, +const es2021 = { + ...es2020, AggregateError: false, FinalizationRegistry: false, WeakRef: false }; -const es2022 = { ...es2021 +const es2022 = { + ...es2021 }; -const es2023 = { ...es2022 -}; //----------------------------------------------------------------------------- +const es2023 = { + ...es2022 +}; + +//----------------------------------------------------------------------------- // Exports //----------------------------------------------------------------------------- @@ -132538,7 +119041,7 @@ module.exports = { }; /***/ }), -/* 969 */ +/* 980 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -132546,19 +119049,17 @@ module.exports = { const { ESLint -} = __webpack_require__(970); - +} = __webpack_require__(981); const { FlatESLint -} = __webpack_require__(1013); - +} = __webpack_require__(1024); module.exports = { ESLint, FlatESLint }; /***/ }), -/* 970 */ +/* 981 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -132567,59 +119068,51 @@ module.exports = { * @author Kai Cataldo * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - -const path = __webpack_require__(501); - -const fs = __webpack_require__(971); - +const path = __webpack_require__(523); +const fs = __webpack_require__(982); const { promisify -} = __webpack_require__(516); - +} = __webpack_require__(539); const { CLIEngine, getCLIEngineInternalSlots -} = __webpack_require__(972); - -const BuiltinRules = __webpack_require__(615); - +} = __webpack_require__(983); +const BuiltinRules = __webpack_require__(636); const { Legacy: { ConfigOps: { getRuleSeverity } } -} = __webpack_require__(974); - +} = __webpack_require__(985); const { version -} = __webpack_require__(513); //------------------------------------------------------------------------------ +} = __webpack_require__(535); + +//------------------------------------------------------------------------------ // 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").SuppressedLintMessage} SuppressedLintMessage */ - /** @typedef {import("../shared/types").Plugin} Plugin */ - /** @typedef {import("../shared/types").Rule} Rule */ - /** @typedef {import("../shared/types").LintResult} LintResult */ +/** @typedef {import("../shared/types").ResultsMeta} ResultsMeta */ /** * The main formatter object. * @typedef LoadedFormatter - * @property {function(LintResult[]): string | Promise} format format function. + * @property {(results: LintResult[], resultsMeta: ResultsMeta) => string | Promise} format format function. */ /** @@ -132660,78 +119153,72 @@ const { * @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 strings or not. * @param {any} x The value to check. * @returns {boolean} `true` if `x` is an array of non-empty strings. */ - - 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 === "directive" || 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. * @throws {ESLintInvalidOptionsError} If of any of a variety of type errors. * @returns {ESLintOptions} The normalized options. */ - - function processOptions(_ref) { let { allowInlineConfig = true, @@ -132764,133 +119251,101 @@ function processOptions(_ref) { } = _ref; 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 (cacheStrategy !== "metadata" && cacheStrategy !== "content") { errors.push("'cacheStrategy' must be any of \"metadata\", \"content\"."); } - 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 \"directive\", \"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("'useEslintrc' must be a boolean."); } - if (errors.length > 0) { throw new ESLintInvalidOptionsError(errors); } - return { allowInlineConfig, baseConfig, @@ -132912,13 +119367,12 @@ function processOptions(_ref) { 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) { @@ -132927,16 +119381,14 @@ function hasDefinedProperty(obj) { } } } - 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, _ref2) => { let [id, rule] = _ref2; @@ -132944,17 +119396,16 @@ function createRulesMeta(rules) { 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, @@ -132964,20 +119415,18 @@ function getOrFindUsedDeprecatedRules(cliEngine, maybeFilePath) { } = 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. + 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, @@ -132985,12 +119434,11 @@ function getOrFindUsedDeprecatedRules(cliEngine, maybeFilePath) { }); } } - 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. @@ -132998,8 +119446,6 @@ function getOrFindUsedDeprecatedRules(cliEngine, maybeFilePath) { * @param {CLIEngineLintReport} report The CLIEngine linting report to process. * @returns {LintResult[]} The processed linting results. */ - - function processCLIEngineLintReport(cliEngine, _ref3) { let { results @@ -133007,43 +119453,35 @@ function processCLIEngineLintReport(cliEngine, _ref3) { 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; } + /** * Main API. */ - - class ESLint { /** * Creates a new instance of the main ESLint API. @@ -133060,77 +119498,73 @@ class ESLint { lastConfigArrays } = getCLIEngineInternalSlots(cliEngine); let updated = false; + /* * 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. - + } + // Update caches. if (updated) { configArrayFactory.clearCache(); lastConfigArrays[0] = configArrayFactory.getConfigArrayForFile(); - } // Initialize private properties. - + } + // 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); } + /** * Returns meta objects for each rule represented in the lint results. * @param {LintResult[]} results The results to fetch rules meta for. * @returns {Object} A mapping of ruleIds to rule meta objects. */ - - getRulesMetaForResults(results) { - const resultRuleIds = new Set(); // first gather all ruleIds from all results + const resultRuleIds = new Set(); + + // first gather all ruleIds from all results for (const result of results) { for (const { @@ -133138,46 +119572,43 @@ class ESLint { } of result.messages) { resultRuleIds.add(ruleId); } - for (const { ruleId } of result.suppressedMessages) { resultRuleIds.add(ruleId); } - } // create a map of all rules in the results + } + // create a map of all rules in the results const { cliEngine } = privateMembersMap.get(this); const rules = cliEngine.getRules(); const resultRules = new Map(); - for (const [ruleId, rule] of rules) { if (resultRuleIds.has(ruleId)) { resultRules.set(ruleId, rule); } } - return createRulesMeta(resultRules); } + /** * 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. @@ -133186,43 +119617,35 @@ class ESLint { * @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) { let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - 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 || {}; const unknownOptionKeys = Object.keys(unknownOptions); - if (unknownOptionKeys.length > 0) { throw new Error(`'options' must not include the unknown option(s): ${unknownOptionKeys.join(", ")}`); } - 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 formatter to load. @@ -133238,52 +119661,45 @@ class ESLint { * This promise will be rejected if the given formatter was not found or not * a function. */ - - async loadFormatter() { let name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "stylish"; - if (typeof name !== "string") { throw new Error("'name' must be a string"); } - const { cliEngine, options } = 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 {LintResult[]} results The lint results to format. + * @param {ResultsMeta} resultsMeta Warning count and max threshold. * @returns {string | Promise} The formatted lint results. */ - format(results) { + format(results, resultsMeta) { let rulesMeta = null; results.sort(compareResultsByFilePath); return formatter(results, { + ...resultsMeta, get cwd() { return options.cwd; }, - 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 @@ -133291,44 +119707,38 @@ class ESLint { * @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. @@ -133337,18 +119747,17 @@ module.exports = { getESLintPrivateMembers(instance) { return privateMembersMap.get(instance); } - }; /***/ }), -/* 971 */ +/* 982 */ /***/ ((module) => { "use strict"; module.exports = require("fs"); /***/ }), -/* 972 */ +/* 983 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -133357,23 +119766,21 @@ module.exports = require("fs"); * @author Nicholas C. Zakas */ + + /* * 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 = __webpack_require__(971); - -const path = __webpack_require__(501); - -const defaultOptions = __webpack_require__(973); - -const pkg = __webpack_require__(513); - +const fs = __webpack_require__(982); +const path = __webpack_require__(523); +const defaultOptions = __webpack_require__(984); +const pkg = __webpack_require__(535); const { Legacy: { ConfigOps, @@ -133383,51 +119790,35 @@ const { getUsedExtractedConfigs, ModuleResolver } -} = __webpack_require__(974); - +} = __webpack_require__(985); const { FileEnumerator -} = __webpack_require__(984); - +} = __webpack_require__(995); const { Linter -} = __webpack_require__(988); +} = __webpack_require__(999); +const builtInRules = __webpack_require__(636); +const loadRules = __webpack_require__(1000); +const hash = __webpack_require__(1002); +const LintResultCache = __webpack_require__(1004); +const debug = __webpack_require__(589)("eslint:cli-engine"); +const validFixTypes = new Set(["directive", "problem", "suggestion", "layout"]); -const builtInRules = __webpack_require__(615); - -const loadRules = __webpack_require__(989); - -const hash = __webpack_require__(991); - -const LintResultCache = __webpack_require__(993); - -const debug = __webpack_require__(566)("eslint:cli-engine"); - -const validFixTypes = new Set(["directive", "problem", "suggestion", "layout"]); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Typedefs //------------------------------------------------------------------------------ + // For VSCode IntelliSense - /** @typedef {import("../shared/types").ConfigData} ConfigData */ - /** @typedef {import("../shared/types").DeprecatedRuleInfo} DeprecatedRuleInfo */ - /** @typedef {import("../shared/types").LintMessage} LintMessage */ - /** @typedef {import("../shared/types").SuppressedLintMessage} SuppressedLintMessage */ - /** @typedef {import("../shared/types").ParserOptions} ParserOptions */ - /** @typedef {import("../shared/types").Plugin} Plugin */ - /** @typedef {import("../shared/types").RuleConf} RuleConf */ - /** @typedef {import("../shared/types").Rule} Rule */ - /** @typedef {import("../shared/types").FormatterFunction} FormatterFunction */ - /** @typedef {ReturnType} ConfigArray */ - /** @typedef {ReturnType} ExtractedConfig */ /** @@ -133498,13 +119889,14 @@ const validFixTypes = new Set(["directive", "problem", "suggestion", "layout"]); * @property {Linter} linter The linter instance which has loaded rules. * @property {CLIEngineOptions} options The normalized options of this instance. */ + //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ /** @type {WeakMap} */ - const internalSlotsMap = new WeakMap(); + /** * Determines if each fix type in an array is supported by ESLint and throws * an error if not. @@ -133512,7 +119904,6 @@ const internalSlotsMap = new WeakMap(); * @returns {void} * @throws {Error} If an invalid fix type is found. */ - function validateFixTypes(fixTypes) { for (const fixType of fixTypes) { if (!validFixTypes.has(fixType)) { @@ -133520,34 +119911,29 @@ function validateFixTypes(fixTypes) { } } } + /** * It will calculate the error and warning count for collection of messages per file * @param {LintMessage[]} messages Collection of messages * @returns {Object} Contains the stats * @private */ - - function calculateStatsPerFile(messages) { return messages.reduce((stat, message) => { if (message.fatal || message.severity === 2) { stat.errorCount++; - if (message.fatal) { stat.fatalErrorCount++; } - if (message.fix) { stat.fixableErrorCount++; } } else { stat.warningCount++; - if (message.fix) { stat.fixableWarningCount++; } } - return stat; }, { errorCount: 0, @@ -133557,14 +119943,13 @@ function calculateStatsPerFile(messages) { fixableWarningCount: 0 }); } + /** * It will calculate the error and warning count for collection of results from all files * @param {LintResult[]} results Collection of messages from all the files * @returns {Object} Contains the stats * @private */ - - function calculateStatsPerRun(results) { return results.reduce((stat, result) => { stat.errorCount += result.errorCount; @@ -133581,6 +119966,7 @@ function calculateStatsPerRun(results) { fixableWarningCount: 0 }); } + /** * Processes an source code using ESLint. * @param {Object} config The config object. @@ -133596,8 +119982,6 @@ function calculateStatsPerRun(results) { * @returns {LintResult} The result of linting. * @private */ - - function verifyText(_ref) { let { text, @@ -133612,12 +119996,12 @@ function verifyText(_ref) { } = _ref; const filePath = providedFilePath || ""; debug(`Lint ${filePath}`); + /* * Verify. * `config.extractConfig(filePath)` requires an absolute path, but `linter` * doesn't know CWD, so it gives `linter` an absolute path always. */ - const filePathToVerify = filePath === "" ? path.join(cwd, filePath) : filePath; const { fixed, @@ -133628,7 +120012,6 @@ function verifyText(_ref) { filename: filePathToVerify, fix, reportUnusedDisableDirectives, - /** * Check if the linter should adopt a given code block or not. * @param {string} blockFilename The virtual filename of a code block. @@ -133637,26 +120020,24 @@ function verifyText(_ref) { filterCodeBlock(blockFilename) { return fileEnumerator.isTargetPath(blockFilename); } + }); - }); // Tweak and return. - + // Tweak and return. const result = { filePath, messages, suppressedMessages: linter.getSuppressedMessages(), ...calculateStatsPerFile(messages) }; - if (fixed) { result.output = output; } - if (result.errorCount + result.warningCount > 0 && typeof result.output === "undefined") { result.source = text; } - return result; } + /** * Returns result with warning by ignore settings * @param {string} filePath File path of checked code @@ -133664,13 +120045,10 @@ function verifyText(_ref) { * @returns {LintResult} Result with single warning * @private */ - - function createIgnoreResult(filePath, baseDir) { let message; const isHidden = filePath.split(path.sep).find(segment => /^\./u.test(segment)); const isInNodeModules = baseDir && path.relative(baseDir, filePath).startsWith("node_modules"); - if (isHidden) { message = "File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."; } else if (isInNodeModules) { @@ -133678,13 +120056,14 @@ function createIgnoreResult(filePath, baseDir) { } else { message = "File ignored because of a matching ignore pattern. Use \"--no-ignore\" to override."; } - return { filePath: path.resolve(filePath), messages: [{ + ruleId: null, fatal: false, severity: 1, - message + message, + nodeType: null }], suppressedMessages: [], errorCount: 0, @@ -133694,25 +120073,23 @@ function createIgnoreResult(filePath, baseDir) { fixableWarningCount: 0 }; } + /** * Get a rule. * @param {string} ruleId The rule ID to get. * @param {ConfigArray[]} configArrays The config arrays that have plugin rules. * @returns {Rule|null} The rule or null. */ - - function getRule(ruleId, configArrays) { for (const configArray of configArrays) { const rule = configArray.pluginRules.get(ruleId); - if (rule) { return rule; } } - return builtInRules.get(ruleId) || null; } + /** * Checks whether a message's rule type should be fixed. * @param {LintMessage} message The message to check. @@ -133720,50 +120097,47 @@ function getRule(ruleId, configArrays) { * @param {string[]} fixTypes An array of fix types to check. * @returns {boolean} Whether the message should be fixed. */ - - function shouldMessageBeFixed(message, lastConfigArrays, fixTypes) { if (!message.ruleId) { return fixTypes.has("directive"); } - const rule = message.ruleId && getRule(message.ruleId, lastConfigArrays); return Boolean(rule && rule.meta && fixTypes.has(rule.meta.type)); } + /** * Collect used deprecated rules. * @param {ConfigArray[]} usedConfigArrays The config arrays which were used. * @returns {IterableIterator} Used deprecated rules. */ - - function* iterateRuleDeprecationWarnings(usedConfigArrays) { - const processedRuleIds = new Set(); // Flatten used configs. + const processedRuleIds = new Set(); + // Flatten used configs. /** @type {ExtractedConfig[]} */ + const configs = usedConfigArrays.flatMap(getUsedExtractedConfigs); - const configs = usedConfigArrays.flatMap(getUsedExtractedConfigs); // Traverse rule configs. - + // Traverse rule configs. for (const config of configs) { for (const [ruleId, ruleConfig] of Object.entries(config.rules)) { // Skip if it was processed. if (processedRuleIds.has(ruleId)) { continue; } + processedRuleIds.add(ruleId); - processedRuleIds.add(ruleId); // Skip if it's not used. - + // Skip if it's not used. if (!ConfigOps.getRuleSeverity(ruleConfig)) { continue; } + const rule = getRule(ruleId, usedConfigArrays); - const rule = getRule(ruleId, usedConfigArrays); // Skip if it's not deprecated. - + // Skip if it's not deprecated. if (!(rule && rule.meta && rule.meta.deprecated)) { continue; - } // This rule was used and deprecated. - + } + // This rule was used and deprecated. yield { ruleId, replacedBy: rule.meta.replacedBy || [] @@ -133771,17 +120145,17 @@ function* iterateRuleDeprecationWarnings(usedConfigArrays) { } } } + /** * Checks if the given message is an error message. * @param {LintMessage} message The message to check. * @returns {boolean} Whether or not the message is an error message. * @private */ - - function isErrorMessage(message) { return message.severity === 2; } + /** * return the cacheFile to be used by eslint, based on whether the provided parameter is * a directory or looks like a directory (ends in `path.sep`), in which case the file @@ -133792,8 +120166,6 @@ function isErrorMessage(message) { * @param {string} cwd Current working directory * @returns {string} the resolved path to the cache file */ - - function getCacheFile(cacheFile, cwd) { /* * make sure the path separators are normalized for the environment/os @@ -133802,29 +120174,26 @@ function getCacheFile(cacheFile, cwd) { const normalizedCacheFile = path.normalize(cacheFile); const resolvedCacheFile = path.resolve(cwd, normalizedCacheFile); const looksLikeADirectory = normalizedCacheFile.slice(-1) === path.sep; + /** * return the name for the cache file in case the provided parameter is a directory * @returns {string} the resolved path to the cacheFile */ - function getCacheFileForDirectory() { return path.join(resolvedCacheFile, `.cache_${hash(cwd)}`); } - let fileStats; - try { fileStats = fs.lstatSync(resolvedCacheFile); } catch { fileStats = null; } + /* * in case the file exists we need to verify if the provided path * is a directory or a file. If it is a directory we want to create a file * inside that directory */ - - if (fileStats) { /* * is a directory or is a file, but the original file the user provided @@ -133833,25 +120202,25 @@ function getCacheFile(cacheFile, cwd) { */ if (fileStats.isDirectory() || looksLikeADirectory) { return getCacheFileForDirectory(); - } // is file so just use that file - + } + // is file so just use that file return resolvedCacheFile; } + /* * here we known the file or directory doesn't exist, * so we will try to infer if its a directory if it looks like a directory * for the current operating system. */ + // if the last character passed is a path separator we assume is a directory - - if (looksLikeADirectory) { return getCacheFileForDirectory(); } - return resolvedCacheFile; } + /** * Convert a string array to a boolean map. * @param {string[]|null} keys The keys to assign true. @@ -133860,34 +120229,27 @@ function getCacheFile(cacheFile, cwd) { * @throws {Error} Requires array. * @returns {Record} The boolean map. */ - - function toBooleanMap(keys, defaultValue, displayName) { if (keys && !Array.isArray(keys)) { throw new Error(`${displayName} must be an array.`); } - if (keys && keys.length > 0) { return keys.reduce((map, def) => { const [key, value] = def.split(":"); - if (key !== "__proto__") { map[key] = value === void 0 ? defaultValue : value === "true"; } - return map; }, {}); } - return void 0; } + /** * Create a config data from CLI options. * @param {CLIEngineOptions} options The options * @returns {ConfigData|null} The created config data. */ - - function createConfigDataFromOptions(options) { const { ignorePattern, @@ -133898,11 +120260,9 @@ function createConfigDataFromOptions(options) { } = options; const env = toBooleanMap(options.envs, true, "envs"); const globals = toBooleanMap(options.globals, false, "globals"); - if (env === void 0 && globals === void 0 && (ignorePattern === void 0 || ignorePattern.length === 0) && parser === void 0 && parserOptions === void 0 && plugins === void 0 && rules === void 0) { return null; } - return { env, globals, @@ -133913,14 +120273,13 @@ function createConfigDataFromOptions(options) { rules }; } + /** * Checks whether a directory exists at the given location * @param {string} resolvedPath A path from the CWD * @throws {Error} As thrown by `fs.statSync` or `fs.isDirectory`. * @returns {boolean} `true` if a directory exists */ - - function directoryExists(resolvedPath) { try { return fs.statSync(resolvedPath).isDirectory(); @@ -133928,18 +120287,17 @@ function directoryExists(resolvedPath) { if (error && (error.code === "ENOENT" || error.code === "ENOTDIR")) { return false; } - throw error; } -} //------------------------------------------------------------------------------ +} + +//------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ /** * Core CLI. */ - - class CLIEngine { /** * Creates a new instance of the core CLI engine. @@ -133954,19 +120312,15 @@ class CLIEngine { const options = Object.assign(Object.create(null), defaultOptions, { cwd: process.cwd() }, providedOptions); - if (options.fix === void 0) { options.fix = false; } - const additionalPluginPool = new Map(); - if (preloadedPlugins) { for (const [id, plugin] of Object.entries(preloadedPlugins)) { additionalPluginPool.set(id, plugin); } } - const cacheFilePath = getCacheFile(options.cacheLocation || options.cacheFile, options.cwd); const configArrayFactory = new CascadingConfigArrayFactory({ additionalPluginPool, @@ -133980,8 +120334,8 @@ class CLIEngine { useEslintrc: options.useEslintrc, builtInRules, loadRules, - getEslintRecommendedConfig: () => __webpack_require__(966), - getEslintAllConfig: () => __webpack_require__(967) + getEslintRecommendedConfig: () => (__webpack_require__(976).configs.recommended), + getEslintAllConfig: () => (__webpack_require__(976).configs.all) }); const fileEnumerator = new FileEnumerator({ configArrayFactory, @@ -133995,10 +120349,11 @@ class CLIEngine { const linter = new Linter({ cwd: options.cwd }); + /** @type {ConfigArray[]} */ + const lastConfigArrays = [configArrayFactory.getConfigArrayForFile()]; - const lastConfigArrays = [configArrayFactory.getConfigArrayForFile()]; // Store private data. - + // Store private data. internalSlotsMap.set(this, { additionalPluginPool, cacheFilePath, @@ -134009,48 +120364,48 @@ class CLIEngine { lintResultCache, linter, options - }); // setup special filter for fixes + }); + // setup special filter for fixes if (options.fix && options.fixTypes && options.fixTypes.length > 0) { - debug(`Using fix types ${options.fixTypes}`); // throw an error if any invalid fix types are found + debug(`Using fix types ${options.fixTypes}`); - validateFixTypes(options.fixTypes); // convert to Set for faster lookup + // throw an error if any invalid fix types are found + validateFixTypes(options.fixTypes); - const fixTypes = new Set(options.fixTypes); // save original value of options.fix in case it's a function + // convert to Set for faster lookup + const fixTypes = new Set(options.fixTypes); + // save original value of options.fix in case it's a function const originalFix = typeof options.fix === "function" ? options.fix : () => true; - options.fix = message => shouldMessageBeFixed(message, lastConfigArrays, fixTypes) && originalFix(message); } } - getRules() { const { lastConfigArrays } = internalSlotsMap.get(this); return new Map(function* () { yield* builtInRules; - for (const configArray of lastConfigArrays) { yield* configArray.pluginRules; } }()); } + /** * Returns results that only contains errors. * @param {LintResult[]} results The results to filter. * @returns {LintResult[]} The filtered results. */ - - static getErrorResults(results) { const filtered = []; results.forEach(result => { const filteredMessages = result.messages.filter(isErrorMessage); const filteredSuppressedMessages = result.suppressedMessages.filter(isErrorMessage); - if (filteredMessages.length > 0) { - filtered.push({ ...result, + filtered.push({ + ...result, messages: filteredMessages, suppressedMessages: filteredSuppressedMessages, errorCount: filteredMessages.length, @@ -134062,35 +120417,31 @@ class CLIEngine { }); return filtered; } + /** * Outputs fixes from the given results to files. * @param {LintReport} report The report object created by CLIEngine. * @returns {void} */ - - static outputFixes(report) { report.results.filter(result => Object.prototype.hasOwnProperty.call(result, "output")).forEach(result => { fs.writeFileSync(result.filePath, result.output); }); } + /** * Resolves the patterns passed into executeOnFiles() into glob-based patterns * for easier handling. * @param {string[]} patterns The file patterns passed on the command line. * @returns {string[]} The equivalent glob patterns. */ - - resolveFileGlobPatterns(patterns) { const { options } = internalSlotsMap.get(this); - if (options.globInputPaths === false) { return patterns.filter(Boolean); } - const extensions = (options.extensions || [".js"]).map(ext => ext.replace(/^\./u, "")); const dirSuffix = `/**/*.{${extensions.join(",")}}`; return patterns.filter(Boolean).map(pathname => { @@ -134099,14 +120450,13 @@ class CLIEngine { return path.normalize(newPath).replace(/\\/gu, "/"); }); } + /** * Executes the current configuration on an array of file and directory names. * @param {string[]} patterns An array of file and directory names. * @throws {Error} As may be thrown by `fs.unlinkSync`. * @returns {LintReport} The results for all files that were linted. */ - - executeOnFiles(patterns) { const { cacheFilePath, @@ -134123,23 +120473,26 @@ class CLIEngine { } } = internalSlotsMap.get(this); const results = []; - const startTime = Date.now(); // Clear the last used config arrays. + const startTime = Date.now(); - lastConfigArrays.length = 0; // Delete cache file; should this do here? + // Clear the last used config arrays. + lastConfigArrays.length = 0; + // Delete cache file; should this do here? if (!cache) { try { fs.unlinkSync(cacheFilePath); } catch (error) { - const errorCode = error && error.code; // Ignore errors when no such file exists or file system is read only (and cache file does not exist) + const errorCode = error && error.code; + // Ignore errors when no such file exists or file system is read only (and cache file does not exist) if (errorCode !== "ENOENT" && !(errorCode === "EROFS" && !fs.existsSync(cacheFilePath))) { throw error; } } - } // Iterate source code files. - + } + // Iterate source code files. for (const { config, filePath, @@ -134149,25 +120502,22 @@ class CLIEngine { results.push(createIgnoreResult(filePath, cwd)); continue; } + /* * Store used configs for: * - this method uses to collect used deprecated rules. * - `getRules()` method uses to collect all loaded rules. * - `--fix-type` option uses to get the loaded rule's meta data. */ - - if (!lastConfigArrays.includes(config)) { lastConfigArrays.push(config); - } // Skip if there is cached result. - + } + // Skip if there is cached result. if (lintResultCache) { const cachedResult = lintResultCache.getCachedLintResults(filePath, config); - if (cachedResult) { const hadMessages = cachedResult.messages && cachedResult.messages.length > 0; - if (hadMessages && fix) { debug(`Reprocessing cached file to allow autofix: ${filePath}`); } else { @@ -134176,9 +120526,9 @@ class CLIEngine { continue; } } - } // Do lint. - + } + // Do lint. const result = verifyText({ text: fs.readFileSync(filePath, "utf8"), filePath, @@ -134191,40 +120541,37 @@ class CLIEngine { linter }); results.push(result); + /* * Store the lint result in the LintResultCache. * NOTE: The LintResultCache will remove the file source and any * other properties that are difficult to serialize, and will * hydrate those properties back in on future lint runs. */ - if (lintResultCache) { lintResultCache.setCachedLintResults(filePath, config, result); } - } // Persist the cache to disk. - + } + // Persist the cache to disk. if (lintResultCache) { lintResultCache.reconcile(); } - debug(`Linting complete in: ${Date.now() - startTime}ms`); let usedDeprecatedRules; return { results, ...calculateStatsPerRun(results), - // Initialize it lazily because CLI and `ESLint` API don't use it. get usedDeprecatedRules() { if (!usedDeprecatedRules) { usedDeprecatedRules = Array.from(iterateRuleDeprecationWarnings(lastConfigArrays)); } - return usedDeprecatedRules; } - }; } + /** * Executes the current configuration on text. * @param {string} text A string of JavaScript code to lint. @@ -134232,8 +120579,6 @@ class CLIEngine { * @param {boolean} [warnIgnored] Always warn when a file is ignored * @returns {LintReport} The results for the linting. */ - - executeOnText(text, filename, warnIgnored) { const { configArrayFactory, @@ -134249,25 +120594,26 @@ class CLIEngine { } = internalSlotsMap.get(this); const results = []; const startTime = Date.now(); - const resolvedFilename = filename && path.resolve(cwd, filename); // Clear the last used config arrays. + const resolvedFilename = filename && path.resolve(cwd, filename); + // Clear the last used config arrays. lastConfigArrays.length = 0; - if (resolvedFilename && this.isPathIgnored(resolvedFilename)) { if (warnIgnored) { results.push(createIgnoreResult(resolvedFilename, cwd)); } } else { const config = configArrayFactory.getConfigArrayForFile(resolvedFilename || "__placeholder__.js"); + /* * Store used configs for: * - this method uses to collect used deprecated rules. * - `getRules()` method uses to collect all loaded rules. * - `--fix-type` option uses to get the loaded rule's meta data. */ + lastConfigArrays.push(config); - lastConfigArrays.push(config); // Do lint. - + // Do lint. results.push(verifyText({ text, filePath: resolvedFilename, @@ -134280,24 +120626,21 @@ class CLIEngine { linter })); } - debug(`Linting complete in: ${Date.now() - startTime}ms`); let usedDeprecatedRules; return { results, ...calculateStatsPerRun(results), - // Initialize it lazily because CLI and `ESLint` API don't use it. get usedDeprecatedRules() { if (!usedDeprecatedRules) { usedDeprecatedRules = Array.from(iterateRuleDeprecationWarnings(lastConfigArrays)); } - return usedDeprecatedRules; } - }; } + /** * 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 @@ -134306,30 +120649,25 @@ class CLIEngine { * @throws {Error} If filepath a directory path. * @returns {ConfigData} A configuration object for the file. */ - - getConfigForFile(filePath) { const { configArrayFactory, options } = internalSlotsMap.get(this); const absolutePath = path.resolve(options.cwd, filePath); - if (directoryExists(absolutePath)) { throw Object.assign(new Error("'filePath' should not be a directory path."), { messageTemplate: "print-config-with-directory-path" }); } - return configArrayFactory.getConfigArrayForFile(absolutePath).extractConfig(absolutePath).toCompatibleObjectAsConfigFileContent(); } + /** * Checks if a given path is ignored by ESLint. * @param {string} filePath The path of the file to check. * @returns {boolean} Whether or not the given path is ignored. */ - - isPathIgnored(filePath) { const { configArrayFactory, @@ -134340,15 +120678,14 @@ class CLIEngine { } } = internalSlotsMap.get(this); const absolutePath = path.resolve(cwd, filePath); - if (ignore) { const config = configArrayFactory.getConfigArrayForFile(absolutePath).extractConfig(absolutePath); const ignores = config.ignores || defaultIgnores; return ignores(absolutePath); } - return defaultIgnores(absolutePath); } + /** * Returns the formatter representing the given format or null if the `format` is not a string. * @param {string} [format] The name of the format to load or the path to a @@ -134356,20 +120693,20 @@ class CLIEngine { * @throws {any} As may be thrown by requiring of formatter * @returns {(FormatterFunction|null)} The formatter function or null if the `format` is not a string. */ - - getFormatter(format) { // default is stylish - const resolvedFormatName = format || "stylish"; // only strings are valid formatters + const resolvedFormatName = format || "stylish"; + // only strings are valid formatters if (typeof resolvedFormatName === "string") { // replace \ with / for Windows compatibility const normalizedFormatName = resolvedFormatName.replace(/\\/gu, "/"); const slots = internalSlotsMap.get(this); const cwd = slots ? slots.options.cwd : process.cwd(); const namespace = naming.getNamespaceFromTerm(normalizedFormatName); - let formatterPath; // if there's a slash, then it's a file (TODO: this check seems dubious for scoped npm packages) + let formatterPath; + // if there's a slash, then it's a file (TODO: this check seems dubious for scoped npm packages) if (!namespace && normalizedFormatName.includes("/")) { formatterPath = path.resolve(cwd, normalizedFormatName); } else { @@ -134380,30 +120717,25 @@ class CLIEngine { formatterPath = path.resolve(__dirname, "formatters", normalizedFormatName); } } - try { - return __webpack_require__(990)(formatterPath); + return __webpack_require__(1001)(formatterPath); } catch (ex) { if (format === "table" || format === "codeframe") { ex.message = `The ${format} formatter is no longer part of core ESLint. Install it manually with \`npm install -D eslint-formatter-${format}\``; } else { ex.message = `There was a problem loading formatter: ${formatterPath}\nError: ${ex.message}`; } - throw ex; } } else { return null; } } - } - CLIEngine.version = pkg.version; CLIEngine.getFormatter = CLIEngine.prototype.getFormatter; module.exports = { CLIEngine, - /** * Get the internal slots of a given CLIEngine instance for tests. * @param {CLIEngine} instance The CLIEngine instance to get. @@ -134412,11 +120744,10 @@ module.exports = { getCLIEngineInternalSlots(instance) { return internalSlotsMap.get(instance); } - }; /***/ }), -/* 973 */ +/* 984 */ /***/ ((module) => { "use strict"; @@ -134426,6 +120757,7 @@ module.exports = { */ + module.exports = { configFile: null, baseConfig: false, @@ -134437,7 +120769,6 @@ module.exports = { ignore: true, ignorePath: void 0, cache: false, - /* * in order to honor the cacheFile option if specified * this option should not have a default value otherwise @@ -134453,7 +120784,7 @@ module.exports = { }; /***/ }), -/* 974 */ +/* 985 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -134461,19 +120792,19 @@ module.exports = { Object.defineProperty(exports, "__esModule", ({ value: true })); -var debugOrig = __webpack_require__(566); -var fs = __webpack_require__(971); -var importFresh = __webpack_require__(975); -var Module = __webpack_require__(977); -var path = __webpack_require__(501); -var stripComments = __webpack_require__(981); -var assert = __webpack_require__(503); -var ignore = __webpack_require__(827); -var util = __webpack_require__(516); -var minimatch = __webpack_require__(953); -var Ajv = __webpack_require__(517); -var globals = __webpack_require__(563); -var os = __webpack_require__(982); +var debugOrig = __webpack_require__(589); +var fs = __webpack_require__(982); +var importFresh = __webpack_require__(986); +var Module = __webpack_require__(988); +var path = __webpack_require__(523); +var stripComments = __webpack_require__(992); +var assert = __webpack_require__(525); +var ignore = __webpack_require__(837); +var util = __webpack_require__(539); +var minimatch = __webpack_require__(963); +var Ajv = __webpack_require__(540); +var globals = __webpack_require__(586); +var os = __webpack_require__(993); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } @@ -136839,7 +123170,7 @@ var ModuleResolver = { * @author Toru Nagashima */ -const require$1 = Module.createRequire((__webpack_require__(983).pathToFileURL)(__filename).toString()); +const require$1 = Module.createRequire((__webpack_require__(994).pathToFileURL)(__filename).toString()); const debug$2 = debugOrig__default["default"]("eslintrc:config-array-factory"); @@ -138165,8 +124496,7 @@ class CascadingConfigArrayFactory { configArrayFactory, cwd, rulePaths, - loadRules, - resolver + loadRules }), baseConfigData, cliConfigArray: createCLIConfigArray({ @@ -138486,17 +124816,6 @@ function translateESLintRC(eslintrcConfig, { const languageOptionsKeysToCopy = ["globals", "parser", "parserOptions"]; const linterOptionsKeysToCopy = ["noInlineConfig", "reportUnusedDisableDirectives"]; - // check for special settings for eslint:all and eslint:recommended: - if (eslintrcConfig.settings) { - if (eslintrcConfig.settings["eslint:all"] === true) { - return ["eslint:all"]; - } - - if (eslintrcConfig.settings["eslint:recommended"] === true) { - return ["eslint:recommended"]; - } - } - // copy over simple translations for (const key of keysToCopy) { if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") { @@ -138648,15 +124967,31 @@ class FlatCompat { constructor({ baseDirectory = process.cwd(), - resolvePluginsRelativeTo = baseDirectory + resolvePluginsRelativeTo = baseDirectory, + recommendedConfig, + allConfig } = {}) { this.baseDirectory = baseDirectory; this.resolvePluginsRelativeTo = resolvePluginsRelativeTo; this[cafactory] = new ConfigArrayFactory({ cwd: baseDirectory, resolvePluginsRelativeTo, - getEslintAllConfig: () => ({ settings: { "eslint:all": true } }), - getEslintRecommendedConfig: () => ({ settings: { "eslint:recommended": true } }) + getEslintAllConfig: () => { + + if (!allConfig) { + throw new TypeError("Missing parameter 'allConfig' in FlatCompat constructor."); + } + + return allConfig; + }, + getEslintRecommendedConfig: () => { + + if (!recommendedConfig) { + throw new TypeError("Missing parameter 'recommendedConfig' in FlatCompat constructor."); + } + + return recommendedConfig; + } }); } @@ -138706,7 +125041,7 @@ class FlatCompat { /** * Translates the `env` section of an ESLintRC-style config. * @param {Object} envConfig The `env` section of an ESLintRC config. - * @returns {Object} A flag-config object representing the environments. + * @returns {Object[]} An array of flag-config objects representing the environments. */ env(envConfig) { return this.config({ @@ -138717,7 +125052,7 @@ class FlatCompat { /** * Translates the `extends` section of an ESLintRC-style config. * @param {...string} configsToExtend The names of the configs to load. - * @returns {Object} A flag-config object representing the config. + * @returns {Object[]} An array of flag-config objects representing the config. */ extends(...configsToExtend) { return this.config({ @@ -138728,7 +125063,7 @@ class FlatCompat { /** * Translates the `plugins` section of an ESLintRC-style config. * @param {...string} plugins The names of the plugins to load. - * @returns {Object} A flag-config object representing the plugins. + * @returns {Object[]} An array of flag-config objects representing the plugins. */ plugins(...plugins) { return this.config({ @@ -138771,67 +125106,56 @@ exports.Legacy = Legacy; /***/ }), -/* 975 */ +/* 986 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -const path = __webpack_require__(501); - -const resolveFrom = __webpack_require__(976); - -const parentModule = __webpack_require__(978); - +const path = __webpack_require__(523); +const resolveFrom = __webpack_require__(987); +const parentModule = __webpack_require__(989); module.exports = moduleId => { if (typeof moduleId !== 'string') { throw new TypeError('Expected a string'); } - const parentPath = parentModule(__filename); const cwd = parentPath ? path.dirname(parentPath) : __dirname; const filePath = resolveFrom(cwd, moduleId); - const oldModule = __webpack_require__.c[filePath]; // Delete itself from module parent - + const oldModule = __webpack_require__.c[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 __webpack_require__.c[filePath]; // Delete module from cache const parent = __webpack_require__.c[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 ? __webpack_require__(980)(filePath) : parent.require(filePath); // In case cache doesn't have parent, fall back to normal require + return parent === undefined ? __webpack_require__(991)(filePath) : parent.require(filePath); // In case cache doesn't have parent, fall back to normal require }; /***/ }), -/* 976 */ +/* 987 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -const path = __webpack_require__(501); - -const Module = __webpack_require__(977); - -const fs = __webpack_require__(971); - +const path = __webpack_require__(523); +const Module = __webpack_require__(988); +const fs = __webpack_require__(982); 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) { @@ -138843,15 +125167,12 @@ const resolveFrom = (fromDir, moduleId, silent) => { 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(); @@ -138859,58 +125180,49 @@ const resolveFrom = (fromDir, moduleId, silent) => { return null; } } - return resolveFileName(); }; - module.exports = (fromDir, moduleId) => resolveFrom(fromDir, moduleId); - module.exports.silent = (fromDir, moduleId) => resolveFrom(fromDir, moduleId, true); /***/ }), -/* 977 */ +/* 988 */ /***/ ((module) => { "use strict"; module.exports = require("module"); /***/ }), -/* 978 */ +/* 989 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -const callsites = __webpack_require__(979); - +const callsites = __webpack_require__(990); module.exports = filepath => { const stacks = callsites(); - if (!filepath) { return stacks[2].getFileName(); } + let seenVal = false; - let seenVal = false; // Skip the first stack as it's this function - + // 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 - + } + // Skip native modules if (parentFilepath === 'module.js') { continue; } - if (seenVal && parentFilepath !== filepath) { return parentFilepath; } @@ -138918,7 +125230,7 @@ module.exports = filepath => { }; /***/ }), -/* 979 */ +/* 990 */ /***/ ((module) => { "use strict"; @@ -138926,20 +125238,17 @@ module.exports = filepath => { const callsites = () => { const _prepareStackTrace = Error.prepareStackTrace; - Error.prepareStackTrace = (_, stack) => stack; - const stack = new Error().stack.slice(1); Error.prepareStackTrace = _prepareStackTrace; return stack; }; - -module.exports = callsites; // TODO: Remove this for the next major release - +module.exports = callsites; +// TODO: Remove this for the next major release module.exports["default"] = callsites; /***/ }), -/* 980 */ +/* 991 */ /***/ ((module) => { function webpackEmptyContext(req) { @@ -138949,11 +125258,11 @@ function webpackEmptyContext(req) { } webpackEmptyContext.keys = () => ([]); webpackEmptyContext.resolve = webpackEmptyContext; -webpackEmptyContext.id = 980; +webpackEmptyContext.id = 991; module.exports = webpackEmptyContext; /***/ }), -/* 981 */ +/* 992 */ /***/ ((module) => { "use strict"; @@ -138961,52 +125270,39 @@ module.exports = webpackEmptyContext; 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 = function (jsonString) { let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - 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; @@ -139036,26 +125332,25 @@ module.exports = function (jsonString) { continue; } } - return result + (insideComment ? strip(jsonString.slice(offset)) : jsonString.slice(offset)); }; /***/ }), -/* 982 */ +/* 993 */ /***/ ((module) => { "use strict"; module.exports = require("os"); /***/ }), -/* 983 */ +/* 994 */ /***/ ((module) => { "use strict"; module.exports = require("url"); /***/ }), -/* 984 */ +/* 995 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -139089,36 +125384,31 @@ module.exports = require("url"); * * @author Toru Nagashima */ - //------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ - -const fs = __webpack_require__(971); - -const path = __webpack_require__(501); - -const getGlobParent = __webpack_require__(985); - -const isGlob = __webpack_require__(986); - -const escapeRegExp = __webpack_require__(595); - +const fs = __webpack_require__(982); +const path = __webpack_require__(523); +const getGlobParent = __webpack_require__(996); +const isGlob = __webpack_require__(997); +const escapeRegExp = __webpack_require__(616); const { Minimatch -} = __webpack_require__(953); - +} = __webpack_require__(963); const { Legacy: { IgnorePattern, CascadingConfigArrayFactory } -} = __webpack_require__(974); +} = __webpack_require__(985); +const debug = __webpack_require__(589)("eslint:file-enumerator"); -const debug = __webpack_require__(566)("eslint:file-enumerator"); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - const minimatchOpts = { dot: true, matchBase: true @@ -139126,8 +125416,9 @@ const minimatchOpts = { const dotfilesPattern = /(?:(?:^\.)|(?:[/\\]\.))[^/\\.].*/u; const NONE = 0; const IGNORED_SILENTLY = 1; -const IGNORED = 2; // For VSCode intellisense +const IGNORED = 2; +// For VSCode intellisense /** @typedef {ReturnType} ConfigArray */ /** @@ -139168,17 +125459,17 @@ const IGNORED = 2; // For VSCode intellisense */ /** @type {WeakMap} */ - const internalSlotsMap = new WeakMap(); + /** * Check if a string is a glob pattern or not. * @param {string} pattern A glob pattern. * @returns {boolean} `true` if the string is a glob pattern. */ - function isGlobPattern(pattern) { return isGlob(path.sep === "\\" ? pattern.replace(/\\/gu, "/") : pattern); } + /** * Get stats of a given path. * @param {string} filePath The path to target file. @@ -139186,8 +125477,6 @@ function isGlobPattern(pattern) { * @returns {fs.Stats|null} The stats. * @private */ - - function statSafeSync(filePath) { try { return fs.statSync(filePath); @@ -139196,10 +125485,10 @@ function statSafeSync(filePath) { if (error.code !== "ENOENT") { throw error; } - return null; } } + /** * Get filenames in a given path to a directory. * @param {string} directoryPath The path to target directory. @@ -139207,8 +125496,6 @@ function statSafeSync(filePath) { * @returns {import("fs").Dirent[]} The filenames. * @private */ - - function readdirSafeSync(directoryPath) { try { return fs.readdirSync(directoryPath, { @@ -139219,30 +125506,26 @@ function readdirSafeSync(directoryPath) { if (error.code !== "ENOENT") { throw error; } - return []; } } + /** * Create a `RegExp` object to detect extensions. * @param {string[] | null} extensions The extensions to create. * @returns {RegExp | null} The created `RegExp` object or null. */ - - function createExtensionRegExp(extensions) { if (extensions) { const normalizedExts = extensions.map(ext => escapeRegExp(ext.startsWith(".") ? ext.slice(1) : ext)); return new RegExp(`.\\.(?:${normalizedExts.join("|")})$`, "u"); } - return null; } + /** * The error type when no files match a glob. */ - - class NoFilesFoundError extends Error { /** * @param {string} pattern The glob pattern which was not found. @@ -139256,13 +125539,11 @@ class NoFilesFoundError extends Error { globDisabled }; } - } + /** * The error type when there are files matched by a glob, but all of them have been ignored. */ - - class AllFilesIgnoredError extends Error { /** * @param {string} pattern The glob pattern which was not found. @@ -139274,14 +125555,12 @@ class AllFilesIgnoredError extends Error { pattern }; } - } + /** * This class provides the functionality that enumerates every file which is * matched by given glob patterns and that configuration. */ - - class FileEnumerator { /** * Initialize this enumerator. @@ -139292,8 +125571,8 @@ class FileEnumerator { cwd = process.cwd(), configArrayFactory = new CascadingConfigArrayFactory({ cwd, - getEslintRecommendedConfig: () => __webpack_require__(966), - getEslintAllConfig: () => __webpack_require__(967) + getEslintRecommendedConfig: () => (__webpack_require__(976).configs.recommended), + getEslintAllConfig: () => (__webpack_require__(976).configs.all) }), extensions = null, globInputPaths = true, @@ -139310,75 +125589,74 @@ class FileEnumerator { ignoreFlag: ignore }); } + /** * Check if a given file is target or not. * @param {string} filePath The path to a candidate file. * @param {ConfigArray} [providedConfig] Optional. The configuration for the file. * @returns {boolean} `true` if the file is a target. */ - - isTargetPath(filePath, providedConfig) { const { configArrayFactory, extensionRegExp - } = internalSlotsMap.get(this); // If `--ext` option is present, use it. + } = internalSlotsMap.get(this); + // If `--ext` option is present, use it. if (extensionRegExp) { return extensionRegExp.test(filePath); - } // `.js` file is target by default. - + } + // `.js` file is target by default. if (filePath.endsWith(".js")) { return true; - } // use `overrides[].files` to check additional targets. - + } + // use `overrides[].files` to check additional targets. const config = providedConfig || configArrayFactory.getConfigArrayForFile(filePath, { ignoreNotFoundError: true }); return config.isAdditionalTargetPath(filePath); } + /** * Iterate files which are matched by given glob patterns. * @param {string|string[]} patternOrPatterns The glob patterns to iterate files. * @throws {NoFilesFoundError|AllFilesIgnoredError} On an unmatched pattern. * @returns {IterableIterator} The found files. */ - - *iterateFiles(patternOrPatterns) { const { globInputPaths, errorOnUnmatchedPattern } = internalSlotsMap.get(this); const patterns = Array.isArray(patternOrPatterns) ? patternOrPatterns : [patternOrPatterns]; - debug("Start to iterate files: %o", patterns); // The set of paths to remove duplicate. + debug("Start to iterate files: %o", patterns); + // The set of paths to remove duplicate. const set = new Set(); - for (const pattern of patterns) { let foundRegardlessOfIgnored = false; - let found = false; // Skip empty string. + let found = false; + // Skip empty string. if (!pattern) { continue; - } // Iterate files of this pattern. - + } + // Iterate files of this pattern. for (const { config, filePath, flag } of this._iterateFiles(pattern)) { foundRegardlessOfIgnored = true; - if (flag === IGNORED_SILENTLY) { continue; } + found = true; - found = true; // Remove duplicate paths while yielding paths. - + // Remove duplicate paths while yielding paths. if (!set.has(filePath)) { set.add(filePath); yield { @@ -139387,29 +125665,26 @@ class FileEnumerator { ignored: flag === IGNORED }; } - } // Raise an error if any files were not found. - + } + // Raise an error if any files were not found. if (errorOnUnmatchedPattern) { if (!foundRegardlessOfIgnored) { throw new NoFilesFoundError(pattern, !globInputPaths && isGlob(pattern)); } - if (!found) { throw new AllFilesIgnoredError(pattern); } } } - debug(`Complete iterating files: ${JSON.stringify(patterns)}`); } + /** * Iterate files which are matched by a given glob pattern. * @param {string} pattern The glob pattern to iterate files. * @returns {IterableIterator} The found files. */ - - _iterateFiles(pattern) { const { cwd, @@ -139418,41 +125693,34 @@ class FileEnumerator { const absolutePath = path.resolve(cwd, pattern); const isDot = dotfilesPattern.test(pattern); const stat = statSafeSync(absolutePath); - if (stat && stat.isDirectory()) { return this._iterateFilesWithDirectory(absolutePath, isDot); } - if (stat && stat.isFile()) { return this._iterateFilesWithFile(absolutePath); } - if (globInputPaths && isGlobPattern(pattern)) { - return this._iterateFilesWithGlob(absolutePath, isDot); + return this._iterateFilesWithGlob(pattern, isDot); } - return []; } + /** * Iterate a file which is matched by a given path. * @param {string} filePath The path to the target file. * @returns {IterableIterator} The found files. * @private */ - - _iterateFilesWithFile(filePath) { debug(`File: ${filePath}`); const { configArrayFactory } = internalSlotsMap.get(this); const config = configArrayFactory.getConfigArrayForFile(filePath); - const ignored = this._isIgnoredFile(filePath, { config, direct: true }); - const flag = ignored ? IGNORED : NONE; return [{ config, @@ -139460,6 +125728,7 @@ class FileEnumerator { flag }]; } + /** * Iterate files in a given path. * @param {string} directoryPath The path to the target directory. @@ -139467,8 +125736,6 @@ class FileEnumerator { * @returns {IterableIterator} The found files. * @private */ - - _iterateFilesWithDirectory(directoryPath, dotfiles) { debug(`Directory: ${directoryPath}`); return this._iterateFilesRecursive(directoryPath, { @@ -139477,6 +125744,7 @@ class FileEnumerator { selector: null }); } + /** * Iterate files which are matched by a given glob pattern. * @param {string} pattern The glob pattern to iterate files. @@ -139484,19 +125752,21 @@ class FileEnumerator { * @returns {IterableIterator} The found files. * @private */ - - _iterateFilesWithGlob(pattern, dotfiles) { debug(`Glob: ${pattern}`); - const directoryPath = path.resolve(getGlobParent(pattern)); - const globPart = pattern.slice(directoryPath.length + 1); + const { + cwd + } = internalSlotsMap.get(this); + const directoryPath = path.resolve(cwd, getGlobParent(pattern)); + const absolutePath = path.resolve(cwd, pattern); + const globPart = absolutePath.slice(directoryPath.length + 1); + /* * recursive if there are `**` or path separators in the glob part. * Otherwise, patterns such as `src/*.js`, it doesn't need recursive. */ - const recursive = /\*\*|\/|\\/u.test(globPart); - const selector = new Minimatch(pattern, minimatchOpts); + const selector = new Minimatch(absolutePath, minimatchOpts); debug(`recursive? ${recursive}`); return this._iterateFilesRecursive(directoryPath, { dotfiles, @@ -139504,6 +125774,7 @@ class FileEnumerator { selector }); } + /** * Iterate files in a given path. * @param {string} directoryPath The path to the target directory. @@ -139514,26 +125785,24 @@ class FileEnumerator { * @returns {IterableIterator} The found files. * @private */ - - *_iterateFilesRecursive(directoryPath, options) { debug(`Enter the directory: ${directoryPath}`); const { configArrayFactory } = internalSlotsMap.get(this); + /** @type {ConfigArray|null} */ + let config = null; - let config = null; // Enumerate the files of this directory. - + // Enumerate the files of this directory. for (const entry of readdirSafeSync(directoryPath)) { const filePath = path.join(directoryPath, entry.name); const fileInfo = entry.isSymbolicLink() ? statSafeSync(filePath) : entry; - if (!fileInfo) { continue; - } // Check if the file is matched. - + } + // Check if the file is matched. if (fileInfo.isFile()) { if (!config) { config = configArrayFactory.getConfigArrayForFile(filePath, @@ -139546,16 +125815,18 @@ class FileEnumerator { ignoreNotFoundError: true }); } + const matched = options.selector - const matched = options.selector // Started with a glob pattern; choose by the pattern. - ? options.selector.match(filePath) // Started with a directory path; choose by file extensions. + // Started with a glob pattern; choose by the pattern. + ? options.selector.match(filePath) + + // Started with a directory path; choose by file extensions. : this.isTargetPath(filePath, config); - if (matched) { - const ignored = this._isIgnoredFile(filePath, { ...options, + const ignored = this._isIgnoredFile(filePath, { + ...options, config }); - const flag = ignored ? IGNORED_SILENTLY : NONE; debug(`Yield: ${entry.name}${ignored ? " but ignored" : ""}`); yield { @@ -139565,27 +125836,27 @@ class FileEnumerator { }; } else { debug(`Didn't match: ${entry.name}`); - } // Dive into the sub directory. + } + // Dive into the sub directory. } else if (options.recursive && fileInfo.isDirectory()) { if (!config) { config = configArrayFactory.getConfigArrayForFile(filePath, { ignoreNotFoundError: true }); } - - const ignored = this._isIgnoredFile(filePath + path.sep, { ...options, + const ignored = this._isIgnoredFile(filePath + path.sep, { + ...options, config }); - if (!ignored) { yield* this._iterateFilesRecursive(filePath, options); } } } - debug(`Leave the directory: ${directoryPath}`); } + /** * Check if a given file should be ignored. * @param {string} filePath The path to a file to check. @@ -139596,8 +125867,6 @@ class FileEnumerator { * @returns {boolean} `true` if the file should be ignored. * @private */ - - _isIgnoredFile(filePath, _ref) { let { config: providedConfig, @@ -139609,7 +125878,6 @@ class FileEnumerator { defaultIgnores, ignoreFlag } = internalSlotsMap.get(this); - if (ignoreFlag) { const config = providedConfig || configArrayFactory.getConfigArrayForFile(filePath, { ignoreNotFoundError: true @@ -139617,109 +125885,97 @@ class FileEnumerator { const ignores = config.extractConfig(filePath).ignores || defaultIgnores; return ignores(filePath, dotfiles); } - return !direct && defaultIgnores(filePath, dotfiles); } +} -} //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ - module.exports = { FileEnumerator }; /***/ }), -/* 985 */ +/* 996 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -var isGlob = __webpack_require__(986); - -var pathPosixDirname = (__webpack_require__(501).posix.dirname); - -var isWin32 = (__webpack_require__(982).platform)() === 'win32'; +var isGlob = __webpack_require__(997); +var pathPosixDirname = (__webpack_require__(523).posix.dirname); +var isWin32 = (__webpack_require__(993).platform)() === 'win32'; var slash = '/'; var backslash = /\\/g; 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 + }, 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 - + } + // special case for strings ending in enclosure containing path separator if (isEnclosure(str)) { str += slash; - } // preserves full path in case of trailing path separator + } + // preserves full path in case of trailing path separator + str += 'a'; - str += 'a'; // remove path parts that are globby - + // remove path parts that are globby do { str = pathPosixDirname(str); - } while (isGlobby(str)); // remove escape chars and return result - + } while (isGlobby(str)); + // remove escape chars and return result return str.replace(escaped, '$1'); }; - function isEnclosure(str) { var lastChar = str.slice(-1); var enclosureStart; - switch (lastChar) { case '}': enclosureStart = '{'; break; - case ']': enclosureStart = '['; break; - default: return false; } - var foundIndex = str.indexOf(enclosureStart); - if (foundIndex < 0) { return false; } - return str.slice(foundIndex + 1, -1).includes(slash); } - function isGlobby(str) { if (/\([^()]+$/.test(str)) { return true; } - if (str[0] === '{' || str[0] === '[') { return true; } - if (/[^\\][{[]/.test(str)) { return true; } - return isGlob(str); } /***/ }), -/* 986 */ +/* 997 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /*! @@ -139728,108 +125984,86 @@ function isGlobby(str) { * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ -var isExtglob = __webpack_require__(987); +var isExtglob = __webpack_require__(998); var chars = { '{': '}', '(': ')', '[': ']' }; - var strictCheck = function (str) { if (str[0] === '!') { return true; } - var index = 0; var pipeIndex = -2; var closeSquareIndex = -2; var closeCurlyIndex = -2; var closeParenIndex = -2; var backSlashIndex = -2; - while (index < str.length) { if (str[index] === '*') { return true; } - if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) { return true; } - if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') { if (closeSquareIndex < index) { closeSquareIndex = str.indexOf(']', index); } - if (closeSquareIndex > index) { if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { return true; } - backSlashIndex = str.indexOf('\\', index); - if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { return true; } } } - if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') { closeCurlyIndex = str.indexOf('}', index); - if (closeCurlyIndex > index) { backSlashIndex = str.indexOf('\\', index); - if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { return true; } } } - if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') { closeParenIndex = str.indexOf(')', index); - if (closeParenIndex > index) { backSlashIndex = str.indexOf('\\', index); - if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { return true; } } } - if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') { if (pipeIndex < index) { pipeIndex = str.indexOf('|', index); } - if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') { closeParenIndex = str.indexOf(')', pipeIndex); - if (closeParenIndex > pipeIndex) { backSlashIndex = str.indexOf('\\', pipeIndex); - if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { return true; } } } } - if (str[index] === '\\') { var open = str[index + 1]; index += 2; var close = chars[open]; - if (close) { var n = str.indexOf(close, index); - if (n !== -1) { index = n + 1; } } - if (str[index] === '!') { return true; } @@ -139837,35 +126071,27 @@ var strictCheck = function (str) { index++; } } - return false; }; - var relaxedCheck = function (str) { if (str[0] === '!') { return true; } - var index = 0; - while (index < str.length) { if (/[*?{}()[\]]/.test(str[index])) { return true; } - if (str[index] === '\\') { var open = str[index + 1]; index += 2; var close = chars[open]; - if (close) { var n = str.indexOf(close, index); - if (n !== -1) { index = n + 1; } } - if (str[index] === '!') { return true; } @@ -139873,30 +126099,26 @@ var relaxedCheck = function (str) { index++; } } - return false; }; - module.exports = function isGlob(str, options) { if (typeof str !== 'string' || str === '') { return false; } - if (isExtglob(str)) { return true; } + var check = strictCheck; - var check = strictCheck; // optionally relax check - + // optionally relax check if (options && options.strict === false) { check = relaxedCheck; } - return check(str); }; /***/ }), -/* 987 */ +/* 998 */ /***/ ((module) => { /*! @@ -139905,23 +126127,21 @@ module.exports = function isGlob(str, options) { * 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; }; /***/ }), -/* 988 */ +/* 999 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -139929,12 +126149,9 @@ module.exports = function isExtglob(str) { const { Linter -} = __webpack_require__(500); - -const interpolate = __webpack_require__(613); - -const SourceCodeFixer = __webpack_require__(947); - +} = __webpack_require__(522); +const interpolate = __webpack_require__(634); +const SourceCodeFixer = __webpack_require__(957); module.exports = { Linter, // For testers. @@ -139943,7 +126160,7 @@ module.exports = { }; /***/ }), -/* 989 */ +/* 1000 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -139951,14 +126168,17 @@ module.exports = { * @fileoverview Module for loading rules from files and directories. * @author Michael Ficarra */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const fs = __webpack_require__(982), + path = __webpack_require__(523); +const rulesDirCache = {}; -const fs = __webpack_require__(971), - path = __webpack_require__(501); - -const rulesDirCache = {}; //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ @@ -139968,28 +126188,26 @@ const rulesDirCache = {}; //---------------------------------------------------- * @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 + 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)] = __webpack_require__(990)(path.join(rulesDir, file)); + rules[file.slice(0, -3)] = __webpack_require__(1001)(path.join(rulesDir, file)); }); rulesDirCache[rulesDir] = rules; return rules; }; /***/ }), -/* 990 */ +/* 1001 */ /***/ ((module) => { function webpackEmptyContext(req) { @@ -139999,11 +126217,11 @@ function webpackEmptyContext(req) { } webpackEmptyContext.keys = () => ([]); webpackEmptyContext.resolve = webpackEmptyContext; -webpackEmptyContext.id = 990; +webpackEmptyContext.id = 1001; module.exports = webpackEmptyContext; /***/ }), -/* 991 */ +/* 1002 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -140011,13 +126229,18 @@ module.exports = webpackEmptyContext; * @fileoverview Defining the hashing function in one place. * @author Michael Ficarra */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ +const murmur = __webpack_require__(1003); -const murmur = __webpack_require__(992); //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ + //------------------------------------------------------------------------------ // Private //------------------------------------------------------------------------------ @@ -140027,19 +126250,18 @@ const murmur = __webpack_require__(992); //------------------------------------- * @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; /***/ }), -/* 992 */ +/* 1003 */ /***/ ((module) => { /** @@ -140054,60 +126276,51 @@ module.exports = hash; * @see http://sites.google.com/site/murmurhash/ */ (function () { - var cache; // Call this function without `new` to use the cached object (good for + 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 + // 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; @@ -140115,51 +126328,41 @@ module.exports = hash; 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 + }; + + // 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; @@ -140167,28 +126370,27 @@ module.exports = hash; h1 = h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000 & 0xffffffff; h1 ^= h1 >>> 16; return h1 >>> 0; - }; // Reset the hash object for reuse + }; + + // 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- + }; + + // 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 (true) { module.exports = MurmurHash3; } else {} })(); /***/ }), -/* 993 */ +/* 1004 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -140196,54 +126398,50 @@ module.exports = hash; * @fileoverview Utility for caching lint results. * @author Kevin Partington */ - //----------------------------------------------------------------------------- + + +//----------------------------------------------------------------------------- // Requirements //----------------------------------------------------------------------------- +const assert = __webpack_require__(525); +const fs = __webpack_require__(982); +const fileEntryCache = __webpack_require__(1005); +const stringify = __webpack_require__(1023); +const pkg = __webpack_require__(535); +const hash = __webpack_require__(1002); +const debug = __webpack_require__(589)("eslint:lint-result-cache"); -const assert = __webpack_require__(503); - -const fs = __webpack_require__(971); - -const fileEntryCache = __webpack_require__(994); - -const stringify = __webpack_require__(1012); - -const pkg = __webpack_require__(513); - -const hash = __webpack_require__(991); - -const debug = __webpack_require__(566)("eslint:lint-result-cache"); //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- // Helpers //----------------------------------------------------------------------------- - const configHashCache = new WeakMap(); const nodeVersion = process && process.version; const validCacheStrategies = ["metadata", "content"]; const invalidCacheStrategyErrorMessage = `Cache strategy must be one of: ${validCacheStrategies.map(strategy => `"${strategy}"`).join(", ")}`; + /** * Tests whether a provided cacheStrategy is valid * @param {string} cacheStrategy The cache strategy to use * @returns {boolean} true if `cacheStrategy` is one of `validCacheStrategies`; false otherwise */ - function isValidCacheStrategy(cacheStrategy) { return validCacheStrategies.includes(cacheStrategy); } + /** * 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 //----------------------------------------------------------------------------- @@ -140252,8 +126450,6 @@ function hashOfConfigFor(config) { * transparently removing properties that are difficult or expensive to * serialize and adding them back in on retrieval. */ - - class LintResultCache { /** * Creates a new LintResultCache instance. @@ -140270,6 +126466,7 @@ class LintResultCache { this.fileEntryCache = fileEntryCache.create(cacheFileLocation, void 0, useChecksum); this.cacheFileLocation = 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 @@ -140279,8 +126476,6 @@ class LintResultCache { * @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: @@ -140293,25 +126488,23 @@ class LintResultCache { const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath); const hashOfConfig = hashOfConfigFor(config); const changed = fileDescriptor.changed || fileDescriptor.meta.hashOfConfig !== hashOfConfig; - if (fileDescriptor.notFound) { debug(`File not found on the file system: ${filePath}`); return null; } - if (changed) { debug(`Cache entry not found or no longer valid: ${filePath}`); return null; - } // If source is present but null, need to reread the file from the filesystem. - + } + // If source is present but null, need to reread the file from the filesystem. if (fileDescriptor.meta.results && fileDescriptor.meta.results.source === null) { debug(`Rereading cached result source from filesystem: ${filePath}`); 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. @@ -140323,56 +126516,47 @@ class LintResultCache { * @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) { - debug(`Updating cached result: ${filePath}`); // Serialize the result, except that we want to remove the file source if present. + debug(`Updating cached result: ${filePath}`); + // 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() { debug(`Persisting cached results: ${this.cacheFileLocation}`); this.fileEntryCache.reconcile(); } - } - module.exports = LintResultCache; /***/ }), -/* 994 */ +/* 1005 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var path = __webpack_require__(501); - -var crypto = __webpack_require__(995); - +var path = __webpack_require__(523); +var crypto = __webpack_require__(1006); module.exports = { createFromFile: function (filePath, useChecksum) { var fname = path.basename(filePath); @@ -140380,16 +126564,13 @@ module.exports = { return this.create(fname, dir, useChecksum); }, create: function (cacheId, _path, useChecksum) { - var fs = __webpack_require__(971); - - var flatCache = __webpack_require__(996); - + var fs = __webpack_require__(982); + var flatCache = __webpack_require__(1007); var cache = flatCache.load(cacheId, _path); var normalizedEntries = {}; - var removeNotFoundFiles = function removeNotFoundFiles() { - const cachedEntries = cache.keys(); // remove not found entries - + const cachedEntries = cache.keys(); + // remove not found entries cachedEntries.forEach(function remover(fPath) { try { fs.statSync(fPath); @@ -140400,7 +126581,6 @@ module.exports = { } }); }; - removeNotFoundFiles(); return { /** @@ -140408,7 +126588,6 @@ module.exports = { * @type {Object} */ cache: cache, - /** * Given a buffer, calculate md5 hash of its content. * @method getHash @@ -140418,7 +126597,6 @@ module.exports = { getHash: function (buffer) { return crypto.createHash('md5').update(buffer).digest('hex'); }, - /** * Return whether or not a file has changed since last time reconcile was called. * @method hasFileChanged @@ -140428,7 +126606,6 @@ module.exports = { hasFileChanged: function (file) { return this.getFileDescriptor(file).changed; }, - /** * given an array of file paths it return and object with three arrays: * - changedFiles: Files that changed since previous run @@ -140451,19 +126628,16 @@ module.exports = { res.changedFiles.push(entry.key); return; } - if (entry.notFound) { res.notFoundFiles.push(entry.key); return; } - res.notChangedFiles.push(entry.key); }); return res; }, getFileDescriptor: function (file) { var fstat; - try { fstat = fs.statSync(file); } catch (ex) { @@ -140474,11 +126648,9 @@ module.exports = { err: ex }; } - if (useChecksum) { return this._getFileDescriptorUsingChecksum(file); } - return this._getFileDescriptorUsingMtimeAndSize(file, fstat); }, _getFileDescriptorUsingMtimeAndSize: function (file, fstat) { @@ -140488,7 +126660,6 @@ module.exports = { var cTime = fstat.mtime.getTime(); var isDifferentDate; var isDifferentSize; - if (!meta) { meta = { size: cSize, @@ -140498,7 +126669,6 @@ module.exports = { isDifferentDate = cTime !== meta.mtime; isDifferentSize = cSize !== meta.size; } - var nEntry = normalizedEntries[file] = { key: file, changed: !cacheExists || isDifferentDate || isDifferentSize, @@ -140510,16 +126680,13 @@ module.exports = { var meta = cache.getKey(file); var cacheExists = !!meta; var contentBuffer; - try { contentBuffer = fs.readFileSync(file); } catch (ex) { contentBuffer = ''; } - var isDifferent = true; var hash = this.getHash(contentBuffer); - if (!meta) { meta = { hash: hash @@ -140527,7 +126694,6 @@ module.exports = { } else { isDifferent = hash !== meta.hash; } - var nEntry = normalizedEntries[file] = { key: file, changed: !cacheExists || isDifferent, @@ -140535,7 +126701,6 @@ module.exports = { }; return nEntry; }, - /** * Return the list o the files that changed compared * against the ones stored in the cache @@ -140553,7 +126718,6 @@ module.exports = { return entry.key; }); }, - /** * return the list of files * @method normalizeEntries @@ -140565,11 +126729,11 @@ module.exports = { var me = this; var nEntries = files.map(function (file) { return me.getFileDescriptor(file); - }); //normalizeEntries = nEntries; + }); + //normalizeEntries = nEntries; return nEntries; }, - /** * Remove an entry from the file-entry-cache. Useful to force the file to still be considered * modified the next time the process is run @@ -140581,7 +126745,6 @@ module.exports = { delete normalizedEntries[entryName]; cache.removeKey(entryName); }, - /** * Delete the cache file from the disk * @method deleteCacheFile @@ -140589,7 +126752,6 @@ module.exports = { deleteCacheFile: function () { cache.removeCacheFile(); }, - /** * remove the cache from the file and clear the memory cache */ @@ -140616,7 +126778,6 @@ module.exports = { delete meta.hash; return meta; }, - /** * Sync the files and persist them to the cache * @method reconcile @@ -140626,15 +126787,12 @@ module.exports = { noPrune = typeof noPrune === 'undefined' ? true : noPrune; var entries = normalizedEntries; var keys = Object.keys(entries); - if (keys.length === 0) { return; } - var me = this; keys.forEach(function (entryName) { var cacheEntry = entries[entryName]; - try { var meta = useChecksum ? me._getMetaForFileUsingCheckSum(cacheEntry) : me._getMetaForFileUsingMtimeAndSize(cacheEntry); cache.setKey(entryName, meta); @@ -140653,24 +126811,20 @@ module.exports = { }; /***/ }), -/* 995 */ +/* 1006 */ /***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }), -/* 996 */ +/* 1007 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var path = __webpack_require__(501); - -var fs = __webpack_require__(971); - -var utils = __webpack_require__(997); - -var del = __webpack_require__(999); - +var path = __webpack_require__(523); +var fs = __webpack_require__(982); +var utils = __webpack_require__(1008); +var del = __webpack_require__(1010); var writeJSON = utils.writeJSON; var cache = { /** @@ -140687,12 +126841,10 @@ var cache = { me._visited = {}; me._persisted = {}; me._pathToFile = cacheDir ? path.resolve(cacheDir, docId) : path.resolve(__dirname, '../.cache/', docId); - if (fs.existsSync(me._pathToFile)) { me._persisted = utils.tryParse(me._pathToFile, {}); } }, - /** * Load the cache from the provided file * @method loadFile @@ -140704,7 +126856,6 @@ var cache = { var fName = path.basename(pathToFile); me.load(fName, dir); }, - /** * Returns the entire persisted object * @method all @@ -140716,7 +126867,6 @@ var cache = { keys: function () { return Object.keys(this._persisted); }, - /** * sets a key to a given value * @method setKey @@ -140727,7 +126877,6 @@ var cache = { this._visited[key] = true; this._persisted[key] = value; }, - /** * remove a given key from the cache * @method removeKey @@ -140735,7 +126884,6 @@ var cache = { */ removeKey: function (key) { delete this._visited[key]; // esfmt-ignore-line - delete this._persisted[key]; // esfmt-ignore-line }, @@ -140749,7 +126897,6 @@ var cache = { this._visited[key] = true; return this._persisted[key]; }, - /** * Remove keys that were not accessed/set since the * last time the `prune` method was called. @@ -140759,19 +126906,18 @@ var cache = { _prune: function () { var me = this; var obj = {}; - var keys = Object.keys(me._visited); // no keys visited for either get or set value + var keys = Object.keys(me._visited); + // no keys visited for either get or set value if (keys.length === 0) { return; } - keys.forEach(function (key) { obj[key] = me._persisted[key]; }); me._visited = {}; me._persisted = obj; }, - /** * Save the state of the cache identified by the docId to disk * as a JSON structure @@ -140783,7 +126929,6 @@ var cache = { !noPrune && me._prune(); writeJSON(me._pathToFile, me._persisted); }, - /** * remove the file where the cache is persisted * @method removeCacheFile @@ -140792,7 +126937,6 @@ var cache = { removeCacheFile: function () { return del(this._pathToFile); }, - /** * Destroy the file cache and cache content. * @method destroy @@ -140816,7 +126960,6 @@ module.exports = { load: function (docId, cacheDir) { return this.create(docId, cacheDir); }, - /** * Load a cache identified by the given Id. If the element does not exists, then initialize an empty * cache storage. @@ -140836,7 +126979,6 @@ module.exports = { obj.loadFile(filePath); return obj; }, - /** * Clear the cache identified by the given id. Caches stored in a different cache directory can be deleted directly * @@ -140849,7 +126991,6 @@ module.exports = { var filePath = cacheDir ? path.resolve(cacheDir, docId) : path.resolve(__dirname, '../.cache/', docId); return del(filePath); }, - /** * Remove all cache stored in the cache directory * @method clearAll @@ -140862,28 +127003,22 @@ module.exports = { }; /***/ }), -/* 997 */ +/* 1008 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var fs = __webpack_require__(971); - -var path = __webpack_require__(501); - -var flatted = __webpack_require__(998); - +var fs = __webpack_require__(982); +var path = __webpack_require__(523); +var flatted = __webpack_require__(1009); module.exports = { tryParse: function (filePath, defaultValue) { var result; - try { result = this.readJSON(filePath); } catch (ex) { result = defaultValue; } - return result; }, - /** * Read json file synchronously using flatted * @@ -140896,7 +127031,6 @@ module.exports = { encoding: 'utf8' })); }, - /** * Write json file synchronously using circular-json * @@ -140913,13 +127047,13 @@ module.exports = { }; /***/ }), -/* 998 */ +/* 1009 */ /***/ ((__unused_webpack_module, exports) => { "use strict"; -/*! (c) 2020 Andrea Giammarchi */ +/*! (c) 2020 Andrea Giammarchi */ const { parse: $parse, stringify: $stringify @@ -140928,30 +127062,22 @@ const { keys } = Object; const Primitive = String; // it could be Number - const primitive = 'string'; // it could be 'number' const ignore = {}; const object = 'object'; - const noop = (_, value) => value; - const primitives = value => value instanceof Primitive ? Primitive(value) : value; - const Primitives = (_, value) => typeof value === primitive ? new Primitive(value) : value; - const revive = (input, parsed, output, $) => { const lazy = []; - for (let ke = keys(output), { - length - } = ke, y = 0; y < length; y++) { + length + } = ke, y = 0; y < length; y++) { const k = ke[y]; const value = output[k]; - if (value instanceof Primitive) { const tmp = input[value]; - if (typeof tmp === object && !parsed.has(tmp)) { parsed.add(tmp); output[k] = ignore; @@ -140962,26 +127088,22 @@ const revive = (input, parsed, output, $) => { } else output[k] = $.call(output, k, tmp); } else if (output[k] !== ignore) output[k] = $.call(output, k, value); } - for (let { - length - } = lazy, i = 0; i < length; i++) { + length + } = lazy, i = 0; i < length; i++) { const { k, a } = lazy[i]; output[k] = $.call(output, k, revive.apply(null, a)); } - return output; }; - const set = (known, input, value) => { const index = Primitive(input.push(value) - 1); known.set(value, index); return index; }; - const parse = (text, reviver) => { const input = $parse(text, Primitives).map(primitives); const value = input[0]; @@ -140991,9 +127113,7 @@ const parse = (text, reviver) => { '': tmp }, '', tmp); }; - exports.parse = parse; - const stringify = (value, replacer, space) => { const $ = replacer && typeof replacer === object ? (k, v) => k === '' || -1 < replacer.indexOf(k) ? v : void 0 : replacer || noop; const known = new Map(); @@ -141003,52 +127123,38 @@ const stringify = (value, replacer, space) => { '': value }, '', value)); let firstRun = !i; - while (i < input.length) { firstRun = true; output[i] = $stringify(input[i++], replace, space); } - return '[' + output.join(',') + ']'; - function replace(key, value) { if (firstRun) { firstRun = !firstRun; return value; } - const after = $.call(this, key, value); - switch (typeof after) { case object: if (after === null) return after; - case primitive: return known.get(after) || set(known, input, after); } - return after; } }; - exports.stringify = stringify; - const toJSON = any => $parse(stringify(any)); - exports.toJSON = toJSON; - const fromJSON = any => parse($stringify(any)); - exports.fromJSON = fromJSON; /***/ }), -/* 999 */ +/* 1010 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var rimraf = (__webpack_require__(1000).sync); - -var fs = __webpack_require__(971); - +var rimraf = (__webpack_require__(1011).sync); +var fs = __webpack_require__(982); module.exports = function del(file) { if (fs.existsSync(file)) { //if rimraf doesn't throw then the file has been deleted or didn't exist @@ -141057,35 +127163,30 @@ module.exports = function del(file) { }); return true; } - return false; }; /***/ }), -/* 1000 */ +/* 1011 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -const assert = __webpack_require__(503); - -const path = __webpack_require__(501); - -const fs = __webpack_require__(971); - +const assert = __webpack_require__(525); +const path = __webpack_require__(523); +const fs = __webpack_require__(982); let glob = undefined; - try { - glob = __webpack_require__(1001); -} catch (_err) {// treat glob as optional. + glob = __webpack_require__(1012); +} catch (_err) { + // treat glob as optional. } - const defaultGlobOpts = { nosort: true, silent: true -}; // for EMFILE handling +}; +// for EMFILE handling let timeout = 0; const isWindows = process.platform === "win32"; - const defaults = options => { const methods = ['unlink', 'chmod', 'stat', 'lstat', 'rmdir', 'readdir']; methods.forEach(m => { @@ -141095,25 +127196,20 @@ const defaults = options => { }); options.maxBusyTries = options.maxBusyTries || 3; options.emfileWait = options.emfileWait || 1000; - if (options.glob === false) { options.disableGlob = true; } - if (options.disableGlob !== true && glob === undefined) { throw Error('glob dependency not found, set `options.disableGlob = true` if intentional'); } - options.disableGlob = options.disableGlob || false; options.glob = options.glob || defaultGlobOpts; }; - const 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'); @@ -141123,12 +127219,10 @@ const rimraf = (p, options, cb) => { let busyTries = 0; let errState = null; let n = 0; - const next = er => { errState = errState || er; if (--n === 0) cb(errState); }; - const afterGlob = (er, results) => { if (er) return cb(er); n = results.length; @@ -141137,34 +127231,33 @@ const rimraf = (p, options, cb) => { const CB = er => { if (er) { if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && busyTries < options.maxBusyTries) { - busyTries++; // try again, with the same exact callback as this one. - + busyTries++; + // try again, with the same exact callback as this one. return setTimeout(() => rimraf_(p, options, CB), busyTries * 100); - } // this one won't happen if graceful-fs is used. - + } + // this one won't happen if graceful-fs is used. if (er.code === "EMFILE" && timeout < options.emfileWait) { return setTimeout(() => rimraf_(p, options, CB), timeout++); - } // already gone - + } + // already gone if (er.code === "ENOENT") er = null; } - timeout = 0; next(er); }; - rimraf_(p, options, CB); }); }; - if (options.disableGlob || !glob.hasMagic(p)) return afterGlob(null, [p]); options.lstat(p, (er, stat) => { if (!er) return afterGlob(null, [p]); glob(p, options.glob, afterGlob); }); -}; // Two possible strategies. +}; + +// 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 // @@ -141175,17 +127268,17 @@ const rimraf = (p, options, cb) => { // // If anyone ever complains about this, then I guess the strategy could // be made configurable somehow. But until then, YAGNI. - - const rimraf_ = (p, options, cb) => { assert(p); assert(options); - assert(typeof cb === 'function'); // sunos lets the root user unlink directories, which is... weird. + 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, (er, st) => { - if (er && er.code === "ENOENT") return cb(null); // Windows can EPERM on stat. Life is suffering. + 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, er => { @@ -141194,12 +127287,10 @@ const rimraf_ = (p, options, cb) => { 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); }); }); }; - const fixWinEPERM = (p, options, er, cb) => { assert(p); assert(options); @@ -141210,40 +127301,34 @@ const fixWinEPERM = (p, options, er, cb) => { }); }); }; - const fixWinEPERMSync = (p, options, er) => { assert(p); assert(options); - try { options.chmodSync(p, 0o666); } catch (er2) { if (er2.code === "ENOENT") return;else throw er; } - let stats; - try { 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); }; - const rmdir = (p, options, originalEr, cb) => { assert(p); assert(options); - assert(typeof cb === 'function'); // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + 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, 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); }); }; - const rmkids = (p, options, cb) => { assert(p); assert(options); @@ -141261,11 +127346,11 @@ const rmkids = (p, options, cb) => { }); }); }); -}; // this looks simpler, and is strictly *faster*, but will +}; + +// this looks simpler, and is strictly *faster*, but will // tie up the JavaScript thread and fail on excessively // deep directory trees. - - const rimrafSync = (p, options) => { options = options || {}; defaults(options); @@ -141274,7 +127359,6 @@ const rimrafSync = (p, options) => { assert(options, 'rimraf: missing options'); assert.equal(typeof options, 'object', 'rimraf: options should be object'); let results; - if (options.disableGlob || !glob.hasMagic(p)) { results = [p]; } else { @@ -141285,21 +127369,18 @@ const rimrafSync = (p, options) => { results = glob.sync(p, options.glob); } } - if (!results.length) return; - for (let i = 0; i < results.length; i++) { const p = results[i]; let st; - try { st = options.lstatSync(p); } catch (er) { - if (er.code === "ENOENT") return; // Windows can EPERM on stat. Life is suffering. + 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); @@ -141311,11 +127392,9 @@ const rimrafSync = (p, options) => { } } }; - const rmdirSync = (p, options, originalEr) => { assert(p); assert(options); - try { options.rmdirSync(p); } catch (er) { @@ -141324,23 +127403,21 @@ const rmdirSync = (p, options, originalEr) => { if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") rmkidsSync(p, options); } }; - const rmkidsSync = (p, options) => { assert(p); assert(options); - options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)); // We only end up here once we got ENOTEMPTY at least once, and + options.readdirSync(p).forEach(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. - const retries = isWindows ? 100 : 1; let i = 0; - do { let threw = true; - try { const ret = options.rmdirSync(p, options); threw = false; @@ -141350,12 +127427,11 @@ const rmkidsSync = (p, options) => { } } while (true); }; - module.exports = rimraf; rimraf.sync = rimrafSync; /***/ }), -/* 1001 */ +/* 1012 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Approach: @@ -141397,72 +127473,50 @@ rimraf.sync = rimrafSync; // 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 rp = __webpack_require__(1002); - -var minimatch = __webpack_require__(953); - +var rp = __webpack_require__(1013); +var minimatch = __webpack_require__(963); var Minimatch = minimatch.Minimatch; - -var inherits = __webpack_require__(1004); - -var EE = (__webpack_require__(1005).EventEmitter); - -var path = __webpack_require__(501); - -var assert = __webpack_require__(503); - -var isAbsolute = __webpack_require__(1006); - -var globSync = __webpack_require__(1007); - -var common = __webpack_require__(1008); - +var inherits = __webpack_require__(1015); +var EE = (__webpack_require__(1016).EventEmitter); +var path = __webpack_require__(523); +var assert = __webpack_require__(525); +var isAbsolute = __webpack_require__(1017); +var globSync = __webpack_require__(1018); +var common = __webpack_require__(1019); var setopts = common.setopts; var ownProp = common.ownProp; - -var inflight = __webpack_require__(1009); - -var util = __webpack_require__(516); - +var inflight = __webpack_require__(1020); +var util = __webpack_require__(539); var childrenIgnored = common.childrenIgnored; var isIgnored = common.isIgnored; - -var once = __webpack_require__(1011); - +var once = __webpack_require__(1022); 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 +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; @@ -141470,39 +127524,34 @@ glob.hasMagic = function (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 + this._didRealPath = false; - var n = this.minimatch.set.length; // The matches are stored as {: true,...} so that + // 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); @@ -141510,7 +127559,6 @@ function Glob(pattern, options, cb) { cb(null, matches); }); } - var self = this; this._processing = 0; this._emitQueue = []; @@ -141519,16 +127567,12 @@ function Glob(pattern, options, cb) { 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 () { @@ -141540,7 +127584,6 @@ function Glob(pattern, options, cb) { } } } - Glob.prototype._finish = function () { assert(this instanceof Glob); if (this.aborted) return; @@ -141548,21 +127591,17 @@ Glob.prototype._finish = function () { 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(); @@ -141586,96 +127625,76 @@ Glob.prototype._realpathSet = function (index, 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) + } + + //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. + } + // 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, @@ -141683,9 +127702,9 @@ Glob.prototype._process = function (pattern, index, inGlobStar, cb) { prefix = pattern.slice(0, n).join('/'); break; } + var remain = pattern.slice(n); - var remain = pattern.slice(n); // get the list of entries. - + // get the list of entries. var read; if (prefix === null) read = '.';else if (isAbsolute(prefix) || isAbsolute(pattern.map(function (p) { return typeof p === 'string' ? p : '[*]'; @@ -141693,174 +127712,152 @@ Glob.prototype._process = function (pattern, index, inGlobStar, cb) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix; read = prefix; } else read = prefix; + var abs = this._makeAbs(read); - var abs = this._makeAbs(read); //if ignored, skip _processing - - + //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. + 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) + } + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) - var len = matchedEntries.length; // If there are no matched entries, then nothing matches. + var len = matchedEntries.length; + // If there are no matched entries, then nothing matches. + if (len === 0) return cb(); - if (len === 0) return cb(); // if this is the last remaining pattern bit, then no need for + // 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 - - + } + // This was the last one, and no stats were needed return cb(); - } // now test all matched entries as stand-ins for that part + } + + // 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.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) self.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. + 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 (!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; self.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 + 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]; @@ -141868,23 +127865,19 @@ Glob.prototype._readdirEntries = function (abs, entries, cb) { 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 + 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; @@ -141892,96 +127885,82 @@ Glob.prototype._readdirError = function (f, er, cb) { 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 + 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. + 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 + 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 + 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 + 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 (!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 { @@ -141989,44 +127968,41 @@ Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { if (trail) prefix += '/'; } } + if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/'); - if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/'); // Mark this as a match - + // Mark this as a match this._emitMatch(index, prefix); - cb(); -}; // Returns either 'DIR', 'FILE', or false - +}; +// 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 (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 (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) self.fs.lstat(abs, statcb); - function lstatcb_(er, lstat) { if (lstat && lstat.isSymbolicLink()) { // If it's a symlink, then treat it as the target, unless @@ -142039,13 +128015,11 @@ Glob.prototype._stat = function (f, 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); @@ -142057,7 +128031,7 @@ Glob.prototype._stat2 = function (f, abs, er, stat, cb) { }; /***/ }), -/* 1002 */ +/* 1013 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = realpath; @@ -142066,30 +128040,23 @@ realpath.sync = realpathSync; realpath.realpathSync = realpathSync; realpath.monkeypatch = monkeypatch; realpath.unmonkeypatch = unmonkeypatch; - -var fs = __webpack_require__(971); - +var fs = __webpack_require__(982); var origRealpath = fs.realpath; var origRealpathSync = fs.realpathSync; var version = process.version; var ok = /^v[0-5]\./.test(version); - -var old = __webpack_require__(1003); - +var old = __webpack_require__(1014); function newError(er) { return er && er.syscall === 'realpath' && (er.code === 'ELOOP' || er.code === 'ENOMEM' || er.code === 'ENAMETOOLONG'); } - function realpath(p, cache, cb) { if (ok) { return origRealpath(p, cache, cb); } - if (typeof cache === 'function') { cb = cache; cache = null; } - origRealpath(p, cache, function (er, result) { if (newError(er)) { old.realpath(p, cache, cb); @@ -142098,12 +128065,10 @@ function realpath(p, cache, cb) { } }); } - function realpathSync(p, cache) { if (ok) { return origRealpathSync(p, cache); } - try { return origRealpathSync(p, cache); } catch (er) { @@ -142114,19 +128079,17 @@ function realpathSync(p, cache) { } } } - function monkeypatch() { fs.realpath = realpath; fs.realpathSync = realpathSync; } - function unmonkeypatch() { fs.realpath = origRealpath; fs.realpathSync = origRealpathSync; } /***/ }), -/* 1003 */ +/* 1014 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { // Copyright Joyent, Inc. and other Node contributors. @@ -142149,27 +128112,23 @@ function unmonkeypatch() { // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -var pathModule = __webpack_require__(501); +var pathModule = __webpack_require__(523); var isWindows = process.platform === 'win32'; +var fs = __webpack_require__(982); -var fs = __webpack_require__(971); // JavaScript implementation of realpath, ported from node pre-v6 - +// JavaScript implementation of realpath, ported from node pre-v6 var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); - function rethrow() { // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and // is fairly slow to generate. var callback; - if (DEBUG) { var backtrace = new Error(); callback = debugCallback; } else callback = missingCallback; - return callback; - function debugCallback(err) { if (err) { backtrace.message = err.message; @@ -142177,7 +128136,6 @@ function rethrow() { missingCallback(err); } } - function missingCallback(err) { if (err) { if (process.throwDeprecation) throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs @@ -142188,65 +128146,62 @@ function rethrow() { } } } - function maybeCallback(cb) { return typeof cb === 'function' ? cb : rethrow(); } +var normalize = pathModule.normalize; -var normalize = pathModule.normalize; // Regexp that finds the next partion of a (partial) path +// Regexp that finds the next partion of a (partial) path // result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] - if (isWindows) { var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; } else { var nextPartRe = /(.*?)(?:[\/]+|$)/g; -} // Regex to find the device root, including trailing slash. E.g. 'c:\\'. - +} +// Regex to find the device root, including trailing slash. E.g. 'c:\\'. if (isWindows) { var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; } else { var splitRootRe = /^[\/]*/; } - exports.realpathSync = function realpathSync(p, cache) { // make p is absolute p = pathModule.resolve(p); - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { return cache[p]; } - var original = p, - seenLinks = {}, - knownHard = {}; // current character position in p - - var pos; // the partial path so far, including a trailing slash if any - - var current; // the partial path without a trailing slash (except when pointing at a root) - - var base; // the partial path scanned in the previous round, with slash + seenLinks = {}, + knownHard = {}; + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash var previous; start(); - function start() { // Skip over roots var m = splitRootRe.exec(p); pos = m[0].length; current = m[0]; base = m[0]; - previous = ''; // On windows, check that the root exists. On unix there is no need. + previous = ''; + // On windows, check that the root exists. On unix there is no need. if (isWindows && !knownHard[base]) { fs.lstatSync(base); knownHard[base] = true; } - } // walk down the path, swapping out linked pathparts for their real + } + + // walk down the path, swapping out linked pathparts for their real // values // NB: p.length changes. - - while (pos < p.length) { // find the next part nextPartRe.lastIndex = pos; @@ -142254,92 +128209,83 @@ exports.realpathSync = function realpathSync(p, cache) { previous = current; current += result[0]; base = previous + result[1]; - pos = nextPartRe.lastIndex; // continue if not a symlink + pos = nextPartRe.lastIndex; + // continue if not a symlink if (knownHard[base] || cache && cache[base] === base) { continue; } - var resolvedLink; - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { // some known symbolic link. no need to stat again. resolvedLink = cache[base]; } else { var stat = fs.lstatSync(base); - if (!stat.isSymbolicLink()) { knownHard[base] = true; if (cache) cache[base] = base; continue; - } // read the link if it wasn't read before + } + + // read the link if it wasn't read before // dev/ino always return 0 on windows, so skip the check. - - var linkTarget = null; - if (!isWindows) { var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { linkTarget = seenLinks[id]; } } - if (linkTarget === null) { fs.statSync(base); linkTarget = fs.readlinkSync(base); } - - resolvedLink = pathModule.resolve(previous, linkTarget); // track this, if given a cache. - + resolvedLink = pathModule.resolve(previous, linkTarget); + // track this, if given a cache. if (cache) cache[base] = resolvedLink; if (!isWindows) seenLinks[id] = linkTarget; - } // resolve the link, then start over - + } + // resolve the link, then start over p = pathModule.resolve(resolvedLink, p.slice(pos)); start(); } - if (cache) cache[original] = p; return p; }; - exports.realpath = function realpath(p, cache, cb) { if (typeof cb !== 'function') { cb = maybeCallback(cache); cache = null; - } // make p is absolute - + } + // make p is absolute p = pathModule.resolve(p); - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { return process.nextTick(cb.bind(null, null, cache[p])); } - var original = p, - seenLinks = {}, - knownHard = {}; // current character position in p - - var pos; // the partial path so far, including a trailing slash if any - - var current; // the partial path without a trailing slash (except when pointing at a root) - - var base; // the partial path scanned in the previous round, with slash + seenLinks = {}, + knownHard = {}; + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash var previous; start(); - function start() { // Skip over roots var m = splitRootRe.exec(p); pos = m[0].length; current = m[0]; base = m[0]; - previous = ''; // On windows, check that the root exists. On unix there is no need. + previous = ''; + // On windows, check that the root exists. On unix there is no need. if (isWindows && !knownHard[base]) { fs.lstat(base, function (err) { if (err) return cb(err); @@ -142349,57 +128295,54 @@ exports.realpath = function realpath(p, cache, cb) { } else { process.nextTick(LOOP); } - } // walk down the path, swapping out linked pathparts for their real + } + + // walk down the path, swapping out linked pathparts for their real // values - - function LOOP() { // stop if scanned past end of path if (pos >= p.length) { if (cache) cache[original] = p; return cb(null, p); - } // find the next part - + } + // find the next part nextPartRe.lastIndex = pos; var result = nextPartRe.exec(p); previous = current; current += result[0]; base = previous + result[1]; - pos = nextPartRe.lastIndex; // continue if not a symlink + pos = nextPartRe.lastIndex; + // continue if not a symlink if (knownHard[base] || cache && cache[base] === base) { return process.nextTick(LOOP); } - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { // known symbolic link. no need to stat again. return gotResolvedLink(cache[base]); } - return fs.lstat(base, gotStat); } - function gotStat(err, stat) { - if (err) return cb(err); // if not a symlink, skip to the next path part + if (err) return cb(err); + // if not a symlink, skip to the next path part if (!stat.isSymbolicLink()) { knownHard[base] = true; if (cache) cache[base] = base; return process.nextTick(LOOP); - } // stat & read the link if not read before + } + + // stat & read the link if not read before // call gotTarget as soon as the link target is known // dev/ino always return 0 on windows, so skip the check. - - if (!isWindows) { var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { return gotTarget(null, seenLinks[id], base); } } - fs.stat(base, function (err) { if (err) return cb(err); fs.readlink(base, function (err, target) { @@ -142408,14 +128351,12 @@ exports.realpath = function realpath(p, cache, cb) { }); }); } - function gotTarget(err, target, base) { if (err) return cb(err); var resolvedLink = pathModule.resolve(previous, target); if (cache) cache[base] = resolvedLink; gotResolvedLink(resolvedLink); } - function gotResolvedLink(resolvedLink) { // resolve the link, then start over p = pathModule.resolve(resolvedLink, p.slice(pos)); @@ -142424,7 +128365,7 @@ exports.realpath = function realpath(p, cache, cb) { }; /***/ }), -/* 1004 */ +/* 1015 */ /***/ ((module) => { if (typeof Object.create === 'function') { @@ -142447,9 +128388,7 @@ if (typeof Object.create === 'function') { 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; @@ -142458,14 +128397,14 @@ if (typeof Object.create === 'function') { } /***/ }), -/* 1005 */ +/* 1016 */ /***/ ((module) => { "use strict"; module.exports = require("events"); /***/ }), -/* 1006 */ +/* 1017 */ /***/ ((module) => { "use strict"; @@ -142474,56 +128413,43 @@ module.exports = require("events"); 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 + 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; /***/ }), -/* 1007 */ +/* 1018 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = globSync; globSync.GlobSync = GlobSync; - -var rp = __webpack_require__(1002); - -var minimatch = __webpack_require__(953); - +var rp = __webpack_require__(1013); +var minimatch = __webpack_require__(963); var Minimatch = minimatch.Minimatch; - -var Glob = (__webpack_require__(1001).Glob); - -var util = __webpack_require__(516); - -var path = __webpack_require__(501); - -var assert = __webpack_require__(503); - -var isAbsolute = __webpack_require__(1006); - -var common = __webpack_require__(1008); - +var Glob = (__webpack_require__(1012).Glob); +var util = __webpack_require__(539); +var path = __webpack_require__(523); +var assert = __webpack_require__(525); +var isAbsolute = __webpack_require__(1017); +var common = __webpack_require__(1019); 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'); @@ -142532,22 +128458,17 @@ function GlobSync(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.ok(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); @@ -142559,36 +128480,30 @@ GlobSync.prototype._finish = function () { } }); } - common.finish(this); }; - GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert.ok(this instanceof GlobSync); // Get the first [n] parts of pattern that are all strings. + assert.ok(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. + } + // 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, @@ -142596,9 +128511,9 @@ GlobSync.prototype._process = function (pattern, index, inGlobStar) { prefix = pattern.slice(0, n).join('/'); break; } + var remain = pattern.slice(n); - var remain = pattern.slice(n); // get the list of entries. - + // get the list of entries. var read; if (prefix === null) read = '.';else if (isAbsolute(prefix) || isAbsolute(pattern.map(function (p) { return typeof p === 'string' ? p : '[*]'; @@ -142606,107 +128521,88 @@ GlobSync.prototype._process = function (pattern, index, inGlobStar) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix; read = prefix; } else read = prefix; + var abs = this._makeAbs(read); - var abs = this._makeAbs(read); //if ignored, skip processing - - + //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! + var entries = this._readdir(abs, inGlobStar); + // if the abs isn't a dir, then nothing can match! + if (!entries) return; - if (!entries) return; // It will only match dot entries if it starts with a dot, or if + // 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; - 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 + // 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 - - + } + // This was the last one, and no stats were needed return; - } // now test all matched entries as stand-ins for that part + } + + // 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 @@ -142714,7 +128610,6 @@ GlobSync.prototype._readdirInGlobStar = function (abs) { var entries; var lstat; var stat; - try { lstat = this.fs.lstatSync(abs); } catch (er) { @@ -142723,34 +128618,29 @@ GlobSync.prototype._readdirInGlobStar = function (abs) { 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. + 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, this.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 @@ -142762,40 +128652,32 @@ GlobSync.prototype._readdirEntries = function (abs, entries) { this.cache[e] = true; } } + this.cache[abs] = entries; - this.cache[abs] = entries; // mark and cache dir-ness - + // 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; @@ -142804,52 +128686,47 @@ GlobSync.prototype._readdirError = function (f, 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 + 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; - - if (!entries) return; // test without the globstar, and with every child both below + // 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 + 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 + 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 + 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 (!this.matches[index]) this.matches[index] = Object.create(null); // If it doesn't exist, then just mark the lack of results - + // 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 { @@ -142857,34 +128734,33 @@ GlobSync.prototype._processSimple = function (prefix, index) { if (trail) prefix += '/'; } } + if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/'); - if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/'); // Mark this as a match - + // Mark this as a match this._emitMatch(index, prefix); -}; // Returns either 'DIR', 'FILE', or false - +}; +// 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 (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 (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 = this.fs.lstatSync(abs); } catch (er) { @@ -142893,7 +128769,6 @@ GlobSync.prototype._stat = function (f) { return false; } } - if (lstat && lstat.isSymbolicLink()) { try { stat = this.fs.statSync(abs); @@ -142904,7 +128779,6 @@ GlobSync.prototype._stat = function (f) { stat = lstat; } } - this.statCache[abs] = stat; var c = true; if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE'; @@ -142912,17 +128786,15 @@ GlobSync.prototype._stat = function (f) { 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); }; /***/ }), -/* 1008 */ +/* 1019 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { exports.setopts = setopts; @@ -142932,45 +128804,34 @@ exports.finish = finish; exports.mark = mark; exports.isIgnored = isIgnored; exports.childrenIgnored = childrenIgnored; - function ownProp(obj, field) { return Object.prototype.hasOwnProperty.call(obj, field); } - -var fs = __webpack_require__(971); - -var path = __webpack_require__(501); - -var minimatch = __webpack_require__(953); - -var isAbsolute = __webpack_require__(1006); - +var fs = __webpack_require__(982); +var path = __webpack_require__(523); +var minimatch = __webpack_require__(963); +var isAbsolute = __webpack_require__(1017); var Minimatch = minimatch.Minimatch; - function alphasort(a, b) { return a.localeCompare(b, 'en'); } - 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. - +} +// 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 @@ -142978,18 +128839,16 @@ function ignoreMap(pattern) { gmatcher: gmatcher }; } - function setopts(self, pattern, options) { - if (!options) options = {}; // base-matching: just use globstar for that. + 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; @@ -143022,29 +128881,28 @@ function setopts(self, pattern, options) { } 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') + 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. + 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; // always treat \ in patterns as escapes, not path separators - + options.nocomment = true; + // always treat \ in patterns as escapes, not path separators options.allowWindowsEscape = false; 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 @@ -143059,15 +128917,14 @@ function finish(self) { }); } } - if (!nou) all = Object.keys(all); - if (!self.nosort) all = all.sort(alphasort); // at *some* point we statted all of these + if (!self.nosort) all = all.sort(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); @@ -143077,37 +128934,31 @@ function finish(self) { }); } } - 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... - +} +// lotta situps... function makeAbs(self, f) { var abs = f; - if (f.charAt(0) === '/') { abs = path.join(self.root, f); } else if (isAbsolute(f) || f === '') { @@ -143117,20 +128968,18 @@ function makeAbs(self, 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. +} + +// 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) { @@ -143139,17 +128988,13 @@ function childrenIgnored(self, path) { } /***/ }), -/* 1009 */ +/* 1020 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var wrappy = __webpack_require__(1010); - +var wrappy = __webpack_require__(1021); var reqs = Object.create(null); - -var once = __webpack_require__(1011); - +var once = __webpack_require__(1022); module.exports = wrappy(inflight); - function inflight(key, cb) { if (reqs[key]) { reqs[key].push(cb); @@ -143159,18 +129004,18 @@ function inflight(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 + 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); @@ -143189,18 +129034,15 @@ function makeres(key) { } }); } - function slice(args) { var length = args.length; var array = []; - for (var i = 0; i < length; i++) array[i] = args[i]; - return array; } /***/ }), -/* 1010 */ +/* 1021 */ /***/ ((module) => { // Returns a wrapper function that returns a wrapped callback @@ -143209,7 +129051,6 @@ function slice(args) { // This makes sure that own properties are retained, so that // decorations and such are not lost along the way. module.exports = wrappy; - function wrappy(fn, cb) { if (fn && cb) return wrappy(fn)(cb); if (typeof fn !== 'function') throw new TypeError('need wrapper function'); @@ -143217,33 +129058,27 @@ function wrappy(fn, cb) { wrapper[k] = fn[k]; }); return wrapper; - function wrapper() { var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { args[i] = arguments[i]; } - var ret = fn.apply(this, args); var cb = args[args.length - 1]; - if (typeof ret === 'function' && ret !== cb) { Object.keys(cb).forEach(function (k) { ret[k] = cb[k]; }); } - return ret; } } /***/ }), -/* 1011 */ +/* 1022 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { -var wrappy = __webpack_require__(1010); - +var wrappy = __webpack_require__(1021); module.exports = wrappy(once); module.exports.strict = wrappy(onceStrict); once.proto = once(function () { @@ -143260,25 +129095,21 @@ once.proto = once(function () { configurable: true }); }); - function once(fn) { var f = function () { if (f.called) return f.value; f.called = true; return f.value = fn.apply(this, arguments); }; - f.called = false; return f; } - function onceStrict(fn) { var f = function () { if (f.called) throw new Error(f.onceError); f.called = true; return f.value = fn.apply(this, arguments); }; - var name = fn.name || 'Function wrapped with `once`'; f.onceError = name + " shouldn't be called more than once"; f.called = false; @@ -143286,7 +129117,7 @@ function onceStrict(fn) { } /***/ }), -/* 1012 */ +/* 1023 */ /***/ ((module) => { module.exports = function (obj, opts) { @@ -143297,11 +129128,9 @@ module.exports = function (obj, 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) { @@ -143317,44 +129146,34 @@ module.exports = function (obj, opts) { }; }; }(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); @@ -143363,7 +129182,6 @@ module.exports = function (obj, opts) { ; out.push(indent + space + keyValue); } - seen.splice(seen.indexOf(node), 1); return '{' + out.join(',') + indent + '}'; } @@ -143371,27 +129189,22 @@ module.exports = function (obj, opts) { '': 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; }; /***/ }), -/* 1013 */ +/* 1024 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -143399,33 +129212,26 @@ var objectKeys = Object.keys || function (obj) { * @fileoverview Main class using flat config * @author Nicholas C. Zakas */ - //------------------------------------------------------------------------------ + + + +//------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ + // Note: Node.js 12 does not support fs/promises. - -const fs = (__webpack_require__(971).promises); - -const path = __webpack_require__(501); - -const findUp = __webpack_require__(1014); - +const fs = (__webpack_require__(982).promises); +const path = __webpack_require__(523); +const findUp = __webpack_require__(1025); const { version -} = __webpack_require__(513); - +} = __webpack_require__(535); const { Linter -} = __webpack_require__(988); - +} = __webpack_require__(999); const { getRuleFromConfig -} = __webpack_require__(950); - -const { - gitignoreToMinimatch -} = __webpack_require__(1020); - +} = __webpack_require__(960); const { Legacy: { ConfigOps: { @@ -143434,10 +129240,8 @@ const { ModuleResolver, naming } -} = __webpack_require__(974); - +} = __webpack_require__(985); const { - fileExists, findFiles, getCacheFile, isNonEmptyString, @@ -143445,40 +129249,34 @@ const { createIgnoreResult, isErrorMessage, processOptions -} = __webpack_require__(1021); - +} = __webpack_require__(1031); const { pathToFileURL -} = __webpack_require__(983); - +} = __webpack_require__(994); const { FlatConfigArray -} = __webpack_require__(951); +} = __webpack_require__(961); +const LintResultCache = __webpack_require__(1004); -const LintResultCache = __webpack_require__(993); /* * This is necessary to allow overwriting writeFile for testing purposes. * We can just use fs/promises once we drop Node.js 12 support. */ + //------------------------------------------------------------------------------ // Typedefs //------------------------------------------------------------------------------ + // For VSCode IntelliSense - /** @typedef {import("../shared/types").ConfigData} ConfigData */ - /** @typedef {import("../shared/types").DeprecatedRuleInfo} DeprecatedRuleInfo */ - /** @typedef {import("../shared/types").LintMessage} LintMessage */ - +/** @typedef {import("../shared/types").LintResult} LintResult */ /** @typedef {import("../shared/types").ParserOptions} ParserOptions */ - /** @typedef {import("../shared/types").Plugin} Plugin */ - +/** @typedef {import("../shared/types").ResultsMeta} ResultsMeta */ /** @typedef {import("../shared/types").RuleConf} RuleConf */ - /** @typedef {import("../shared/types").Rule} Rule */ - /** @typedef {ReturnType} ExtractedConfig */ /** @@ -143494,9 +129292,8 @@ const LintResultCache = __webpack_require__(993); * @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 {string[]} [ignorePatterns] Ignore file patterns to use in addition to .eslintignore. + * @property {boolean} [ignore] False disables all ignore patterns except for the default ones. + * @property {string[]} [ignorePatterns] Ignore file patterns to use in addition to config ignores. These patterns are relative to `cwd`. * @property {ConfigData} [overrideConfig] Override config object, overrides all configs used with this instance * @property {boolean|string} [overrideConfigFile] Searches for default config file when falsy; * doesn't do any config file lookup when `true`; considered to be a config filename @@ -143504,44 +129301,39 @@ const LintResultCache = __webpack_require__(993); * @property {Record} [plugins] An array of plugin implementations. * @property {"error" | "warn" | "off"} [reportUnusedDisableDirectives] the severity to report unused eslint-disable directives. */ + //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ - const FLAT_CONFIG_FILENAME = "eslint.config.js"; - -const debug = __webpack_require__(566)("eslint:flat-eslint"); - +const debug = __webpack_require__(589)("eslint:flat-eslint"); const removedFormatters = new Set(["table", "codeframe"]); const privateMembers = new WeakMap(); +const importedConfigFileModificationTime = new Map(); + /** * It will calculate the error and warning count for collection of messages per file * @param {LintMessage[]} messages Collection of messages * @returns {Object} Contains the stats * @private */ - function calculateStatsPerFile(messages) { return messages.reduce((stat, message) => { if (message.fatal || message.severity === 2) { stat.errorCount++; - if (message.fatal) { stat.fatalErrorCount++; } - if (message.fix) { stat.fixableErrorCount++; } } else { stat.warningCount++; - if (message.fix) { stat.fixableWarningCount++; } } - return stat; }, { errorCount: 0, @@ -143551,14 +129343,13 @@ function calculateStatsPerFile(messages) { fixableWarningCount: 0 }); } + /** * It will calculate the error and warning count for collection of results from all files * @param {LintResult[]} results Collection of messages from all the files * @returns {Object} Contains the stats * @private */ - - function calculateStatsPerRun(results) { return results.reduce((stat, result) => { stat.errorCount += result.errorCount; @@ -143575,36 +129366,12 @@ function calculateStatsPerRun(results) { fixableWarningCount: 0 }); } -/** - * Loads global ignore patterns from an ignore file (usually .eslintignore). - * @param {string} filePath The filename to load. - * @returns {ignore} A function encapsulating the ignore patterns. - * @throws {Error} If the file cannot be read. - * @private - */ - -async function loadIgnoreFilePatterns(filePath) { - debug(`Loading ignore file: ${filePath}`); - - try { - const ignoreFileText = await fs.readFile(filePath, { - encoding: "utf8" - }); - return ignoreFileText.split(/\r?\n/gu).filter(line => line.trim() !== "" && !line.startsWith("#")); - } catch (e) { - debug(`Error reading ignore file: ${filePath}`); - e.message = `Cannot read ignore file: ${filePath}\nError: ${e.message}`; - throw e; - } -} /** * 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, _ref) => { let [id, rule] = _ref; @@ -143612,17 +129379,26 @@ function createRulesMeta(rules) { return retVal; }, {}); } + +/** + * Return the absolute path of a file named `"__placeholder__.js"` in a given directory. + * This is used as a replacement for a missing file path. + * @param {string} cwd An absolute directory path. + * @returns {string} The absolute path of a file named `"__placeholder__.js"` in the given directory. + */ +function getPlaceholderPath(cwd) { + return path.join(cwd, "__placeholder__.js"); +} + /** @type {WeakMap} */ - - const usedDeprecatedRulesCache = new WeakMap(); + /** * Create used deprecated rule list. * @param {CLIEngine} eslint The CLIEngine instance. * @param {string} maybeFilePath The absolute path to a lint target file or `""`. * @returns {DeprecatedRuleInfo[]} The used deprecated rule list. */ - function getOrFindUsedDeprecatedRules(eslint, maybeFilePath) { const { configs, @@ -143630,21 +129406,19 @@ function getOrFindUsedDeprecatedRules(eslint, maybeFilePath) { cwd } } = privateMembers.get(eslint); - const filePath = path.isAbsolute(maybeFilePath) ? maybeFilePath : path.join(cwd, "__placeholder__.js"); - const config = configs.getConfig(filePath); // Most files use the same config, so cache it. + const filePath = path.isAbsolute(maybeFilePath) ? maybeFilePath : getPlaceholderPath(cwd); + const config = configs.getConfig(filePath); + // Most files use the same config, so cache it. if (config && !usedDeprecatedRulesCache.has(config)) { const retv = []; - if (config.rules) { for (const [ruleId, ruleConf] of Object.entries(config.rules)) { if (getRuleSeverity(ruleConf) === 0) { continue; } - const rule = getRuleFromConfig(ruleId, config); const meta = rule && rule.meta; - if (meta && meta.deprecated) { retv.push({ ruleId, @@ -143653,12 +129427,11 @@ function getOrFindUsedDeprecatedRules(eslint, maybeFilePath) { } } } - usedDeprecatedRulesCache.set(config, Object.freeze(retv)); } - return config ? usedDeprecatedRulesCache.get(config) : Object.freeze([]); } + /** * Processes the linting results generated by a CLIEngine linting report to * match the ESLint class's API. @@ -143666,8 +129439,6 @@ function getOrFindUsedDeprecatedRules(eslint, maybeFilePath) { * @param {CLIEngineLintReport} report The CLIEngine linting report to process. * @returns {LintResult[]} The processed linting results. */ - - function processLintReport(eslint, _ref2) { let { results @@ -143675,198 +129446,206 @@ function processLintReport(eslint, _ref2) { const descriptor = { configurable: true, enumerable: true, - get() { return getOrFindUsedDeprecatedRules(eslint, 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; } + /** * Searches from the current working directory up until finding the * given flat config filename. * @param {string} cwd The current working directory to search from. - * @returns {Promise} The filename if found or `null` if not. + * @returns {Promise} The filename if found or `undefined` if not. */ - - function findFlatConfigFile(cwd) { return findUp(FLAT_CONFIG_FILENAME, { cwd }); } + /** * Load the config array from the given filename. * @param {string} filePath The filename to load from. - * @param {Object} options Options to help load the config file. - * @param {string} options.basePath The base path for the config array. - * @param {boolean} options.shouldIgnore Whether to honor ignore patterns. - * @returns {Promise} The config array loaded from the config file. + * @returns {Promise} The config loaded from the config file. */ - - -async function loadFlatConfigFile(filePath, _ref3) { - let { - basePath, - shouldIgnore - } = _ref3; +async function loadFlatConfigFile(filePath) { debug(`Loading config from ${filePath}`); const fileURL = pathToFileURL(filePath); debug(`Config file URL is ${fileURL}`); - const module = await __webpack_require__(1102)(fileURL); - return new FlatConfigArray(module.default, { - basePath, - shouldIgnore - }); + const mtime = (await fs.stat(filePath)).mtime.getTime(); + + /* + * Append a query with the config file's modification time (`mtime`) in order + * to import the current version of the config file. Without the query, `import()` would + * cache the config file module by the pathname only, and then always return + * the same version (the one that was actual when the module was imported for the first time). + * + * This ensures that the config file module is loaded and executed again + * if it has been changed since the last time it was imported. + * If it hasn't been changed, `import()` will just return the cached version. + * + * Note that we should not overuse queries (e.g., by appending the current time + * to always reload the config file module) as that could cause memory leaks + * because entries are never removed from the import cache. + */ + fileURL.searchParams.append("mtime", mtime); + + /* + * With queries, we can bypass the import cache. However, when import-ing a CJS module, + * Node.js uses the require infrastructure under the hood. That includes the require cache, + * which caches the config file module by its file path (queries have no effect). + * Therefore, we also need to clear the require cache before importing the config file module. + * In order to get the same behavior with ESM and CJS config files, in particular - to reload + * the config file only if it has been changed, we track file modification times and clear + * the require cache only if the file has been changed. + */ + if (importedConfigFileModificationTime.get(filePath) !== mtime) { + delete __webpack_require__.c[filePath]; + } + const config = (await __webpack_require__(1061)(fileURL)).default; + importedConfigFileModificationTime.set(filePath, mtime); + return config; } + /** - * Calculates the config array for this run based on inputs. - * @param {FlatESLint} eslint The instance to create the config array for. + * Determines which config file to use. This is determined by seeing if an + * override config file was passed, and if so, using it; otherwise, as long + * as override config file is not explicitly set to `false`, it will search + * upwards from the cwd for a file named `eslint.config.js`. * @param {import("./eslint").ESLintOptions} options The ESLint instance options. - * @returns {FlatConfigArray} The config array for `eslint``. + * @returns {{configFilePath:string|undefined,basePath:string,error:Error|null}} Location information for + * the config file. */ - - -async function calculateConfigArray(eslint, _ref4) { +async function locateConfigFileToUse(_ref3) { let { - cwd, - overrideConfig, configFile, - ignore: shouldIgnore, - ignorePath, - ignorePatterns - } = _ref4; - // check for cached instance - const slots = privateMembers.get(eslint); - - if (slots.configs) { - return slots.configs; - } // determine where to load config file from - - + cwd + } = _ref3; + // determine where to load config file from let configFilePath; let basePath = cwd; - + let error = null; if (typeof configFile === "string") { debug(`Override config file path is ${configFile}`); configFilePath = path.resolve(cwd, configFile); } else if (configFile !== false) { debug("Searching for eslint.config.js"); configFilePath = await findFlatConfigFile(cwd); - - if (!configFilePath) { - throw new Error("Could not find config file."); + if (configFilePath) { + basePath = path.resolve(path.dirname(configFilePath)); + } else { + error = new Error("Could not find config file."); } + } + return { + configFilePath, + basePath, + error + }; +} - basePath = path.resolve(path.dirname(configFilePath)); - } // load config array +/** + * Calculates the config array for this run based on inputs. + * @param {FlatESLint} eslint The instance to create the config array for. + * @param {import("./eslint").ESLintOptions} options The ESLint instance options. + * @returns {FlatConfigArray} The config array for `eslint``. + */ +async function calculateConfigArray(eslint, _ref4) { + let { + cwd, + baseConfig, + overrideConfig, + configFile, + ignore: shouldIgnore, + ignorePatterns + } = _ref4; + // check for cached instance + const slots = privateMembers.get(eslint); + if (slots.configs) { + return slots.configs; + } + const { + configFilePath, + basePath, + error + } = await locateConfigFileToUse({ + configFile, + cwd + }); + // config file is required to calculate config + if (error) { + throw error; + } + const configs = new FlatConfigArray(baseConfig || [], { + basePath, + shouldIgnore + }); - let configs; - + // load config file if (configFilePath) { - configs = await loadFlatConfigFile(configFilePath, { - basePath, - shouldIgnore - }); - } else { - configs = new FlatConfigArray([], { - basePath, - shouldIgnore - }); - } // add in any configured defaults - + const fileConfig = await loadFlatConfigFile(configFilePath); + if (Array.isArray(fileConfig)) { + configs.push(...fileConfig); + } else { + configs.push(fileConfig); + } + } + // add in any configured defaults configs.push(...slots.defaultConfigs); - let allIgnorePatterns = []; - let ignoreFilePath; // load ignore file if necessary - if (shouldIgnore) { - if (ignorePath) { - ignoreFilePath = path.resolve(cwd, ignorePath); - allIgnorePatterns = await loadIgnoreFilePatterns(ignoreFilePath); + // append command line ignore patterns + if (ignorePatterns && ignorePatterns.length > 0) { + let relativeIgnorePatterns; + + /* + * If the config file basePath is different than the cwd, then + * the ignore patterns won't work correctly. Here, we adjust the + * ignore pattern to include the correct relative path. Patterns + * passed as `ignorePatterns` are relative to the cwd, whereas + * the config file basePath can be an ancestor of the cwd. + */ + if (basePath === cwd) { + relativeIgnorePatterns = ignorePatterns; } else { - ignoreFilePath = path.resolve(cwd, ".eslintignore"); // no error if .eslintignore doesn't exist` - - if (fileExists(ignoreFilePath)) { - allIgnorePatterns = await loadIgnoreFilePatterns(ignoreFilePath); - } + const relativeIgnorePath = path.relative(basePath, cwd); + relativeIgnorePatterns = ignorePatterns.map(pattern => { + const negated = pattern.startsWith("!"); + const basePattern = negated ? pattern.slice(1) : pattern; + return (negated ? "!" : "") + path.posix.join(relativeIgnorePath, basePattern); + }); } - } // append command line ignore patterns - - if (ignorePatterns) { - if (typeof ignorePatterns === "string") { - allIgnorePatterns.push(ignorePatterns); - } else { - allIgnorePatterns.push(...ignorePatterns); - } - } - /* - * If the config file basePath is different than the cwd, then - * the ignore patterns won't work correctly. Here, we adjust the - * ignore pattern to include the correct relative path. Patterns - * loaded from ignore files are always relative to the cwd, whereas - * the config file basePath can be an ancestor of the cwd. - */ - - - if (basePath !== cwd && allIgnorePatterns.length) { - const relativeIgnorePath = path.relative(basePath, cwd); - allIgnorePatterns = allIgnorePatterns.map(pattern => { - const negated = pattern.startsWith("!"); - const basePattern = negated ? pattern.slice(1) : pattern; - /* - * Ignore patterns are considered relative to a directory - * when the pattern contains a slash in a position other - * than the last character. If that's the case, we need to - * add the relative ignore path to the current pattern to - * get the correct behavior. Otherwise, no change is needed. - */ - - if (!basePattern.includes("/") || basePattern.endsWith("/")) { - return pattern; - } - - return (negated ? "!" : "") + path.posix.join(relativeIgnorePath, basePattern); - }); - } - - if (allIgnorePatterns.length) { /* * Ignore patterns are added to the end of the config array * so they can override default ignores. */ configs.push({ - ignores: allIgnorePatterns.map(gitignoreToMinimatch) + ignores: relativeIgnorePatterns }); } - if (overrideConfig) { if (Array.isArray(overrideConfig)) { configs.push(...overrideConfig); @@ -143874,12 +129653,13 @@ async function calculateConfigArray(eslint, _ref4) { configs.push(overrideConfig); } } + await configs.normalize(); - await configs.normalize(); // cache the config array for this instance - + // cache the config array for this instance slots.configs = configs; return configs; } + /** * Processes an source code using ESLint. * @param {Object} config The config object. @@ -143894,8 +129674,6 @@ async function calculateConfigArray(eslint, _ref4) { * @returns {LintResult} The result of linting. * @private */ - - function verifyText(_ref5) { let { text, @@ -143909,13 +129687,13 @@ function verifyText(_ref5) { } = _ref5; const filePath = providedFilePath || ""; debug(`Lint ${filePath}`); + /* * Verify. * `config.extractConfig(filePath)` requires an absolute path, but `linter` * doesn't know CWD, so it gives `linter` an absolute path always. */ - - const filePathToVerify = filePath === "" ? path.join(cwd, "__placeholder__.js") : filePath; + const filePathToVerify = filePath === "" ? getPlaceholderPath(cwd) : filePath; const { fixed, messages, @@ -143925,7 +129703,6 @@ function verifyText(_ref5) { filename: filePathToVerify, fix, reportUnusedDisableDirectives, - /** * Check if the linter should adopt a given code block or not. * @param {string} blockFilename The virtual filename of a code block. @@ -143934,26 +129711,24 @@ function verifyText(_ref5) { filterCodeBlock(blockFilename) { return configs.isExplicitMatch(blockFilename); } + }); - }); // Tweak and return. - + // Tweak and return. const result = { filePath: filePath === "" ? filePath : path.resolve(filePath), messages, suppressedMessages: linter.getSuppressedMessages(), ...calculateStatsPerFile(messages) }; - if (fixed) { result.output = output; } - if (result.errorCount + result.warningCount > 0 && typeof result.output === "undefined") { result.source = text; } - return result; } + /** * Checks whether a message's rule type should be fixed. * @param {LintMessage} message The message to check. @@ -143961,61 +129736,64 @@ function verifyText(_ref5) { * @param {string[]} fixTypes An array of fix types to check. * @returns {boolean} Whether the message should be fixed. */ - - function shouldMessageBeFixed(message, config, fixTypes) { if (!message.ruleId) { return fixTypes.has("directive"); } - const rule = message.ruleId && getRuleFromConfig(message.ruleId, config); return Boolean(rule && rule.meta && fixTypes.has(rule.meta.type)); } + /** * Collect used deprecated rules. * @param {Array} configs The configs to evaluate. * @returns {IterableIterator} Used deprecated rules. */ - - function* iterateRuleDeprecationWarnings(configs) { const processedRuleIds = new Set(); - for (const config of configs) { for (const [ruleId, ruleConfig] of Object.entries(config.rules)) { // Skip if it was processed. if (processedRuleIds.has(ruleId)) { continue; } + processedRuleIds.add(ruleId); - processedRuleIds.add(ruleId); // Skip if it's not used. - + // Skip if it's not used. if (!getRuleSeverity(ruleConfig)) { continue; } + const rule = getRuleFromConfig(ruleId, config); - const rule = getRuleFromConfig(ruleId, config); // Skip if it's not deprecated. - + // Skip if it's not deprecated. if (!(rule && rule.meta && rule.meta.deprecated)) { continue; - } // This rule was used and deprecated. - + } + // This rule was used and deprecated. yield { ruleId, replacedBy: rule.meta.replacedBy || [] }; } } -} //----------------------------------------------------------------------------- +} + +/** + * Creates an error to be thrown when an array of results passed to `getRulesMetaForResults` was not created by the current engine. + * @returns {TypeError} An error object. + */ +function createExtraneousResultsError() { + return new TypeError("Results object was not created from this ESLint instance."); +} + +//----------------------------------------------------------------------------- // Main API //----------------------------------------------------------------------------- /** * Primary Node.js API for ESLint. */ - - class FlatESLint { /** * Creates a new instance of the main ESLint API. @@ -144040,67 +129818,60 @@ class FlatESLint { defaultIgnores: () => false, configs: null }); + /** * If additional plugins are passed in, add that to the default * configs for this instance. */ - if (options.plugins) { const plugins = {}; - for (const [pluginName, plugin] of Object.entries(options.plugins)) { plugins[naming.getShorthandName(pluginName, "eslint-plugin")] = plugin; } - defaultConfigs.push({ plugins }); } } + /** * 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 => fs.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) { const filtered = []; results.forEach(result => { const filteredMessages = result.messages.filter(isErrorMessage); const filteredSuppressedMessages = result.suppressedMessages.filter(isErrorMessage); - if (filteredMessages.length > 0) { - filtered.push({ ...result, + filtered.push({ + ...result, messages: filteredMessages, suppressedMessages: filteredSuppressedMessages, errorCount: filteredMessages.length, @@ -144112,6 +129883,7 @@ class FlatESLint { }); return filtered; } + /** * Returns meta objects for each rule represented in the lint results. * @param {LintResult[]} results The results to fetch rules meta for. @@ -144119,69 +129891,70 @@ class FlatESLint { * @throws {TypeError} When the results object wasn't created from this ESLint instance. * @throws {TypeError} When a plugin or rule is missing. */ - - getRulesMetaForResults(results) { - const resultRules = new Map(); // short-circuit simple case - + // short-circuit simple case if (results.length === 0) { - return resultRules; + return {}; } - + const resultRules = new Map(); const { - configs + configs, + options: { + cwd + } } = privateMembers.get(this); + /* * We can only accurately return rules meta information for linting results if the * results were created by this instance. Otherwise, the necessary rules data is * not available. So if the config array doesn't already exist, just throw an error * to let the user know we can't do anything here. */ - if (!configs) { - throw new TypeError("Results object was not created from this ESLint instance."); + throw createExtraneousResultsError(); } - for (const result of results) { /* * Normalize filename for . */ - const filePath = result.filePath === "" ? "__placeholder__.js" : result.filePath; - /* - * All of the plugin and rule information is contained within the - * calculated config for the given file. - */ - - const config = configs.getConfig(filePath); + const filePath = result.filePath === "" ? getPlaceholderPath(cwd) : result.filePath; const allMessages = result.messages.concat(result.suppressedMessages); - for (const { ruleId } of allMessages) { - const rule = getRuleFromConfig(ruleId, config); // ensure the rule exists + if (!ruleId) { + continue; + } + /* + * All of the plugin and rule information is contained within the + * calculated config for the given file. + */ + const config = configs.getConfig(filePath); + if (!config) { + throw createExtraneousResultsError(); + } + const rule = getRuleFromConfig(ruleId, config); + + // ensure the rule exists if (!rule) { throw new TypeError(`Could not find the rule "${ruleId}".`); } - resultRules.set(ruleId, rule); } } - return createRulesMeta(resultRules); } + /** * Executes the current configuration on an array of file and directory names. * @param {string|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 { cacheFilePath, lintResultCache, @@ -144201,22 +129974,22 @@ class FlatESLint { } = eslintOptions; const startTime = Date.now(); const usedConfigs = []; - const fixTypesSet = fixTypes ? new Set(fixTypes) : null; // Delete cache file; should this be done here? + const fixTypesSet = fixTypes ? new Set(fixTypes) : null; + // Delete cache file; should this be done here? if (!cache && cacheFilePath) { debug(`Deleting cache file at ${cacheFilePath}`); - try { await fs.unlink(cacheFilePath); } catch (error) { - const errorCode = error && error.code; // Ignore errors when no such file exists or file system is read only (and cache file does not exist) + const errorCode = error && error.code; + // Ignore errors when no such file exists or file system is read only (and cache file does not exist) if (errorCode !== "ENOENT" && !(errorCode === "EROFS" && !(await fs.exists(cacheFilePath)))) { throw error; } } } - const filePaths = await findFiles({ patterns: typeof patterns === "string" ? [patterns] : patterns, cwd, @@ -144225,19 +129998,18 @@ class FlatESLint { errorOnUnmatchedPattern }); debug(`${filePaths.length} files found in: ${Date.now() - startTime}ms`); + /* * Because we need to process multiple files, including reading from disk, * it is most efficient to start by reading each file via promises so that * they can be done in parallel. Then, we can lint the returned text. This * ensures we are waiting the minimum amount of time in between lints. */ - const results = await Promise.all(filePaths.map(_ref6 => { let { filePath, ignored } = _ref6; - /* * If a filename was entered that matches an ignore * pattern, then notify the user. @@ -144245,35 +130017,31 @@ class FlatESLint { if (ignored) { return createIgnoreResult(filePath, cwd); } - const config = configs.getConfig(filePath); + /* * Sometimes a file found through a glob pattern will * be ignored. In this case, `config` will be undefined * and we just silently ignore the file. */ - if (!config) { return void 0; } + /* * Store used configs for: * - this method uses to collect used deprecated rules. * - `--fix-type` option uses to get the loaded rule's meta data. */ - - if (!usedConfigs.includes(config)) { usedConfigs.push(config); - } // Skip if there is cached result. - + } + // Skip if there is cached result. if (lintResultCache) { const cachedResult = lintResultCache.getCachedLintResults(filePath, config); - if (cachedResult) { const hadMessages = cachedResult.messages && cachedResult.messages.length > 0; - if (hadMessages && fix) { debug(`Reprocessing cached file to allow autofix: ${filePath}`); } else { @@ -144281,18 +130049,15 @@ class FlatESLint { return cachedResult; } } - } // set up fixer for fixtypes if necessary - + } + // set up fixer for fixTypes if necessary let fixer = fix; - if (fix && fixTypesSet) { // save original value of options.fix in case it's a function const originalFix = typeof fix === "function" ? fix : () => true; - fixer = message => shouldMessageBeFixed(message, config, fixTypesSet) && originalFix(message); } - return fs.readFile(filePath, "utf8").then(text => { // do the linting const result = verifyText({ @@ -144305,42 +130070,39 @@ class FlatESLint { reportUnusedDisableDirectives, linter }); + /* * Store the lint result in the LintResultCache. * NOTE: The LintResultCache will remove the file source and any * other properties that are difficult to serialize, and will * hydrate those properties back in on future lint runs. */ - if (lintResultCache) { lintResultCache.setCachedLintResults(filePath, config, result); } - return result; }); - })); // Persist the cache to disk. + })); + // Persist the cache to disk. if (lintResultCache) { lintResultCache.reconcile(); } - let usedDeprecatedRules; const finalResults = results.filter(result => !!result); return processLintReport(this, { results: finalResults, ...calculateStatsPerRun(finalResults), - // Initialize it lazily because CLI and `ESLint` API don't use it. get usedDeprecatedRules() { if (!usedDeprecatedRules) { usedDeprecatedRules = Array.from(iterateRuleDeprecationWarnings(usedConfigs)); } - return usedDeprecatedRules; } - }); } + /** * Executes the current configuration on text. * @param {string} code A string of JavaScript code to lint. @@ -144349,20 +130111,18 @@ class FlatESLint { * @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) { let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - // Parameter validation + 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"); - } // Options validation + } + // Options validation const { filePath, @@ -144370,19 +130130,17 @@ class FlatESLint { ...unknownOptions } = options || {}; const unknownOptionKeys = Object.keys(unknownOptions); - if (unknownOptionKeys.length > 0) { throw new Error(`'options' must not include the unknown option(s): ${unknownOptionKeys.join(", ")}`); } - 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"); - } // Now we can get down to linting + } + // Now we can get down to linting const { linter, @@ -144398,16 +130156,18 @@ class FlatESLint { const results = []; const startTime = Date.now(); const resolvedFilename = path.resolve(cwd, filePath || "__placeholder__.js"); - let config; // Clear the last used config arrays. + let config; + // Clear the last used config arrays. if (resolvedFilename && (await this.isPathIgnored(resolvedFilename))) { if (warnIgnored) { results.push(createIgnoreResult(resolvedFilename, cwd)); } } else { // TODO: Needed? - config = configs.getConfig(resolvedFilename); // Do lint. + config = configs.getConfig(resolvedFilename); + // Do lint. results.push(verifyText({ text: code, filePath: resolvedFilename.endsWith("__placeholder__.js") ? "" : resolvedFilename, @@ -144419,31 +130179,28 @@ class FlatESLint { linter })); } - debug(`Linting complete in: ${Date.now() - startTime}ms`); let usedDeprecatedRules; return processLintReport(this, { results, ...calculateStatsPerRun(results), - // Initialize it lazily because CLI and `ESLint` API don't use it. get usedDeprecatedRules() { if (!usedDeprecatedRules) { usedDeprecatedRules = Array.from(iterateRuleDeprecationWarnings(config)); } - return usedDeprecatedRules; } - }); } + /** * Returns the formatter representing the given formatter name. * @param {string} [name] The name of the formatter to load. * The following values are allowed: * - `undefined` ... Load `stylish` builtin formatter. * - A builtin formatter name ... Load the builtin formatter. - * - A thirdparty formatter name: + * - A third-party formatter name: * - `foo` → `eslint-formatter-foo` * - `@foo` → `@foo/eslint-formatter` * - `@foo/bar` → `@foo/eslint-formatter-bar` @@ -144452,40 +130209,38 @@ class FlatESLint { * This promise will be rejected if the given formatter was not found or not * a function. */ - - async loadFormatter() { let name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "stylish"; - if (typeof name !== "string") { throw new Error("'name' must be a string"); - } // replace \ with / for Windows compatibility - + } + // replace \ with / for Windows compatibility const normalizedFormatName = name.replace(/\\/gu, "/"); - const namespace = naming.getNamespaceFromTerm(normalizedFormatName); // grab our options + const namespace = naming.getNamespaceFromTerm(normalizedFormatName); + // grab our options const { cwd } = privateMembers.get(this).options; - let formatterPath; // if there's a slash, then it's a file (TODO: this check seems dubious for scoped npm packages) + let formatterPath; + // if there's a slash, then it's a file (TODO: this check seems dubious for scoped npm packages) if (!namespace && normalizedFormatName.includes("/")) { formatterPath = path.resolve(cwd, normalizedFormatName); } else { try { - const npmFormat = naming.normalizePackageName(normalizedFormatName, "eslint-formatter"); // TODO: This is pretty dirty...would be nice to clean up at some point. + const npmFormat = naming.normalizePackageName(normalizedFormatName, "eslint-formatter"); - formatterPath = ModuleResolver.resolve(npmFormat, path.join(cwd, "__placeholder__.js")); + // TODO: This is pretty dirty...would be nice to clean up at some point. + formatterPath = ModuleResolver.resolve(npmFormat, getPlaceholderPath(cwd)); } catch { formatterPath = path.resolve(__dirname, "../", "cli-engine", "formatters", `${normalizedFormatName}.js`); } } - let formatter; - try { - formatter = (await __webpack_require__(1102)(pathToFileURL(formatterPath))).default; + formatter = (await __webpack_require__(1061)(pathToFileURL(formatterPath))).default; } catch (ex) { // check for formatters that have been removed if (removedFormatters.has(name)) { @@ -144493,40 +130248,36 @@ class FlatESLint { } else { ex.message = `There was a problem loading formatter: ${formatterPath}\nError: ${ex.message}`; } - throw ex; } - if (typeof formatter !== "function") { throw new TypeError(`Formatter must be a function, but got a ${typeof formatter}.`); } - const eslint = this; return { /** * The main formatter method. * @param {LintResults[]} results The lint results to format. + * @param {ResultsMeta} resultsMeta Warning count and max threshold. * @returns {string} The formatted lint results. */ - format(results) { + format(results, resultsMeta) { let rulesMeta = null; results.sort(compareResultsByFilePath); return formatter(results, { + ...resultsMeta, cwd, - get rulesMeta() { if (!rulesMeta) { rulesMeta = eslint.getRulesMetaForResults(results); } - 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 @@ -144535,55 +130286,80 @@ class FlatESLint { * @returns {Promise} A configuration object for the file * or `undefined` if there is no configuration data for the object. */ - - async calculateConfigForFile(filePath) { if (!isNonEmptyString(filePath)) { throw new Error("'filePath' must be a non-empty string"); } - const options = privateMembers.get(this).options; const absolutePath = path.resolve(options.cwd, filePath); const configs = await calculateConfigArray(this, options); return configs.getConfig(absolutePath); } + + /** + * Finds the config file being used by this instance based on the options + * passed to the constructor. + * @returns {string|undefined} The path to the config file being used or + * `undefined` if no config file is being used. + */ + async findConfigFile() { + const options = privateMembers.get(this).options; + const { + configFilePath + } = await locateConfigFileToUse(options); + return configFilePath; + } + /** * 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) { const config = await this.calculateConfigForFile(filePath); return config === void 0; } +} -} //------------------------------------------------------------------------------ +/** + * Returns whether flat config should be used. + * @returns {Promise} Whether flat config should be used. + */ +async function shouldUseFlatConfig() { + switch (process.env.ESLINT_USE_FLAT_CONFIG) { + case "true": + return true; + case "false": + return false; + default: + /* + * If neither explicitly enabled nor disabled, then use the presence + * of a flat config file to determine enablement. + */ + return !!(await findFlatConfigFile(process.cwd())); + } +} + +//------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ - module.exports = { FlatESLint, - findFlatConfigFile + shouldUseFlatConfig }; /***/ }), -/* 1014 */ +/* 1025 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -const path = __webpack_require__(501); - -const locatePath = __webpack_require__(1015); - -const pathExists = __webpack_require__(1019); - +const path = __webpack_require__(523); +const locatePath = __webpack_require__(1026); +const pathExists = __webpack_require__(1030); const stop = Symbol('findUp.stop'); - module.exports = async function (name) { let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; let directory = path.resolve(options.cwd || ''); @@ -144591,44 +130367,36 @@ module.exports = async function (name) { root } = path.parse(directory); const paths = [].concat(name); - const runMatcher = async locateOptions => { if (typeof name !== 'function') { return locatePath(paths, locateOptions); } - const foundPath = await name(locateOptions.cwd); - if (typeof foundPath === 'string') { return locatePath([foundPath], locateOptions); } - return foundPath; - }; // eslint-disable-next-line no-constant-condition - + }; + // eslint-disable-next-line no-constant-condition while (true) { // eslint-disable-next-line no-await-in-loop - const foundPath = await runMatcher({ ...options, + const foundPath = await runMatcher({ + ...options, cwd: directory }); - if (foundPath === stop) { return; } - if (foundPath) { return path.resolve(directory, foundPath); } - if (directory === root) { return; } - directory = path.dirname(directory); } }; - module.exports.sync = function (name) { let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; let directory = path.resolve(options.cwd || ''); @@ -144636,85 +130404,68 @@ module.exports.sync = function (name) { root } = path.parse(directory); const paths = [].concat(name); - const runMatcher = locateOptions => { if (typeof name !== 'function') { return locatePath.sync(paths, locateOptions); } - const foundPath = name(locateOptions.cwd); - if (typeof foundPath === 'string') { return locatePath.sync([foundPath], locateOptions); } - return foundPath; - }; // eslint-disable-next-line no-constant-condition - + }; + // eslint-disable-next-line no-constant-condition while (true) { - const foundPath = runMatcher({ ...options, + const foundPath = runMatcher({ + ...options, cwd: directory }); - if (foundPath === stop) { return; } - if (foundPath) { return path.resolve(directory, foundPath); } - if (directory === root) { return; } - directory = path.dirname(directory); } }; - module.exports.exists = pathExists; module.exports.sync.exists = pathExists.sync; module.exports.stop = stop; /***/ }), -/* 1015 */ +/* 1026 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -const path = __webpack_require__(501); - -const fs = __webpack_require__(971); - +const path = __webpack_require__(523); +const fs = __webpack_require__(982); const { promisify -} = __webpack_require__(516); - -const pLocate = __webpack_require__(1016); - +} = __webpack_require__(539); +const pLocate = __webpack_require__(1027); const fsStat = promisify(fs.stat); const fsLStat = promisify(fs.lstat); const typeMappings = { directory: 'isDirectory', file: 'isFile' }; - function checkType(_ref) { let { type } = _ref; - if (type in typeMappings) { return; } - throw new Error(`Invalid type specified: ${type}`); } - const matchType = (type, stat) => type === undefined || stat[typeMappings[type]](); - module.exports = async (paths, options) => { options = { cwd: process.cwd(), @@ -144733,7 +130484,6 @@ module.exports = async (paths, options) => { } }, options); }; - module.exports.sync = (paths, options) => { options = { cwd: process.cwd(), @@ -144743,11 +130493,9 @@ module.exports.sync = (paths, options) => { }; checkType(options); const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync; - for (const path_ of paths) { try { const stat = statFn(path.resolve(options.cwd, path_)); - if (matchType(options.type, stat)) { return path_; } @@ -144756,134 +130504,111 @@ module.exports.sync = (paths, options) => { }; /***/ }), -/* 1016 */ +/* 1027 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -const pLimit = __webpack_require__(1017); - +const pLimit = __webpack_require__(1028); class EndError extends Error { constructor(value) { super(); this.value = value; } +} -} // The input can also be a promise, so we await it - - -const testElement = async (element, tester) => tester(await element); // The input can also be a promise, so we `Promise.all()` them both - +// The input can also be a promise, so we await it +const testElement = async (element, tester) => tester(await element); +// The input can also be a promise, so we `Promise.all()` them both const finder = async element => { const values = await Promise.all(element); - if (values[1] === true) { throw new EndError(values[0]); } - return false; }; - const pLocate = async (iterable, tester, options) => { options = { concurrency: Infinity, preserveOrder: true, ...options }; - const limit = pLimit(options.concurrency); // Start all the promises concurrently with optional limit + const limit = pLimit(options.concurrency); - const items = [...iterable].map(element => [element, limit(testElement, element, tester)]); // Check the promises either serially or concurrently + // Start all the promises concurrently with optional limit + const items = [...iterable].map(element => [element, limit(testElement, element, tester)]); + // Check the promises either serially or concurrently const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity); - try { await Promise.all(items.map(element => checkLimit(finder, element))); } catch (error) { if (error instanceof EndError) { return error.value; } - throw error; } }; - module.exports = pLocate; /***/ }), -/* 1017 */ +/* 1028 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -const Queue = __webpack_require__(1018); - +const Queue = __webpack_require__(1029); const pLimit = concurrency => { if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { throw new TypeError('Expected `concurrency` to be a number from 1 and up'); } - const queue = new Queue(); let activeCount = 0; - const next = () => { activeCount--; - if (queue.size > 0) { queue.dequeue()(); } }; - const run = async function (fn, resolve) { for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { args[_key - 2] = arguments[_key]; } - activeCount++; - const result = (async () => fn(...args))(); - resolve(result); - try { await result; } catch {} - next(); }; - const enqueue = function (fn, resolve) { for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { args[_key2 - 2] = arguments[_key2]; } - queue.enqueue(run.bind(null, fn, resolve, ...args)); - (async () => { // This function needs to wait until the next microtask before comparing // `activeCount` to `concurrency`, because `activeCount` is updated asynchronously // when the run function is dequeued and called. The comparison in the if-statement // needs to happen asynchronously as well to get an up-to-date value for `activeCount`. await Promise.resolve(); - if (activeCount < concurrency && queue.size > 0) { queue.dequeue()(); } })(); }; - const generator = function (fn) { for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { args[_key3 - 1] = arguments[_key3]; } - return new Promise(resolve => { enqueue(fn, resolve, ...args); }); }; - Object.defineProperties(generator, { activeCount: { get: () => activeCount @@ -144899,36 +130624,34 @@ const pLimit = concurrency => { }); return generator; }; - module.exports = pLimit; /***/ }), -/* 1018 */ +/* 1029 */ /***/ ((module) => { class Node { /// value; /// next; - constructor(value) { - this.value = value; // TODO: Remove this when targeting Node.js 12. + constructor(value) { + this.value = value; + + // TODO: Remove this when targeting Node.js 12. this.next = undefined; } - } - class Queue { // TODO: Use private class fields when targeting Node.js 12. // #_head; // #_tail; // #_size; + constructor() { this.clear(); } - enqueue(value) { const node = new Node(value); - if (this._head) { this._tail.next = node; this._tail = node; @@ -144936,60 +130659,47 @@ class Queue { this._head = node; this._tail = node; } - this._size++; } - dequeue() { const current = this._head; - if (!current) { return; } - this._head = this._head.next; this._size--; return current.value; } - clear() { this._head = undefined; this._tail = undefined; this._size = 0; } - get size() { return this._size; } - *[Symbol.iterator]() { let current = this._head; - while (current) { yield current.value; current = current.next; } } - } - module.exports = Queue; /***/ }), -/* 1019 */ +/* 1030 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -const fs = __webpack_require__(971); - +const fs = __webpack_require__(982); const { promisify -} = __webpack_require__(516); - +} = __webpack_require__(539); const pAccess = promisify(fs.access); - module.exports = async path => { try { await pAccess(path); @@ -144998,7 +130708,6 @@ module.exports = async path => { return false; } }; - module.exports.sync = path => { try { fs.accessSync(path); @@ -145009,85 +130718,7 @@ module.exports.sync = path => { }; /***/ }), -/* 1020 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -/** - * @fileoverview Utility to convert gitignore patterns to minimatch. - * @author Nicholas C. Zakas - */ - -/** - * Converts a gitignore pattern to a minimatch pattern. - * @param {string} pattern The gitignore pattern to convert. - * @returns {string} A minimatch pattern equivalent to `pattern`. - */ -function gitignoreToMinimatch(pattern) { - - if (typeof pattern !== "string") { - throw new TypeError("Argument must be a string."); - } - - // Special case: Empty string - if (!pattern) { - return pattern; - } - - // strip off negation to make life easier - const negated = pattern.startsWith("!"); - let patternToTest = negated ? pattern.slice(1) : pattern; - let result = patternToTest; - let leadingSlash = false; - - // strip off leading slash - if (patternToTest[0] === "/") { - leadingSlash = true; - result = patternToTest.slice(1); - } - - // For the most part, the first character determines what to do - switch (result[0]) { - - case "*": - if (patternToTest[1] !== "*") { - result = "**/" + result; - } - break; - - default: - if (!leadingSlash && !result.includes("/") || result.endsWith("/")) { - result = "**/" + result; - } - - // no further changes if the pattern ends with a wildcard - if (result.endsWith("*") || result.endsWith("?")) { - break; - } - - // differentiate between filenames and directory names - if (!/\.[a-z\d_-]+$/.test(result)) { - if (!result.endsWith("/")) { - result += "/"; - } - - result += "**"; - } - } - - return negated ? "!" + result : result; - -} - -exports.gitignoreToMinimatch = gitignoreToMinimatch; - - -/***/ }), -/* 1021 */ +/* 1031 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; @@ -145095,31 +130726,51 @@ exports.gitignoreToMinimatch = gitignoreToMinimatch; * @fileoverview Helper functions for ESLint class * @author Nicholas C. Zakas */ - //----------------------------------------------------------------------------- + + + +//----------------------------------------------------------------------------- // Requirements //----------------------------------------------------------------------------- - -const path = __webpack_require__(501); - -const fs = __webpack_require__(971); - +const path = __webpack_require__(523); +const fs = __webpack_require__(982); const fsp = fs.promises; +const isGlob = __webpack_require__(997); +const hash = __webpack_require__(1002); +const minimatch = __webpack_require__(963); +const util = __webpack_require__(539); +const fswalk = __webpack_require__(1032); +const globParent = __webpack_require__(996); +const isPathInside = __webpack_require__(1060); -const isGlob = __webpack_require__(986); +//----------------------------------------------------------------------------- +// Fixup references +//----------------------------------------------------------------------------- -const globby = __webpack_require__(1022); +const doFsWalk = util.promisify(fswalk.walk); +const Minimatch = minimatch.Minimatch; +const MINIMATCH_OPTIONS = { + dot: true +}; -const hash = __webpack_require__(991); +//----------------------------------------------------------------------------- +// Types +//----------------------------------------------------------------------------- -const minimatch = __webpack_require__(953); //----------------------------------------------------------------------------- +/** + * @typedef {Object} GlobSearch + * @property {Array} patterns The normalized patterns to use for a search. + * @property {Array} rawPatterns The patterns as entered by the user + * before doing any normalization. + */ + +//----------------------------------------------------------------------------- // Errors //----------------------------------------------------------------------------- /** * The error type when no files match a glob. */ - - class NoFilesFoundError extends Error { /** * @param {string} pattern The glob pattern which was not found. @@ -145133,13 +130784,40 @@ class NoFilesFoundError extends Error { globDisabled: !globEnabled }; } - } + +/** + * The error type when a search fails to match multiple patterns. + */ +class UnmatchedSearchPatternsError extends Error { + /** + * @param {Object} options The options for the error. + * @param {string} options.basePath The directory that was searched. + * @param {Array} options.unmatchedPatterns The glob patterns + * which were not found. + * @param {Array} options.patterns The glob patterns that were + * searched. + * @param {Array} options.rawPatterns The raw glob patterns that + * were searched. + */ + constructor(_ref) { + let { + basePath, + unmatchedPatterns, + patterns, + rawPatterns + } = _ref; + super(`No files matching '${rawPatterns}' in '${basePath}' were found.`); + this.basePath = basePath; + this.unmatchedPatterns = unmatchedPatterns; + this.patterns = patterns; + this.rawPatterns = rawPatterns; + } +} + /** * The error type when there are files matched by a glob, but all of them have been ignored. */ - - class AllFilesIgnoredError extends Error { /** * @param {string} pattern The glob pattern which was not found. @@ -145151,8 +130829,9 @@ class AllFilesIgnoredError extends Error { pattern }; } +} -} //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- // General Helpers //----------------------------------------------------------------------------- @@ -145161,21 +130840,20 @@ class AllFilesIgnoredError extends Error { * @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. + * Check if a given value is an array of non-empty strings or not. * @param {any} x The value to check. - * @returns {boolean} `true` if `x` is an array of non-empty stringss. + * @returns {boolean} `true` if `x` is an array of non-empty strings. */ - - function isArrayOfNonEmptyString(x) { return Array.isArray(x) && x.every(isNonEmptyString); -} //----------------------------------------------------------------------------- +} + +//----------------------------------------------------------------------------- // File-related Helpers //----------------------------------------------------------------------------- @@ -145184,21 +130862,307 @@ function isArrayOfNonEmptyString(x) { * @param {string} pattern The pattern to replace slashes in. * @returns {string} The pattern with slashes normalized. */ - - function normalizeToPosix(pattern) { return pattern.replace(/\\/gu, "/"); } + /** * Check if a string is a glob pattern or not. * @param {string} pattern A glob pattern. * @returns {boolean} `true` if the string is a glob pattern. */ - - function isGlobPattern(pattern) { return isGlob(path.sep === "\\" ? normalizeToPosix(pattern) : pattern); } + +/** + * Determines if a given glob pattern will return any results. + * Used primarily to help with useful error messages. + * @param {Object} options The options for the function. + * @param {string} options.basePath The directory to search. + * @param {string} options.pattern A glob pattern to match. + * @returns {Promise} True if there is a glob match, false if not. + */ +function globMatch(_ref2) { + let { + basePath, + pattern + } = _ref2; + let found = false; + const patternToUse = path.isAbsolute(pattern) ? normalizeToPosix(path.relative(basePath, pattern)) : pattern; + const matcher = new Minimatch(patternToUse, MINIMATCH_OPTIONS); + const fsWalkSettings = { + deepFilter(entry) { + const relativePath = normalizeToPosix(path.relative(basePath, entry.path)); + return !found && matcher.match(relativePath, true); + }, + entryFilter(entry) { + if (found || entry.dirent.isDirectory()) { + return false; + } + const relativePath = normalizeToPosix(path.relative(basePath, entry.path)); + if (matcher.match(relativePath)) { + found = true; + return true; + } + return false; + } + }; + return new Promise(resolve => { + // using a stream so we can exit early because we just need one match + const globStream = fswalk.walkStream(basePath, fsWalkSettings); + globStream.on("data", () => { + globStream.destroy(); + resolve(true); + }); + + // swallow errors as they're not important here + globStream.on("error", () => {}); + globStream.on("end", () => { + resolve(false); + }); + globStream.read(); + }); +} + +/** + * Searches a directory looking for matching glob patterns. This uses + * the config array's logic to determine if a directory or file should + * be ignored, so it is consistent with how ignoring works throughout + * ESLint. + * @param {Object} options The options for this function. + * @param {string} options.basePath The directory to search. + * @param {Array} options.patterns An array of glob patterns + * to match. + * @param {Array} options.rawPatterns An array of glob patterns + * as the user inputted them. Used for errors. + * @param {FlatConfigArray} options.configs The config array to use for + * determining what to ignore. + * @param {boolean} options.errorOnUnmatchedPattern Determines if an error + * should be thrown when a pattern is unmatched. + * @returns {Promise>} An array of matching file paths + * or an empty array if there are no matches. + * @throws {UnmatchedSearchPatternsError} If there is a pattern that doesn't + * match any files. + */ +async function globSearch(_ref3) { + let { + basePath, + patterns, + rawPatterns, + configs, + errorOnUnmatchedPattern + } = _ref3; + if (patterns.length === 0) { + return []; + } + + /* + * In this section we are converting the patterns into Minimatch + * instances for performance reasons. Because we are doing the same + * matches repeatedly, it's best to compile those patterns once and + * reuse them multiple times. + * + * To do that, we convert any patterns with an absolute path into a + * relative path and normalize it to Posix-style slashes. We also keep + * track of the relative patterns to map them back to the original + * patterns, which we need in order to throw an error if there are any + * unmatched patterns. + */ + const relativeToPatterns = new Map(); + const matchers = patterns.map((pattern, i) => { + const patternToUse = path.isAbsolute(pattern) ? normalizeToPosix(path.relative(basePath, pattern)) : pattern; + relativeToPatterns.set(patternToUse, patterns[i]); + return new Minimatch(patternToUse, MINIMATCH_OPTIONS); + }); + + /* + * We track unmatched patterns because we may want to throw an error when + * they occur. To start, this set is initialized with all of the patterns. + * Every time a match occurs, the pattern is removed from the set, making + * it easy to tell if we have any unmatched patterns left at the end of + * search. + */ + const unmatchedPatterns = new Set([...relativeToPatterns.keys()]); + const filePaths = (await doFsWalk(basePath, { + deepFilter(entry) { + const relativePath = normalizeToPosix(path.relative(basePath, entry.path)); + const matchesPattern = matchers.some(matcher => matcher.match(relativePath, true)); + return matchesPattern && !configs.isDirectoryIgnored(entry.path); + }, + entryFilter(entry) { + const relativePath = normalizeToPosix(path.relative(basePath, entry.path)); + + // entries may be directories or files so filter out directories + if (entry.dirent.isDirectory()) { + return false; + } + + /* + * Optimization: We need to track when patterns are left unmatched + * and so we use `unmatchedPatterns` to do that. There is a bit of + * complexity here because the same file can be matched by more than + * one pattern. So, when we start, we actually need to test every + * pattern against every file. Once we know there are no remaining + * unmatched patterns, then we can switch to just looking for the + * first matching pattern for improved speed. + */ + const matchesPattern = unmatchedPatterns.size > 0 ? matchers.reduce((previousValue, matcher) => { + const pathMatches = matcher.match(relativePath); + + /* + * We updated the unmatched patterns set only if the path + * matches and the file isn't ignored. If the file is + * ignored, that means there wasn't a match for the + * pattern so it should not be removed. + * + * Performance note: isFileIgnored() aggressively caches + * results so there is no performance penalty for calling + * it twice with the same argument. + */ + if (pathMatches && !configs.isFileIgnored(entry.path)) { + unmatchedPatterns.delete(matcher.pattern); + } + return pathMatches || previousValue; + }, false) : matchers.some(matcher => matcher.match(relativePath)); + return matchesPattern && !configs.isFileIgnored(entry.path); + } + })).map(entry => entry.path); + + // now check to see if we have any unmatched patterns + if (errorOnUnmatchedPattern && unmatchedPatterns.size > 0) { + throw new UnmatchedSearchPatternsError({ + basePath, + unmatchedPatterns: [...unmatchedPatterns].map(pattern => relativeToPatterns.get(pattern)), + patterns, + rawPatterns + }); + } + return filePaths; +} + +/** + * Throws an error for unmatched patterns. The error will only contain information about the first one. + * Checks to see if there are any ignored results for a given search. + * @param {Object} options The options for this function. + * @param {string} options.basePath The directory to search. + * @param {Array} options.patterns An array of glob patterns + * that were used in the original search. + * @param {Array} options.rawPatterns An array of glob patterns + * as the user inputted them. Used for errors. + * @param {Array} options.unmatchedPatterns A non-empty array of glob patterns + * that were unmatched in the original search. + * @returns {void} Always throws an error. + * @throws {NoFilesFoundError} If the first unmatched pattern + * doesn't match any files even when there are no ignores. + * @throws {AllFilesIgnoredError} If the first unmatched pattern + * matches some files when there are no ignores. + */ +async function throwErrorForUnmatchedPatterns(_ref4) { + let { + basePath, + patterns, + rawPatterns, + unmatchedPatterns + } = _ref4; + const pattern = unmatchedPatterns[0]; + const rawPattern = rawPatterns[patterns.indexOf(pattern)]; + const patternHasMatch = await globMatch({ + basePath, + pattern + }); + if (patternHasMatch) { + throw new AllFilesIgnoredError(rawPattern); + } + + // if we get here there are truly no matches + throw new NoFilesFoundError(rawPattern, true); +} + +/** + * Performs multiple glob searches in parallel. + * @param {Object} options The options for this function. + * @param {Map} options.searches + * An array of glob patterns to match. + * @param {FlatConfigArray} options.configs The config array to use for + * determining what to ignore. + * @param {boolean} options.errorOnUnmatchedPattern Determines if an + * unmatched glob pattern should throw an error. + * @returns {Promise>} An array of matching file paths + * or an empty array if there are no matches. + */ +async function globMultiSearch(_ref5) { + let { + searches, + configs, + errorOnUnmatchedPattern + } = _ref5; + /* + * For convenience, we normalized the search map into an array of objects. + * Next, we filter out all searches that have no patterns. This happens + * primarily for the cwd, which is prepopulated in the searches map as an + * optimization. However, if it has no patterns, it means all patterns + * occur outside of the cwd and we can safely filter out that search. + */ + const normalizedSearches = [...searches].map(_ref6 => { + let [basePath, { + patterns, + rawPatterns + }] = _ref6; + return { + basePath, + patterns, + rawPatterns + }; + }).filter(_ref7 => { + let { + patterns + } = _ref7; + return patterns.length > 0; + }); + const results = await Promise.allSettled(normalizedSearches.map(_ref8 => { + let { + basePath, + patterns, + rawPatterns + } = _ref8; + return globSearch({ + basePath, + patterns, + rawPatterns, + configs, + errorOnUnmatchedPattern + }); + })); + const filePaths = []; + for (let i = 0; i < results.length; i++) { + const result = results[i]; + const currentSearch = normalizedSearches[i]; + if (result.status === "fulfilled") { + // if the search was successful just add the results + if (result.value.length > 0) { + filePaths.push(...result.value); + } + continue; + } + + // if we make it here then there was an error + const error = result.reason; + + // unexpected errors should be re-thrown + if (!error.basePath) { + throw error; + } + if (errorOnUnmatchedPattern) { + await throwErrorForUnmatchedPatterns({ + ...currentSearch, + unmatchedPatterns: error.unmatchedPatterns + }); + } + } + return [...new Set(filePaths)]; +} + /** * Finds all files matching the options specified. * @param {Object} args The arguments objects. @@ -145213,184 +131177,111 @@ function isGlobPattern(pattern) { * @throws {AllFilesIgnoredError} If there are no results due to an ignore pattern. * @throws {NoFilesFoundError} If no files matched the given patterns. */ - - -async function findFiles(_ref) { +async function findFiles(_ref9) { let { patterns, globInputPaths, cwd, configs, errorOnUnmatchedPattern - } = _ref; + } = _ref9; const results = []; - const globbyPatterns = []; - const missingPatterns = []; // check to see if we have explicit files and directories + const missingPatterns = []; + let globbyPatterns = []; + let rawPatterns = []; + const searches = new Map([[cwd, { + patterns: globbyPatterns, + rawPatterns: [] + }]]); + // check to see if we have explicit files and directories const filePaths = patterns.map(filePath => path.resolve(cwd, filePath)); const stats = await Promise.all(filePaths.map(filePath => fsp.stat(filePath).catch(() => {}))); stats.forEach((stat, index) => { const filePath = filePaths[index]; const pattern = normalizeToPosix(patterns[index]); - if (stat) { // files are added directly to the list if (stat.isFile()) { results.push({ filePath, - ignored: configs.isIgnored(filePath) + ignored: configs.isFileIgnored(filePath) }); - } // directories need extensions attached - - - if (stat.isDirectory()) { - // filePatterns are all relative to cwd - const filePatterns = configs.files.filter(filePattern => { - // can only do this for strings, not functions - if (typeof filePattern !== "string") { - return false; - } // patterns starting with ** always apply - - - if (filePattern.startsWith("**")) { - return true; - } // patterns ending with * are not used for file search - - - if (filePattern.endsWith("*")) { - return false; - } // not sure how to handle negated patterns yet - - - if (filePattern.startsWith("!")) { - return false; - } // check if the pattern would be inside the config base path or not - - - const fullFilePattern = path.join(cwd, filePattern); - const patternRelativeToConfigBasePath = path.relative(configs.basePath, fullFilePattern); - - if (patternRelativeToConfigBasePath.startsWith("..")) { - return false; - } // check if the pattern matches - - - if (minimatch(filePath, path.dirname(fullFilePattern), { - partial: true - })) { - return true; - } // check if the pattern is inside the directory or not - - - const patternRelativeToFilePath = path.relative(filePath, fullFilePattern); - - if (patternRelativeToFilePath.startsWith("..")) { - return false; - } - - return true; - }).map(filePattern => { - if (filePattern.startsWith("**")) { - return path.join(pattern, filePattern); - } // adjust the path to be relative to the cwd - - - return path.relative(cwd, path.join(configs.basePath, filePattern)); - }).map(normalizeToPosix); - - if (filePatterns.length) { - globbyPatterns.push(...filePatterns); - } } + // directories need extensions attached + if (stat.isDirectory()) { + // group everything in cwd together and split out others + if (isPathInside(filePath, cwd)) { + ({ + patterns: globbyPatterns, + rawPatterns + } = searches.get(cwd)); + } else { + if (!searches.has(filePath)) { + searches.set(filePath, { + patterns: [], + rawPatterns: [] + }); + } + ({ + patterns: globbyPatterns, + rawPatterns + } = searches.get(filePath)); + } + globbyPatterns.push(`${normalizeToPosix(filePath)}/**`); + rawPatterns.push(pattern); + } return; - } // save patterns for later use based on whether globs are enabled + } + // save patterns for later use based on whether globs are enabled + if (globInputPaths && isGlobPattern(pattern)) { + const basePath = path.resolve(cwd, globParent(pattern)); - if (globInputPaths && isGlobPattern(filePath)) { - globbyPatterns.push(pattern); + // group in cwd if possible and split out others + if (isPathInside(basePath, cwd)) { + ({ + patterns: globbyPatterns, + rawPatterns + } = searches.get(cwd)); + } else { + if (!searches.has(basePath)) { + searches.set(basePath, { + patterns: [], + rawPatterns: [] + }); + } + ({ + patterns: globbyPatterns, + rawPatterns + } = searches.get(basePath)); + } + globbyPatterns.push(filePath); + rawPatterns.push(pattern); } else { missingPatterns.push(pattern); } - }); // note: globbyPatterns can be an empty array - - const globbyResults = await globby(globbyPatterns, { - cwd, - absolute: true, - ignore: configs.ignores.filter(matcher => typeof matcher === "string") - }); // if there are no results, tell the user why - - if (!results.length && !globbyResults.length) { - // try globby without ignoring anything - - /* eslint-disable no-unreachable-loop -- We want to exit early. */ - for (const globbyPattern of globbyPatterns) { - /* eslint-disable-next-line no-unused-vars -- Want to exit early. */ - for await (const filePath of globby.stream(globbyPattern, { - cwd, - absolute: true - })) { - // files were found but ignored - throw new AllFilesIgnoredError(globbyPattern); - } // no files were found - - - if (errorOnUnmatchedPattern) { - throw new NoFilesFoundError(globbyPattern, globInputPaths); - } - } - /* eslint-enable no-unreachable-loop -- Go back to normal. */ - - } // there were patterns that didn't match anything, tell the user - + }); + // there were patterns that didn't match anything, tell the user if (errorOnUnmatchedPattern && missingPatterns.length) { throw new NoFilesFoundError(missingPatterns[0], globInputPaths); } + // now we are safe to do the search + const globbyResults = await globMultiSearch({ + searches, + configs, + errorOnUnmatchedPattern + }); return [...results, ...globbyResults.map(filePath => ({ filePath: path.resolve(filePath), ignored: false }))]; } -/** - * Checks whether a file exists at the given location - * @param {string} resolvedPath A path from the CWD - * @throws {Error} As thrown by `fs.statSync` or `fs.isFile`. - * @returns {boolean} `true` if a file exists - */ - -function fileExists(resolvedPath) { - try { - return fs.statSync(resolvedPath).isFile(); - } catch (error) { - if (error && (error.code === "ENOENT" || error.code === "ENOTDIR")) { - return false; - } - - throw error; - } -} -/** - * Checks whether a directory exists at the given location - * @param {string} resolvedPath A path from the CWD - * @throws {Error} As thrown by `fs.statSync` or `fs.isDirectory`. - * @returns {boolean} `true` if a directory exists - */ - - -function directoryExists(resolvedPath) { - try { - return fs.statSync(resolvedPath).isDirectory(); - } catch (error) { - if (error && (error.code === "ENOENT" || error.code === "ENOTDIR")) { - return false; - } - - throw error; - } -} //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- // Results-related Helpers //----------------------------------------------------------------------------- @@ -145400,11 +131291,10 @@ function directoryExists(resolvedPath) { * @returns {boolean} Whether or not the message is an error message. * @private */ - - function isErrorMessage(message) { return message.severity === 2; } + /** * Returns result with warning by ignore settings * @param {string} filePath File path of checked code @@ -145412,27 +131302,22 @@ function isErrorMessage(message) { * @returns {LintResult} Result with single warning * @private */ - - function createIgnoreResult(filePath, baseDir) { let message; - const isHidden = filePath.split(path.sep).find(segment => /^\./u.test(segment)); const isInNodeModules = baseDir && path.relative(baseDir, filePath).startsWith("node_modules"); - - if (isHidden) { - message = "File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."; - } else if (isInNodeModules) { - message = "File ignored by default. Use \"--ignore-pattern '!node_modules/*'\" to override."; + if (isInNodeModules) { + message = "File ignored by default because it is located under the node_modules directory. Use ignore pattern \"!**/node_modules/\" to override."; } else { message = "File ignored because of a matching ignore pattern. Use \"--no-ignore\" to override."; } - return { filePath: path.resolve(filePath), messages: [{ + ruleId: null, fatal: false, severity: 1, - message + message, + nodeType: null }], suppressedMessages: [], errorCount: 0, @@ -145441,7 +131326,9 @@ function createIgnoreResult(filePath, baseDir) { fixableErrorCount: 0, fixableWarningCount: 0 }; -} //----------------------------------------------------------------------------- +} + +//----------------------------------------------------------------------------- // Options-related Helpers //----------------------------------------------------------------------------- @@ -145450,43 +131337,37 @@ function createIgnoreResult(filePath, baseDir) { * @param {any} x The value to check. * @returns {boolean} `true` if `x` is valid fix type. */ - - function isFixType(x) { return x === "directive" || 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 {FlatESLintOptions} options The options to process. * @throws {ESLintInvalidOptionsError} If of any of a variety of type errors. * @returns {FlatESLintOptions} The normalized options. */ - - -function processOptions(_ref2) { +function processOptions(_ref10) { let { allowInlineConfig = true, // ← we cannot use `overrideConfig.noInlineConfig` instead because `allowInlineConfig` has side-effect that suppress warnings that show inline configs are ignored. @@ -145501,8 +131382,6 @@ function processOptions(_ref2) { // ← 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. ignorePatterns = null, overrideConfig = null, overrideConfigFile = null, @@ -145510,132 +131389,104 @@ function processOptions(_ref2) { 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. ...unknownOptions - } = _ref2; + } = _ref10; 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."); } - if (unknownOptionKeys.includes("extensions")) { errors.push("'extensions' has been removed."); } - if (unknownOptionKeys.includes("resolvePluginsRelativeTo")) { errors.push("'resolvePluginsRelativeTo' has been removed."); } - if (unknownOptionKeys.includes("globals")) { errors.push("'globals' has been removed. Please use the 'overrideConfig.languageOptions.globals' option instead."); } - + if (unknownOptionKeys.includes("ignorePath")) { + errors.push("'ignorePath' has been removed."); + } 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.languageOptions.parser' option instead."); } - if (unknownOptionKeys.includes("parserOptions")) { errors.push("'parserOptions' has been removed. Please use the 'overrideConfig.languageOptions.parserOptions' option instead."); } - if (unknownOptionKeys.includes("rules")) { errors.push("'rules' has been removed. Please use the 'overrideConfig.rules' option instead."); } - if (unknownOptionKeys.includes("rulePaths")) { errors.push("'rulePaths' has been removed. Please define your rules using plugins."); } } - 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 (cacheStrategy !== "metadata" && cacheStrategy !== "content") { errors.push("'cacheStrategy' must be any of \"metadata\", \"content\"."); } - 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 (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 \"directive\", \"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 (!isArrayOfNonEmptyString(ignorePatterns) && ignorePatterns !== null) { + errors.push("'ignorePatterns' must be an array of non-empty strings or null."); } - if (typeof overrideConfig !== "object") { errors.push("'overrideConfig' must be an object or null."); } - if (!isNonEmptyString(overrideConfigFile) && overrideConfigFile !== null && overrideConfigFile !== true) { errors.push("'overrideConfigFile' must be a non-empty string, null, or true."); } - 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 (errors.length > 0) { throw new ESLintInvalidOptionsError(errors); } - return { allowInlineConfig, baseConfig, @@ -145651,11 +131502,12 @@ function processOptions(_ref2) { fixTypes, globInputPaths, ignore, - ignorePath, ignorePatterns, reportUnusedDisableDirectives }; -} //----------------------------------------------------------------------------- +} + +//----------------------------------------------------------------------------- // Cache-related helpers //----------------------------------------------------------------------------- @@ -145669,8 +131521,6 @@ function processOptions(_ref2) { * @param {string} cwd Current working directory * @returns {string} the resolved path to the cache file */ - - function getCacheFile(cacheFile, cwd) { /* * make sure the path separators are normalized for the environment/os @@ -145679,29 +131529,26 @@ function getCacheFile(cacheFile, cwd) { const normalizedCacheFile = path.normalize(cacheFile); const resolvedCacheFile = path.resolve(cwd, normalizedCacheFile); const looksLikeADirectory = normalizedCacheFile.slice(-1) === path.sep; + /** * return the name for the cache file in case the provided parameter is a directory * @returns {string} the resolved path to the cacheFile */ - function getCacheFileForDirectory() { return path.join(resolvedCacheFile, `.cache_${hash(cwd)}`); } - let fileStats; - try { fileStats = fs.lstatSync(resolvedCacheFile); } catch { fileStats = null; } + /* * in case the file exists we need to verify if the provided path * is a directory or a file. If it is a directory we want to create a file * inside that directory */ - - if (fileStats) { /* * is a directory or is a file, but the original file the user provided @@ -145710,33 +131557,31 @@ function getCacheFile(cacheFile, cwd) { */ if (fileStats.isDirectory() || looksLikeADirectory) { return getCacheFileForDirectory(); - } // is file so just use that file - + } + // is file so just use that file return resolvedCacheFile; } + /* * here we known the file or directory doesn't exist, * so we will try to infer if its a directory if it looks like a directory * for the current operating system. */ + // if the last character passed is a path separator we assume is a directory - - if (looksLikeADirectory) { return getCacheFileForDirectory(); } - return resolvedCacheFile; -} //----------------------------------------------------------------------------- +} + +//----------------------------------------------------------------------------- // Exports //----------------------------------------------------------------------------- - module.exports = { isGlobPattern, - directoryExists, - fileExists, findFiles, isNonEmptyString, isArrayOfNonEmptyString, @@ -145746,718 +131591,6 @@ module.exports = { getCacheFile }; -/***/ }), -/* 1022 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fs = __webpack_require__(971); - -const arrayUnion = __webpack_require__(1023); - -const merge2 = __webpack_require__(1024); - -const fastGlob = __webpack_require__(1026); - -const dirGlob = __webpack_require__(1097); - -const gitignore = __webpack_require__(1099); - -const { - FilterStream, - UniqueStream -} = __webpack_require__(1101); - -const DEFAULT_FILTER = () => false; - -const isNegative = pattern => pattern[0] === '!'; - -const assertPatternsInput = patterns => { - if (!patterns.every(pattern => typeof pattern === 'string')) { - throw new TypeError('Patterns must be a string or an array of strings'); - } -}; - -const checkCwdOption = function () { - let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - if (!options.cwd) { - return; - } - - let stat; - - try { - stat = fs.statSync(options.cwd); - } catch { - return; - } - - if (!stat.isDirectory()) { - throw new Error('The `cwd` option must be a path to a directory'); - } -}; - -const getPathString = p => p.stats instanceof fs.Stats ? p.path : p; - -const generateGlobTasks = (patterns, taskOptions) => { - patterns = arrayUnion([].concat(patterns)); - assertPatternsInput(patterns); - checkCwdOption(taskOptions); - const globTasks = []; - taskOptions = { - ignore: [], - expandDirectories: true, - ...taskOptions - }; - - for (const [index, pattern] of patterns.entries()) { - if (isNegative(pattern)) { - continue; - } - - const ignore = patterns.slice(index).filter(pattern => isNegative(pattern)).map(pattern => pattern.slice(1)); - const options = { ...taskOptions, - ignore: taskOptions.ignore.concat(ignore) - }; - globTasks.push({ - pattern, - options - }); - } - - return globTasks; -}; - -const globDirs = (task, fn) => { - let options = {}; - - if (task.options.cwd) { - options.cwd = task.options.cwd; - } - - if (Array.isArray(task.options.expandDirectories)) { - options = { ...options, - files: task.options.expandDirectories - }; - } else if (typeof task.options.expandDirectories === 'object') { - options = { ...options, - ...task.options.expandDirectories - }; - } - - return fn(task.pattern, options); -}; - -const getPattern = (task, fn) => task.options.expandDirectories ? globDirs(task, fn) : [task.pattern]; - -const getFilterSync = options => { - return options && options.gitignore ? gitignore.sync({ - cwd: options.cwd, - ignore: options.ignore - }) : DEFAULT_FILTER; -}; - -const globToTask = task => glob => { - const { - options - } = task; - - if (options.ignore && Array.isArray(options.ignore) && options.expandDirectories) { - options.ignore = dirGlob.sync(options.ignore); - } - - return { - pattern: glob, - options - }; -}; - -module.exports = async (patterns, options) => { - const globTasks = generateGlobTasks(patterns, options); - - const getFilter = async () => { - return options && options.gitignore ? gitignore({ - cwd: options.cwd, - ignore: options.ignore - }) : DEFAULT_FILTER; - }; - - const getTasks = async () => { - const tasks = await Promise.all(globTasks.map(async task => { - const globs = await getPattern(task, dirGlob); - return Promise.all(globs.map(globToTask(task))); - })); - return arrayUnion(...tasks); - }; - - const [filter, tasks] = await Promise.all([getFilter(), getTasks()]); - const paths = await Promise.all(tasks.map(task => fastGlob(task.pattern, task.options))); - return arrayUnion(...paths).filter(path_ => !filter(getPathString(path_))); -}; - -module.exports.sync = (patterns, options) => { - const globTasks = generateGlobTasks(patterns, options); - const tasks = []; - - for (const task of globTasks) { - const newTask = getPattern(task, dirGlob.sync).map(globToTask(task)); - tasks.push(...newTask); - } - - const filter = getFilterSync(options); - let matches = []; - - for (const task of tasks) { - matches = arrayUnion(matches, fastGlob.sync(task.pattern, task.options)); - } - - return matches.filter(path_ => !filter(path_)); -}; - -module.exports.stream = (patterns, options) => { - const globTasks = generateGlobTasks(patterns, options); - const tasks = []; - - for (const task of globTasks) { - const newTask = getPattern(task, dirGlob.sync).map(globToTask(task)); - tasks.push(...newTask); - } - - const filter = getFilterSync(options); - const filterStream = new FilterStream(p => !filter(p)); - const uniqueStream = new UniqueStream(); - return merge2(tasks.map(task => fastGlob.stream(task.pattern, task.options))).pipe(filterStream).pipe(uniqueStream); -}; - -module.exports.generateGlobTasks = generateGlobTasks; - -module.exports.hasMagic = (patterns, options) => [].concat(patterns).some(pattern => fastGlob.isDynamicPattern(pattern, options)); - -module.exports.gitignore = gitignore; - -/***/ }), -/* 1023 */ -/***/ ((module) => { - -"use strict"; - - -module.exports = function () { - return [...new Set([].concat(...arguments))]; -}; - -/***/ }), -/* 1024 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -/* - * merge2 - * https://github.com/teambition/merge2 - * - * Copyright (c) 2014-2020 Teambition - * Licensed under the MIT license. - */ - -const Stream = __webpack_require__(1025); - -const PassThrough = Stream.PassThrough; -const slice = Array.prototype.slice; -module.exports = merge2; - -function merge2() { - const streamsQueue = []; - const args = slice.call(arguments); - let merging = false; - let options = args[args.length - 1]; - - if (options && !Array.isArray(options) && options.pipe == null) { - args.pop(); - } else { - options = {}; - } - - const doEnd = options.end !== false; - const doPipeError = options.pipeError === true; - - if (options.objectMode == null) { - options.objectMode = true; - } - - if (options.highWaterMark == null) { - options.highWaterMark = 64 * 1024; - } - - const mergedStream = PassThrough(options); - - function addStream() { - for (let i = 0, len = arguments.length; i < len; i++) { - streamsQueue.push(pauseStreams(arguments[i], options)); - } - - mergeStream(); - return this; - } - - function mergeStream() { - if (merging) { - return; - } - - merging = true; - let streams = streamsQueue.shift(); - - if (!streams) { - process.nextTick(endStream); - return; - } - - if (!Array.isArray(streams)) { - streams = [streams]; - } - - let pipesCount = streams.length + 1; - - function next() { - if (--pipesCount > 0) { - return; - } - - merging = false; - mergeStream(); - } - - function pipe(stream) { - function onend() { - stream.removeListener('merge2UnpipeEnd', onend); - stream.removeListener('end', onend); - - if (doPipeError) { - stream.removeListener('error', onerror); - } - - next(); - } - - function onerror(err) { - mergedStream.emit('error', err); - } // skip ended stream - - - if (stream._readableState.endEmitted) { - return next(); - } - - stream.on('merge2UnpipeEnd', onend); - stream.on('end', onend); - - if (doPipeError) { - stream.on('error', onerror); - } - - stream.pipe(mergedStream, { - end: false - }); // compatible for old stream - - stream.resume(); - } - - for (let i = 0; i < streams.length; i++) { - pipe(streams[i]); - } - - next(); - } - - function endStream() { - merging = false; // emit 'queueDrain' when all streams merged. - - mergedStream.emit('queueDrain'); - - if (doEnd) { - mergedStream.end(); - } - } - - mergedStream.setMaxListeners(0); - mergedStream.add = addStream; - mergedStream.on('unpipe', function (stream) { - stream.emit('merge2UnpipeEnd'); - }); - - if (args.length) { - addStream.apply(null, args); - } - - return mergedStream; -} // check and pause streams for pipe. - - -function pauseStreams(streams, options) { - if (!Array.isArray(streams)) { - // Backwards-compat with old-style streams - if (!streams._readableState && streams.pipe) { - streams = streams.pipe(PassThrough(options)); - } - - if (!streams._readableState || !streams.pause || !streams.pipe) { - throw new Error('Only readable stream can be merged.'); - } - - streams.pause(); - } else { - for (let i = 0, len = streams.length; i < len; i++) { - streams[i] = pauseStreams(streams[i], options); - } - } - - return streams; -} - -/***/ }), -/* 1025 */ -/***/ ((module) => { - -"use strict"; -module.exports = require("stream"); - -/***/ }), -/* 1026 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const taskManager = __webpack_require__(1027); - -const patternManager = __webpack_require__(1054); - -const async_1 = __webpack_require__(1055); - -const stream_1 = __webpack_require__(1093); - -const sync_1 = __webpack_require__(1094); - -const settings_1 = __webpack_require__(1096); - -const utils = __webpack_require__(1028); - -async function FastGlob(source, options) { - assertPatternsInput(source); - const works = getWorks(source, async_1.default, options); - const result = await Promise.all(works); - return utils.array.flatten(result); -} // https://github.com/typescript-eslint/typescript-eslint/issues/60 -// eslint-disable-next-line no-redeclare - - -(function (FastGlob) { - function sync(source, options) { - assertPatternsInput(source); - const works = getWorks(source, sync_1.default, options); - return utils.array.flatten(works); - } - - FastGlob.sync = sync; - - function stream(source, options) { - assertPatternsInput(source); - const works = getWorks(source, stream_1.default, options); - /** - * The stream returned by the provider cannot work with an asynchronous iterator. - * To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams. - * This affects performance (+25%). I don't see best solution right now. - */ - - return utils.stream.merge(works); - } - - FastGlob.stream = stream; - - function generateTasks(source, options) { - assertPatternsInput(source); - const patterns = patternManager.transform([].concat(source)); - const settings = new settings_1.default(options); - return taskManager.generate(patterns, settings); - } - - FastGlob.generateTasks = generateTasks; - - function isDynamicPattern(source, options) { - assertPatternsInput(source); - const settings = new settings_1.default(options); - return utils.pattern.isDynamicPattern(source, settings); - } - - FastGlob.isDynamicPattern = isDynamicPattern; - - function escapePath(source) { - assertPatternsInput(source); - return utils.path.escape(source); - } - - FastGlob.escapePath = escapePath; -})(FastGlob || (FastGlob = {})); - -function getWorks(source, _Provider, options) { - const patterns = patternManager.transform([].concat(source)); - const settings = new settings_1.default(options); - const tasks = taskManager.generate(patterns, settings); - const provider = new _Provider(settings); - return tasks.map(provider.read, provider); -} - -function assertPatternsInput(input) { - const source = [].concat(input); - const isValidSource = source.every(item => utils.string.isString(item) && !utils.string.isEmpty(item)); - - if (!isValidSource) { - throw new TypeError('Patterns must be a string (non empty) or an array of strings'); - } -} - -module.exports = FastGlob; - -/***/ }), -/* 1027 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0; - -const utils = __webpack_require__(1028); - -function generate(patterns, settings) { - const positivePatterns = getPositivePatterns(patterns); - const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore); - const staticPatterns = positivePatterns.filter(pattern => utils.pattern.isStaticPattern(pattern, settings)); - const dynamicPatterns = positivePatterns.filter(pattern => utils.pattern.isDynamicPattern(pattern, settings)); - const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, - /* dynamic */ - false); - const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, - /* dynamic */ - true); - return staticTasks.concat(dynamicTasks); -} - -exports.generate = generate; -/** - * Returns tasks grouped by basic pattern directories. - * - * Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately. - * This is necessary because directory traversal starts at the base directory and goes deeper. - */ - -function convertPatternsToTasks(positive, negative, dynamic) { - const tasks = []; - const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive); - const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive); - const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory); - const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory); - tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic)); - /* - * For the sake of reducing future accesses to the file system, we merge all tasks within the current directory - * into a global task, if at least one pattern refers to the root (`.`). In this case, the global task covers the rest. - */ - - if ('.' in insideCurrentDirectoryGroup) { - tasks.push(convertPatternGroupToTask('.', patternsInsideCurrentDirectory, negative, dynamic)); - } else { - tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic)); - } - - return tasks; -} - -exports.convertPatternsToTasks = convertPatternsToTasks; - -function getPositivePatterns(patterns) { - return utils.pattern.getPositivePatterns(patterns); -} - -exports.getPositivePatterns = getPositivePatterns; - -function getNegativePatternsAsPositive(patterns, ignore) { - const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore); - const positive = negative.map(utils.pattern.convertToPositivePattern); - return positive; -} - -exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; - -function groupPatternsByBaseDirectory(patterns) { - const group = {}; - return patterns.reduce((collection, pattern) => { - const base = utils.pattern.getBaseDirectory(pattern); - - if (base in collection) { - collection[base].push(pattern); - } else { - collection[base] = [pattern]; - } - - return collection; - }, group); -} - -exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; - -function convertPatternGroupsToTasks(positive, negative, dynamic) { - return Object.keys(positive).map(base => { - return convertPatternGroupToTask(base, positive[base], negative, dynamic); - }); -} - -exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; - -function convertPatternGroupToTask(base, positive, negative, dynamic) { - return { - dynamic, - positive, - negative, - base, - patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern)) - }; -} - -exports.convertPatternGroupToTask = convertPatternGroupToTask; - -/***/ }), -/* 1028 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0; - -const array = __webpack_require__(1029); - -exports.array = array; - -const errno = __webpack_require__(1030); - -exports.errno = errno; - -const fs = __webpack_require__(1031); - -exports.fs = fs; - -const path = __webpack_require__(1032); - -exports.path = path; - -const pattern = __webpack_require__(1033); - -exports.pattern = pattern; - -const stream = __webpack_require__(1052); - -exports.stream = stream; - -const string = __webpack_require__(1053); - -exports.string = string; - -/***/ }), -/* 1029 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.splitWhen = exports.flatten = void 0; - -function flatten(items) { - return items.reduce((collection, item) => [].concat(collection, item), []); -} - -exports.flatten = flatten; - -function splitWhen(items, predicate) { - const result = [[]]; - let groupIndex = 0; - - for (const item of items) { - if (predicate(item)) { - groupIndex++; - result[groupIndex] = []; - } else { - result[groupIndex].push(item); - } - } - - return result; -} - -exports.splitWhen = splitWhen; - -/***/ }), -/* 1030 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.isEnoentCodeError = void 0; - -function isEnoentCodeError(error) { - return error.code === 'ENOENT'; -} - -exports.isEnoentCodeError = isEnoentCodeError; - -/***/ }), -/* 1031 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.createDirentFromStats = void 0; - -class DirentFromStats { - constructor(name, stats) { - this.name = name; - this.isBlockDevice = stats.isBlockDevice.bind(stats); - this.isCharacterDevice = stats.isCharacterDevice.bind(stats); - this.isDirectory = stats.isDirectory.bind(stats); - this.isFIFO = stats.isFIFO.bind(stats); - this.isFile = stats.isFile.bind(stats); - this.isSocket = stats.isSocket.bind(stats); - this.isSymbolicLink = stats.isSymbolicLink.bind(stats); - } - -} - -function createDirentFromStats(name, stats) { - return new DirentFromStats(name, stats); -} - -exports.createDirentFromStats = createDirentFromStats; - /***/ }), /* 1032 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { @@ -146468,50 +131601,39 @@ exports.createDirentFromStats = createDirentFromStats; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.removeLeadingDotSegment = exports.escape = exports.makeAbsolute = exports.unixify = void 0; - -const path = __webpack_require__(501); - -const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\ - -const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g; -/** - * Designed to work only with simple paths: `dir\\file`. - */ - -function unixify(filepath) { - return filepath.replace(/\\/g, '/'); -} - -exports.unixify = unixify; - -function makeAbsolute(cwd, filepath) { - return path.resolve(cwd, filepath); -} - -exports.makeAbsolute = makeAbsolute; - -function escape(pattern) { - return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, '\\$2'); -} - -exports.escape = escape; - -function removeLeadingDotSegment(entry) { - // We do not use `startsWith` because this is 10x slower than current implementation for some cases. - // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with - if (entry.charAt(0) === '.') { - const secondCharactery = entry.charAt(1); - - if (secondCharactery === '/' || secondCharactery === '\\') { - return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT); - } +exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0; +const async_1 = __webpack_require__(1033); +const stream_1 = __webpack_require__(1055); +const sync_1 = __webpack_require__(1057); +const settings_1 = __webpack_require__(1059); +exports.Settings = settings_1.default; +function walk(directory, optionsOrSettingsOrCallback, callback) { + if (typeof optionsOrSettingsOrCallback === 'function') { + new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback); + return; } - - return entry; + new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback); +} +exports.walk = walk; +function walkSync(directory, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + const provider = new sync_1.default(directory, settings); + return provider.read(); +} +exports.walkSync = walkSync; +function walkStream(directory, optionsOrSettings) { + const settings = getSettings(optionsOrSettings); + const provider = new stream_1.default(directory, settings); + return provider.read(); +} +exports.walkStream = walkStream; +function getSettings() { + let settingsOrOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + if (settingsOrOptions instanceof settings_1.default) { + return settingsOrOptions; + } + return new settings_1.default(settingsOrOptions); } - -exports.removeLeadingDotSegment = removeLeadingDotSegment; /***/ }), /* 1033 */ @@ -146523,5278 +131645,7 @@ exports.removeLeadingDotSegment = removeLeadingDotSegment; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0; - -const path = __webpack_require__(501); - -const globParent = __webpack_require__(1034); - -const micromatch = __webpack_require__(1035); - -const GLOBSTAR = '**'; -const ESCAPE_SYMBOL = '\\'; -const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/; -const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/; -const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/; -const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/; -const BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./; - -function isStaticPattern(pattern) { - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - return !isDynamicPattern(pattern, options); -} - -exports.isStaticPattern = isStaticPattern; - -function isDynamicPattern(pattern) { - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - /** - * A special case with an empty string is necessary for matching patterns that start with a forward slash. - * An empty string cannot be a dynamic pattern. - * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'. - */ - if (pattern === '') { - return false; - } - /** - * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check - * filepath directly (without read directory). - */ - - - if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) { - return true; - } - - if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) { - return true; - } - - if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) { - return true; - } - - if (options.braceExpansion !== false && hasBraceExpansion(pattern)) { - return true; - } - - return false; -} - -exports.isDynamicPattern = isDynamicPattern; - -function hasBraceExpansion(pattern) { - const openingBraceIndex = pattern.indexOf('{'); - - if (openingBraceIndex === -1) { - return false; - } - - const closingBraceIndex = pattern.indexOf('}', openingBraceIndex + 1); - - if (closingBraceIndex === -1) { - return false; - } - - const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex); - return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent); -} - -function convertToPositivePattern(pattern) { - return isNegativePattern(pattern) ? pattern.slice(1) : pattern; -} - -exports.convertToPositivePattern = convertToPositivePattern; - -function convertToNegativePattern(pattern) { - return '!' + pattern; -} - -exports.convertToNegativePattern = convertToNegativePattern; - -function isNegativePattern(pattern) { - return pattern.startsWith('!') && pattern[1] !== '('; -} - -exports.isNegativePattern = isNegativePattern; - -function isPositivePattern(pattern) { - return !isNegativePattern(pattern); -} - -exports.isPositivePattern = isPositivePattern; - -function getNegativePatterns(patterns) { - return patterns.filter(isNegativePattern); -} - -exports.getNegativePatterns = getNegativePatterns; - -function getPositivePatterns(patterns) { - return patterns.filter(isPositivePattern); -} - -exports.getPositivePatterns = getPositivePatterns; -/** - * Returns patterns that can be applied inside the current directory. - * - * @example - * // ['./*', '*', 'a/*'] - * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) - */ - -function getPatternsInsideCurrentDirectory(patterns) { - return patterns.filter(pattern => !isPatternRelatedToParentDirectory(pattern)); -} - -exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory; -/** - * Returns patterns to be expanded relative to (outside) the current directory. - * - * @example - * // ['../*', './../*'] - * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) - */ - -function getPatternsOutsideCurrentDirectory(patterns) { - return patterns.filter(isPatternRelatedToParentDirectory); -} - -exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory; - -function isPatternRelatedToParentDirectory(pattern) { - return pattern.startsWith('..') || pattern.startsWith('./..'); -} - -exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory; - -function getBaseDirectory(pattern) { - return globParent(pattern, { - flipBackslashes: false - }); -} - -exports.getBaseDirectory = getBaseDirectory; - -function hasGlobStar(pattern) { - return pattern.includes(GLOBSTAR); -} - -exports.hasGlobStar = hasGlobStar; - -function endsWithSlashGlobStar(pattern) { - return pattern.endsWith('/' + GLOBSTAR); -} - -exports.endsWithSlashGlobStar = endsWithSlashGlobStar; - -function isAffectDepthOfReadingPattern(pattern) { - const basename = path.basename(pattern); - return endsWithSlashGlobStar(pattern) || isStaticPattern(basename); -} - -exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; - -function expandPatternsWithBraceExpansion(patterns) { - return patterns.reduce((collection, pattern) => { - return collection.concat(expandBraceExpansion(pattern)); - }, []); -} - -exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion; - -function expandBraceExpansion(pattern) { - return micromatch.braces(pattern, { - expand: true, - nodupes: true - }); -} - -exports.expandBraceExpansion = expandBraceExpansion; - -function getPatternParts(pattern, options) { - let { - parts - } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { - parts: true - })); - /** - * The scan method returns an empty array in some cases. - * See micromatch/picomatch#58 for more details. - */ - - if (parts.length === 0) { - parts = [pattern]; - } - /** - * The scan method does not return an empty part for the pattern with a forward slash. - * This is another part of micromatch/picomatch#58. - */ - - - if (parts[0].startsWith('/')) { - parts[0] = parts[0].slice(1); - parts.unshift(''); - } - - return parts; -} - -exports.getPatternParts = getPatternParts; - -function makeRe(pattern, options) { - return micromatch.makeRe(pattern, options); -} - -exports.makeRe = makeRe; - -function convertPatternsToRe(patterns, options) { - return patterns.map(pattern => makeRe(pattern, options)); -} - -exports.convertPatternsToRe = convertPatternsToRe; - -function matchAny(entry, patternsRe) { - return patternsRe.some(patternRe => patternRe.test(entry)); -} - -exports.matchAny = matchAny; - -/***/ }), -/* 1034 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var isGlob = __webpack_require__(986); - -var pathPosixDirname = (__webpack_require__(501).posix.dirname); - -var isWin32 = (__webpack_require__(982).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] - * @returns {string} - */ - -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'); -}; - -/***/ }), -/* 1035 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const util = __webpack_require__(516); - -const braces = __webpack_require__(1036); - -const picomatch = __webpack_require__(1046); - -const utils = __webpack_require__(1049); - -const isEmptyString = val => val === '' || val === './'; -/** - * Returns an array of strings that match one or more glob patterns. - * - * ```js - * const mm = require('micromatch'); - * // mm(list, patterns[, options]); - * - * console.log(mm(['a.js', 'a.txt'], ['*.js'])); - * //=> [ 'a.js' ] - * ``` - * @param {String|Array} `list` List of strings to match. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) - * @return {Array} Returns an array of matches - * @summary false - * @api public - */ - - -const micromatch = (list, patterns, options) => { - patterns = [].concat(patterns); - list = [].concat(list); - let omit = new Set(); - let keep = new Set(); - let items = new Set(); - let negatives = 0; - - let onResult = state => { - items.add(state.output); - - if (options && options.onResult) { - options.onResult(state); - } - }; - - for (let i = 0; i < patterns.length; i++) { - let isMatch = picomatch(String(patterns[i]), { ...options, - onResult - }, true); - let negated = isMatch.state.negated || isMatch.state.negatedExtglob; - if (negated) negatives++; - - for (let item of list) { - let matched = isMatch(item, true); - let match = negated ? !matched.isMatch : matched.isMatch; - if (!match) continue; - - if (negated) { - omit.add(matched.output); - } else { - omit.delete(matched.output); - keep.add(matched.output); - } - } - } - - let result = negatives === patterns.length ? [...items] : [...keep]; - let matches = result.filter(item => !omit.has(item)); - - if (options && matches.length === 0) { - if (options.failglob === true) { - throw new Error(`No matches found for "${patterns.join(', ')}"`); - } - - if (options.nonull === true || options.nullglob === true) { - return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns; - } - } - - return matches; -}; -/** - * Backwards compatibility - */ - - -micromatch.match = micromatch; -/** - * Returns a matcher function from the given glob `pattern` and `options`. - * The returned function takes a string to match as its only argument and returns - * true if the string is a match. - * - * ```js - * const mm = require('micromatch'); - * // mm.matcher(pattern[, options]); - * - * const isMatch = mm.matcher('*.!(*a)'); - * console.log(isMatch('a.a')); //=> false - * console.log(isMatch('a.b')); //=> true - * ``` - * @param {String} `pattern` Glob pattern - * @param {Object} `options` - * @return {Function} Returns a matcher function. - * @api public - */ - -micromatch.matcher = (pattern, options) => picomatch(pattern, options); -/** - * Returns true if **any** of the given glob `patterns` match the specified `string`. - * - * ```js - * const mm = require('micromatch'); - * // mm.isMatch(string, patterns[, options]); - * - * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true - * console.log(mm.isMatch('a.a', 'b.*')); //=> false - * ``` - * @param {String} `str` The string to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `[options]` See available [options](#options). - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - - -micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); -/** - * Backwards compatibility - */ - - -micromatch.any = micromatch.isMatch; -/** - * Returns a list of strings that _**do not match any**_ of the given `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.not(list, patterns[, options]); - * - * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); - * //=> ['b.b', 'c.c'] - * ``` - * @param {Array} `list` Array of strings to match. - * @param {String|Array} `patterns` One or more glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array} Returns an array of strings that **do not match** the given patterns. - * @api public - */ - -micromatch.not = function (list, patterns) { - let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - patterns = [].concat(patterns).map(String); - let result = new Set(); - let items = []; - - let onResult = state => { - if (options.onResult) options.onResult(state); - items.push(state.output); - }; - - let matches = new Set(micromatch(list, patterns, { ...options, - onResult - })); - - for (let item of items) { - if (!matches.has(item)) { - result.add(item); - } - } - - return [...result]; -}; -/** - * Returns true if the given `string` contains the given pattern. Similar - * to [.isMatch](#isMatch) but the pattern can match any part of the string. - * - * ```js - * var mm = require('micromatch'); - * // mm.contains(string, pattern[, options]); - * - * console.log(mm.contains('aa/bb/cc', '*b')); - * //=> true - * console.log(mm.contains('aa/bb/cc', '*d')); - * //=> false - * ``` - * @param {String} `str` The string to match. - * @param {String|Array} `patterns` Glob pattern to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any of the patterns matches any part of `str`. - * @api public - */ - - -micromatch.contains = (str, pattern, options) => { - if (typeof str !== 'string') { - throw new TypeError(`Expected a string: "${util.inspect(str)}"`); - } - - if (Array.isArray(pattern)) { - return pattern.some(p => micromatch.contains(str, p, options)); - } - - if (typeof pattern === 'string') { - if (isEmptyString(str) || isEmptyString(pattern)) { - return false; - } - - if (str.includes(pattern) || str.startsWith('./') && str.slice(2).includes(pattern)) { - return true; - } - } - - return micromatch.isMatch(str, pattern, { ...options, - contains: true - }); -}; -/** - * Filter the keys of the given object with the given `glob` pattern - * and `options`. Does not attempt to match nested keys. If you need this feature, - * use [glob-object][] instead. - * - * ```js - * const mm = require('micromatch'); - * // mm.matchKeys(object, patterns[, options]); - * - * const obj = { aa: 'a', ab: 'b', ac: 'c' }; - * console.log(mm.matchKeys(obj, '*b')); - * //=> { ab: 'b' } - * ``` - * @param {Object} `object` The object with keys to filter. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Object} Returns an object with only keys that match the given patterns. - * @api public - */ - - -micromatch.matchKeys = (obj, patterns, options) => { - if (!utils.isObject(obj)) { - throw new TypeError('Expected the first argument to be an object'); - } - - let keys = micromatch(Object.keys(obj), patterns, options); - let res = {}; - - for (let key of keys) res[key] = obj[key]; - - return res; -}; -/** - * Returns true if some of the strings in the given `list` match any of the given glob `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.some(list, patterns[, options]); - * - * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // true - * console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any `patterns` matches any of the strings in `list` - * @api public - */ - - -micromatch.some = (list, patterns, options) => { - let items = [].concat(list); - - for (let pattern of [].concat(patterns)) { - let isMatch = picomatch(String(pattern), options); - - if (items.some(item => isMatch(item))) { - return true; - } - } - - return false; -}; -/** - * Returns true if every string in the given `list` matches - * any of the given glob `patterns`. - * - * ```js - * const mm = require('micromatch'); - * // mm.every(list, patterns[, options]); - * - * console.log(mm.every('foo.js', ['foo.js'])); - * // true - * console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); - * // true - * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); - * // false - * console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); - * // false - * ``` - * @param {String|Array} `list` The string or array of strings to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if all `patterns` matches all of the strings in `list` - * @api public - */ - - -micromatch.every = (list, patterns, options) => { - let items = [].concat(list); - - for (let pattern of [].concat(patterns)) { - let isMatch = picomatch(String(pattern), options); - - if (!items.every(item => isMatch(item))) { - return false; - } - } - - return true; -}; -/** - * Returns true if **all** of the given `patterns` match - * the specified string. - * - * ```js - * const mm = require('micromatch'); - * // mm.all(string, patterns[, options]); - * - * console.log(mm.all('foo.js', ['foo.js'])); - * // true - * - * console.log(mm.all('foo.js', ['*.js', '!foo.js'])); - * // false - * - * console.log(mm.all('foo.js', ['*.js', 'foo.js'])); - * // true - * - * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); - * // true - * ``` - * @param {String|Array} `str` The string to test. - * @param {String|Array} `patterns` One or more glob patterns to use for matching. - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - - -micromatch.all = (str, patterns, options) => { - if (typeof str !== 'string') { - throw new TypeError(`Expected a string: "${util.inspect(str)}"`); - } - - return [].concat(patterns).every(p => picomatch(p, options)(str)); -}; -/** - * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match. - * - * ```js - * const mm = require('micromatch'); - * // mm.capture(pattern, string[, options]); - * - * console.log(mm.capture('test/*.js', 'test/foo.js')); - * //=> ['foo'] - * console.log(mm.capture('test/*.js', 'foo/bar.css')); - * //=> null - * ``` - * @param {String} `glob` Glob pattern to use for matching. - * @param {String} `input` String to match - * @param {Object} `options` See available [options](#options) for changing how matches are performed - * @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`. - * @api public - */ - - -micromatch.capture = (glob, input, options) => { - let posix = utils.isWindows(options); - let regex = picomatch.makeRe(String(glob), { ...options, - capture: true - }); - let match = regex.exec(posix ? utils.toPosixSlashes(input) : input); - - if (match) { - return match.slice(1).map(v => v === void 0 ? '' : v); - } -}; -/** - * Create a regular expression from the given glob `pattern`. - * - * ```js - * const mm = require('micromatch'); - * // mm.makeRe(pattern[, options]); - * - * console.log(mm.makeRe('*.js')); - * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ - * ``` - * @param {String} `pattern` A glob pattern to convert to regex. - * @param {Object} `options` - * @return {RegExp} Returns a regex created from the given pattern. - * @api public - */ - - -micromatch.makeRe = function () { - return picomatch.makeRe(...arguments); -}; -/** - * Scan a glob pattern to separate the pattern into segments. Used - * by the [split](#split) method. - * - * ```js - * const mm = require('micromatch'); - * const state = mm.scan(pattern[, options]); - * ``` - * @param {String} `pattern` - * @param {Object} `options` - * @return {Object} Returns an object with - * @api public - */ - - -micromatch.scan = function () { - return picomatch.scan(...arguments); -}; -/** - * Parse a glob pattern to create the source string for a regular - * expression. - * - * ```js - * const mm = require('micromatch'); - * const state = mm.parse(pattern[, options]); - * ``` - * @param {String} `glob` - * @param {Object} `options` - * @return {Object} Returns an object with useful properties and output to be used as regex source string. - * @api public - */ - - -micromatch.parse = (patterns, options) => { - let res = []; - - for (let pattern of [].concat(patterns || [])) { - for (let str of braces(String(pattern), options)) { - res.push(picomatch.parse(str, options)); - } - } - - return res; -}; -/** - * Process the given brace `pattern`. - * - * ```js - * const { braces } = require('micromatch'); - * console.log(braces('foo/{a,b,c}/bar')); - * //=> [ 'foo/(a|b|c)/bar' ] - * - * console.log(braces('foo/{a,b,c}/bar', { expand: true })); - * //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ] - * ``` - * @param {String} `pattern` String with brace pattern to process. - * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options. - * @return {Array} - * @api public - */ - - -micromatch.braces = (pattern, options) => { - if (typeof pattern !== 'string') throw new TypeError('Expected a string'); - - if (options && options.nobrace === true || !/\{.*\}/.test(pattern)) { - return [pattern]; - } - - return braces(pattern, options); -}; -/** - * Expand braces - */ - - -micromatch.braceExpand = (pattern, options) => { - if (typeof pattern !== 'string') throw new TypeError('Expected a string'); - return micromatch.braces(pattern, { ...options, - expand: true - }); -}; -/** - * Expose micromatch - */ - - -module.exports = micromatch; - -/***/ }), -/* 1036 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const stringify = __webpack_require__(1037); - -const compile = __webpack_require__(1039); - -const expand = __webpack_require__(1043); - -const parse = __webpack_require__(1044); -/** - * Expand the given pattern or create a regex-compatible string. - * - * ```js - * const braces = require('braces'); - * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)'] - * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c'] - * ``` - * @param {String} `str` - * @param {Object} `options` - * @return {String} - * @api public - */ - - -const braces = function (input) { - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - let output = []; - - if (Array.isArray(input)) { - for (let pattern of input) { - let result = braces.create(pattern, options); - - if (Array.isArray(result)) { - output.push(...result); - } else { - output.push(result); - } - } - } else { - output = [].concat(braces.create(input, options)); - } - - if (options && options.expand === true && options.nodupes === true) { - output = [...new Set(output)]; - } - - return output; -}; -/** - * Parse the given `str` with the given `options`. - * - * ```js - * // braces.parse(pattern, [, options]); - * const ast = braces.parse('a/{b,c}/d'); - * console.log(ast); - * ``` - * @param {String} pattern Brace pattern to parse - * @param {Object} options - * @return {Object} Returns an AST - * @api public - */ - - -braces.parse = function (input) { - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - return parse(input, options); -}; -/** - * Creates a braces string from an AST, or an AST node. - * - * ```js - * const braces = require('braces'); - * let ast = braces.parse('foo/{a,b}/bar'); - * console.log(stringify(ast.nodes[2])); //=> '{a,b}' - * ``` - * @param {String} `input` Brace pattern or AST. - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - - -braces.stringify = function (input) { - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - if (typeof input === 'string') { - return stringify(braces.parse(input, options), options); - } - - return stringify(input, options); -}; -/** - * Compiles a brace pattern into a regex-compatible, optimized string. - * This method is called by the main [braces](#braces) function by default. - * - * ```js - * const braces = require('braces'); - * console.log(braces.compile('a/{b,c}/d')); - * //=> ['a/(b|c)/d'] - * ``` - * @param {String} `input` Brace pattern or AST. - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - - -braces.compile = function (input) { - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - if (typeof input === 'string') { - input = braces.parse(input, options); - } - - return compile(input, options); -}; -/** - * Expands a brace pattern into an array. This method is called by the - * main [braces](#braces) function when `options.expand` is true. Before - * using this method it's recommended that you read the [performance notes](#performance)) - * and advantages of using [.compile](#compile) instead. - * - * ```js - * const braces = require('braces'); - * console.log(braces.expand('a/{b,c}/d')); - * //=> ['a/b/d', 'a/c/d']; - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - - -braces.expand = function (input) { - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - if (typeof input === 'string') { - input = braces.parse(input, options); - } - - let result = expand(input, options); // filter out empty strings if specified - - if (options.noempty === true) { - result = result.filter(Boolean); - } // filter out duplicates if specified - - - if (options.nodupes === true) { - result = [...new Set(result)]; - } - - return result; -}; -/** - * Processes a brace pattern and returns either an expanded array - * (if `options.expand` is true), a highly optimized regex-compatible string. - * This method is called by the main [braces](#braces) function. - * - * ```js - * const braces = require('braces'); - * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) - * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - - -braces.create = function (input) { - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - if (input === '' || input.length < 3) { - return [input]; - } - - return options.expand !== true ? braces.compile(input, options) : braces.expand(input, options); -}; -/** - * Expose "braces" - */ - - -module.exports = braces; - -/***/ }), -/* 1037 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const utils = __webpack_require__(1038); - -module.exports = function (ast) { - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - let stringify = function (node) { - let parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent); - let invalidNode = node.invalid === true && options.escapeInvalid === true; - let output = ''; - - if (node.value) { - if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { - return '\\' + node.value; - } - - return node.value; - } - - if (node.value) { - return node.value; - } - - if (node.nodes) { - for (let child of node.nodes) { - output += stringify(child); - } - } - - return output; - }; - - return stringify(ast); -}; - -/***/ }), -/* 1038 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -exports.isInteger = num => { - if (typeof num === 'number') { - return Number.isInteger(num); - } - - if (typeof num === 'string' && num.trim() !== '') { - return Number.isInteger(Number(num)); - } - - return false; -}; -/** - * Find a node of the given type - */ - - -exports.find = (node, type) => node.nodes.find(node => node.type === type); -/** - * Find a node of the given type - */ - - -exports.exceedsLimit = function (min, max) { - let step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; - let limit = arguments.length > 3 ? arguments[3] : undefined; - if (limit === false) return false; - if (!exports.isInteger(min) || !exports.isInteger(max)) return false; - return (Number(max) - Number(min)) / Number(step) >= limit; -}; -/** - * Escape the given node with '\\' before node.value - */ - - -exports.escapeNode = function (block) { - let n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - let type = arguments.length > 2 ? arguments[2] : undefined; - let node = block.nodes[n]; - if (!node) return; - - if (type && node.type === type || node.type === 'open' || node.type === 'close') { - if (node.escaped !== true) { - node.value = '\\' + node.value; - node.escaped = true; - } - } -}; -/** - * Returns true if the given brace node should be enclosed in literal braces - */ - - -exports.encloseBrace = node => { - if (node.type !== 'brace') return false; - - if (node.commas >> 0 + node.ranges >> 0 === 0) { - node.invalid = true; - return true; - } - - return false; -}; -/** - * Returns true if a brace node is invalid. - */ - - -exports.isInvalidBrace = block => { - if (block.type !== 'brace') return false; - if (block.invalid === true || block.dollar) return true; - - if (block.commas >> 0 + block.ranges >> 0 === 0) { - block.invalid = true; - return true; - } - - if (block.open !== true || block.close !== true) { - block.invalid = true; - return true; - } - - return false; -}; -/** - * Returns true if a node is an open or close node - */ - - -exports.isOpenOrClose = node => { - if (node.type === 'open' || node.type === 'close') { - return true; - } - - return node.open === true || node.close === true; -}; -/** - * Reduce an array of text nodes. - */ - - -exports.reduce = nodes => nodes.reduce((acc, node) => { - if (node.type === 'text') acc.push(node.value); - if (node.type === 'range') node.type = 'text'; - return acc; -}, []); -/** - * Flatten an array - */ - - -exports.flatten = function () { - const result = []; - - const flat = arr => { - for (let i = 0; i < arr.length; i++) { - let ele = arr[i]; - Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele); - } - - return result; - }; - - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - flat(args); - return result; -}; - -/***/ }), -/* 1039 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fill = __webpack_require__(1040); - -const utils = __webpack_require__(1038); - -const compile = function (ast) { - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - let walk = function (node) { - let parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - let invalidBlock = utils.isInvalidBrace(parent); - let invalidNode = node.invalid === true && options.escapeInvalid === true; - let invalid = invalidBlock === true || invalidNode === true; - let prefix = options.escapeInvalid === true ? '\\' : ''; - let output = ''; - - if (node.isOpen === true) { - return prefix + node.value; - } - - if (node.isClose === true) { - return prefix + node.value; - } - - if (node.type === 'open') { - return invalid ? prefix + node.value : '('; - } - - if (node.type === 'close') { - return invalid ? prefix + node.value : ')'; - } - - if (node.type === 'comma') { - return node.prev.type === 'comma' ? '' : invalid ? node.value : '|'; - } - - if (node.value) { - return node.value; - } - - if (node.nodes && node.ranges > 0) { - let args = utils.reduce(node.nodes); - let range = fill(...args, { ...options, - wrap: false, - toRegex: true - }); - - if (range.length !== 0) { - return args.length > 1 && range.length > 1 ? `(${range})` : range; - } - } - - if (node.nodes) { - for (let child of node.nodes) { - output += walk(child, node); - } - } - - return output; - }; - - return walk(ast); -}; - -module.exports = compile; - -/***/ }), -/* 1040 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -/*! - * fill-range - * - * Copyright (c) 2014-present, Jon Schlinkert. - * Licensed under the MIT License. - */ - - -const util = __webpack_require__(516); - -const toRegexRange = __webpack_require__(1041); - -const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); - -const transform = toNumber => { - return value => toNumber === true ? Number(value) : String(value); -}; - -const isValidValue = value => { - return typeof value === 'number' || typeof value === 'string' && value !== ''; -}; - -const isNumber = num => Number.isInteger(+num); - -const zeros = input => { - let value = `${input}`; - let index = -1; - if (value[0] === '-') value = value.slice(1); - if (value === '0') return false; - - while (value[++index] === '0'); - - return index > 0; -}; - -const stringify = (start, end, options) => { - if (typeof start === 'string' || typeof end === 'string') { - return true; - } - - return options.stringify === true; -}; - -const pad = (input, maxLength, toNumber) => { - if (maxLength > 0) { - let dash = input[0] === '-' ? '-' : ''; - if (dash) input = input.slice(1); - input = dash + input.padStart(dash ? maxLength - 1 : maxLength, '0'); - } - - if (toNumber === false) { - return String(input); - } - - return input; -}; - -const toMaxLen = (input, maxLength) => { - let negative = input[0] === '-' ? '-' : ''; - - if (negative) { - input = input.slice(1); - maxLength--; - } - - while (input.length < maxLength) input = '0' + input; - - return negative ? '-' + input : input; -}; - -const toSequence = (parts, options) => { - parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); - parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); - let prefix = options.capture ? '' : '?:'; - let positives = ''; - let negatives = ''; - let result; - - if (parts.positives.length) { - positives = parts.positives.join('|'); - } - - if (parts.negatives.length) { - negatives = `-(${prefix}${parts.negatives.join('|')})`; - } - - if (positives && negatives) { - result = `${positives}|${negatives}`; - } else { - result = positives || negatives; - } - - if (options.wrap) { - return `(${prefix}${result})`; - } - - return result; -}; - -const toRange = (a, b, isNumbers, options) => { - if (isNumbers) { - return toRegexRange(a, b, { - wrap: false, - ...options - }); - } - - let start = String.fromCharCode(a); - if (a === b) return start; - let stop = String.fromCharCode(b); - return `[${start}-${stop}]`; -}; - -const toRegex = (start, end, options) => { - if (Array.isArray(start)) { - let wrap = options.wrap === true; - let prefix = options.capture ? '' : '?:'; - return wrap ? `(${prefix}${start.join('|')})` : start.join('|'); - } - - return toRegexRange(start, end, options); -}; - -const rangeError = function () { - return new RangeError('Invalid range arguments: ' + util.inspect(...arguments)); -}; - -const invalidRange = (start, end, options) => { - if (options.strictRanges === true) throw rangeError([start, end]); - return []; -}; - -const invalidStep = (step, options) => { - if (options.strictRanges === true) { - throw new TypeError(`Expected step "${step}" to be a number`); - } - - return []; -}; - -const fillNumbers = function (start, end) { - let step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; - let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - let a = Number(start); - let b = Number(end); - - if (!Number.isInteger(a) || !Number.isInteger(b)) { - if (options.strictRanges === true) throw rangeError([start, end]); - return []; - } // fix negative zero - - - if (a === 0) a = 0; - if (b === 0) b = 0; - let descending = a > b; - let startString = String(start); - let endString = String(end); - let stepString = String(step); - step = Math.max(Math.abs(step), 1); - let padded = zeros(startString) || zeros(endString) || zeros(stepString); - let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; - let toNumber = padded === false && stringify(start, end, options) === false; - let format = options.transform || transform(toNumber); - - if (options.toRegex && step === 1) { - return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); - } - - let parts = { - negatives: [], - positives: [] - }; - - let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num)); - - let range = []; - let index = 0; - - while (descending ? a >= b : a <= b) { - if (options.toRegex === true && step > 1) { - push(a); - } else { - range.push(pad(format(a, index), maxLen, toNumber)); - } - - a = descending ? a - step : a + step; - index++; - } - - if (options.toRegex === true) { - return step > 1 ? toSequence(parts, options) : toRegex(range, null, { - wrap: false, - ...options - }); - } - - return range; -}; - -const fillLetters = function (start, end) { - let step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; - let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - - if (!isNumber(start) && start.length > 1 || !isNumber(end) && end.length > 1) { - return invalidRange(start, end, options); - } - - let format = options.transform || (val => String.fromCharCode(val)); - - let a = `${start}`.charCodeAt(0); - let b = `${end}`.charCodeAt(0); - let descending = a > b; - let min = Math.min(a, b); - let max = Math.max(a, b); - - if (options.toRegex && step === 1) { - return toRange(min, max, false, options); - } - - let range = []; - let index = 0; - - while (descending ? a >= b : a <= b) { - range.push(format(a, index)); - a = descending ? a - step : a + step; - index++; - } - - if (options.toRegex === true) { - return toRegex(range, null, { - wrap: false, - options - }); - } - - return range; -}; - -const fill = function (start, end, step) { - let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - - if (end == null && isValidValue(start)) { - return [start]; - } - - if (!isValidValue(start) || !isValidValue(end)) { - return invalidRange(start, end, options); - } - - if (typeof step === 'function') { - return fill(start, end, 1, { - transform: step - }); - } - - if (isObject(step)) { - return fill(start, end, 0, step); - } - - let opts = { ...options - }; - if (opts.capture === true) opts.wrap = true; - step = step || opts.step || 1; - - if (!isNumber(step)) { - if (step != null && !isObject(step)) return invalidStep(step, opts); - return fill(start, end, 1, step); - } - - if (isNumber(start) && isNumber(end)) { - return fillNumbers(start, end, step, opts); - } - - return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); -}; - -module.exports = fill; - -/***/ }), -/* 1041 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -/*! - * to-regex-range - * - * Copyright (c) 2015-present, Jon Schlinkert. - * Released under the MIT License. - */ - - -const isNumber = __webpack_require__(1042); - -const toRegexRange = (min, max, options) => { - if (isNumber(min) === false) { - throw new TypeError('toRegexRange: expected the first argument to be a number'); - } - - if (max === void 0 || min === max) { - return String(min); - } - - if (isNumber(max) === false) { - throw new TypeError('toRegexRange: expected the second argument to be a number.'); - } - - let opts = { - relaxZeros: true, - ...options - }; - - if (typeof opts.strictZeros === 'boolean') { - opts.relaxZeros = opts.strictZeros === false; - } - - let relax = String(opts.relaxZeros); - let shorthand = String(opts.shorthand); - let capture = String(opts.capture); - let wrap = String(opts.wrap); - let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap; - - if (toRegexRange.cache.hasOwnProperty(cacheKey)) { - return toRegexRange.cache[cacheKey].result; - } - - let a = Math.min(min, max); - let b = Math.max(min, max); - - if (Math.abs(a - b) === 1) { - let result = min + '|' + max; - - if (opts.capture) { - return `(${result})`; - } - - if (opts.wrap === false) { - return result; - } - - return `(?:${result})`; - } - - let isPadded = hasPadding(min) || hasPadding(max); - let state = { - min, - max, - a, - b - }; - let positives = []; - let negatives = []; - - if (isPadded) { - state.isPadded = isPadded; - state.maxLen = String(state.max).length; - } - - if (a < 0) { - let newMin = b < 0 ? Math.abs(b) : 1; - negatives = splitToPatterns(newMin, Math.abs(a), state, opts); - a = state.a = 0; - } - - if (b >= 0) { - positives = splitToPatterns(a, b, state, opts); - } - - state.negatives = negatives; - state.positives = positives; - state.result = collatePatterns(negatives, positives, opts); - - if (opts.capture === true) { - state.result = `(${state.result})`; - } else if (opts.wrap !== false && positives.length + negatives.length > 1) { - state.result = `(?:${state.result})`; - } - - toRegexRange.cache[cacheKey] = state; - return state.result; -}; - -function collatePatterns(neg, pos, options) { - let onlyNegative = filterPatterns(neg, pos, '-', false, options) || []; - let onlyPositive = filterPatterns(pos, neg, '', false, options) || []; - let intersected = filterPatterns(neg, pos, '-?', true, options) || []; - let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); - return subpatterns.join('|'); -} - -function splitToRanges(min, max) { - let nines = 1; - let zeros = 1; - let stop = countNines(min, nines); - let stops = new Set([max]); - - while (min <= stop && stop <= max) { - stops.add(stop); - nines += 1; - stop = countNines(min, nines); - } - - stop = countZeros(max + 1, zeros) - 1; - - while (min < stop && stop <= max) { - stops.add(stop); - zeros += 1; - stop = countZeros(max + 1, zeros) - 1; - } - - stops = [...stops]; - stops.sort(compare); - return stops; -} -/** - * Convert a range to a regex pattern - * @param {Number} `start` - * @param {Number} `stop` - * @return {String} - */ - - -function rangeToPattern(start, stop, options) { - if (start === stop) { - return { - pattern: start, - count: [], - digits: 0 - }; - } - - let zipped = zip(start, stop); - let digits = zipped.length; - let pattern = ''; - let count = 0; - - for (let i = 0; i < digits; i++) { - let [startDigit, stopDigit] = zipped[i]; - - if (startDigit === stopDigit) { - pattern += startDigit; - } else if (startDigit !== '0' || stopDigit !== '9') { - pattern += toCharacterClass(startDigit, stopDigit, options); - } else { - count++; - } - } - - if (count) { - pattern += options.shorthand === true ? '\\d' : '[0-9]'; - } - - return { - pattern, - count: [count], - digits - }; -} - -function splitToPatterns(min, max, tok, options) { - let ranges = splitToRanges(min, max); - let tokens = []; - let start = min; - let prev; - - for (let i = 0; i < ranges.length; i++) { - let max = ranges[i]; - let obj = rangeToPattern(String(start), String(max), options); - let zeros = ''; - - if (!tok.isPadded && prev && prev.pattern === obj.pattern) { - if (prev.count.length > 1) { - prev.count.pop(); - } - - prev.count.push(obj.count[0]); - prev.string = prev.pattern + toQuantifier(prev.count); - start = max + 1; - continue; - } - - if (tok.isPadded) { - zeros = padZeros(max, tok, options); - } - - obj.string = zeros + obj.pattern + toQuantifier(obj.count); - tokens.push(obj); - start = max + 1; - prev = obj; - } - - return tokens; -} - -function filterPatterns(arr, comparison, prefix, intersection, options) { - let result = []; - - for (let ele of arr) { - let { - string - } = ele; // only push if _both_ are negative... - - if (!intersection && !contains(comparison, 'string', string)) { - result.push(prefix + string); - } // or _both_ are positive - - - if (intersection && contains(comparison, 'string', string)) { - result.push(prefix + string); - } - } - - return result; -} -/** - * Zip strings - */ - - -function zip(a, b) { - let arr = []; - - for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]); - - return arr; -} - -function compare(a, b) { - return a > b ? 1 : b > a ? -1 : 0; -} - -function contains(arr, key, val) { - return arr.some(ele => ele[key] === val); -} - -function countNines(min, len) { - return Number(String(min).slice(0, -len) + '9'.repeat(len)); -} - -function countZeros(integer, zeros) { - return integer - integer % Math.pow(10, zeros); -} - -function toQuantifier(digits) { - let [start = 0, stop = ''] = digits; - - if (stop || start > 1) { - return `{${start + (stop ? ',' + stop : '')}}`; - } - - return ''; -} - -function toCharacterClass(a, b, options) { - return `[${a}${b - a === 1 ? '' : '-'}${b}]`; -} - -function hasPadding(str) { - return /^-?(0+)\d/.test(str); -} - -function padZeros(value, tok, options) { - if (!tok.isPadded) { - return value; - } - - let diff = Math.abs(tok.maxLen - String(value).length); - let relax = options.relaxZeros !== false; - - switch (diff) { - case 0: - return ''; - - case 1: - return relax ? '0?' : '0'; - - case 2: - return relax ? '0{0,2}' : '00'; - - default: - { - return relax ? `0{0,${diff}}` : `0{${diff}}`; - } - } -} -/** - * Cache - */ - - -toRegexRange.cache = {}; - -toRegexRange.clearCache = () => toRegexRange.cache = {}; -/** - * Expose `toRegexRange` - */ - - -module.exports = toRegexRange; - -/***/ }), -/* 1042 */ -/***/ ((module) => { - -"use strict"; -/*! - * is-number - * - * Copyright (c) 2014-present, Jon Schlinkert. - * Released under the MIT License. - */ - - -module.exports = function (num) { - if (typeof num === 'number') { - return num - num === 0; - } - - if (typeof num === 'string' && num.trim() !== '') { - return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); - } - - return false; -}; - -/***/ }), -/* 1043 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const fill = __webpack_require__(1040); - -const stringify = __webpack_require__(1037); - -const utils = __webpack_require__(1038); - -const append = function () { - let queue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - let stash = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - let enclose = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - let result = []; - queue = [].concat(queue); - stash = [].concat(stash); - if (!stash.length) return queue; - - if (!queue.length) { - return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash; - } - - for (let item of queue) { - if (Array.isArray(item)) { - for (let value of item) { - result.push(append(value, stash, enclose)); - } - } else { - for (let ele of stash) { - if (enclose === true && typeof ele === 'string') ele = `{${ele}}`; - result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele); - } - } - } - - return utils.flatten(result); -}; - -const expand = function (ast) { - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit; - - let walk = function (node) { - let parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - node.queue = []; - let p = parent; - let q = parent.queue; - - while (p.type !== 'brace' && p.type !== 'root' && p.parent) { - p = p.parent; - q = p.queue; - } - - if (node.invalid || node.dollar) { - q.push(append(q.pop(), stringify(node, options))); - return; - } - - if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) { - q.push(append(q.pop(), ['{}'])); - return; - } - - if (node.nodes && node.ranges > 0) { - let args = utils.reduce(node.nodes); - - if (utils.exceedsLimit(...args, options.step, rangeLimit)) { - throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); - } - - let range = fill(...args, options); - - if (range.length === 0) { - range = stringify(node, options); - } - - q.push(append(q.pop(), range)); - node.nodes = []; - return; - } - - let enclose = utils.encloseBrace(node); - let queue = node.queue; - let block = node; - - while (block.type !== 'brace' && block.type !== 'root' && block.parent) { - block = block.parent; - queue = block.queue; - } - - for (let i = 0; i < node.nodes.length; i++) { - let child = node.nodes[i]; - - if (child.type === 'comma' && node.type === 'brace') { - if (i === 1) queue.push(''); - queue.push(''); - continue; - } - - if (child.type === 'close') { - q.push(append(q.pop(), queue, enclose)); - continue; - } - - if (child.value && child.type !== 'open') { - queue.push(append(queue.pop(), child.value)); - continue; - } - - if (child.nodes) { - walk(child, node); - } - } - - return queue; - }; - - return utils.flatten(walk(ast)); -}; - -module.exports = expand; - -/***/ }), -/* 1044 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const stringify = __webpack_require__(1037); -/** - * Constants - */ - - -const { - MAX_LENGTH, - CHAR_BACKSLASH, - - /* \ */ - CHAR_BACKTICK, - - /* ` */ - CHAR_COMMA, - - /* , */ - CHAR_DOT, - - /* . */ - CHAR_LEFT_PARENTHESES, - - /* ( */ - CHAR_RIGHT_PARENTHESES, - - /* ) */ - CHAR_LEFT_CURLY_BRACE, - - /* { */ - CHAR_RIGHT_CURLY_BRACE, - - /* } */ - CHAR_LEFT_SQUARE_BRACKET, - - /* [ */ - CHAR_RIGHT_SQUARE_BRACKET, - - /* ] */ - CHAR_DOUBLE_QUOTE, - - /* " */ - CHAR_SINGLE_QUOTE, - - /* ' */ - CHAR_NO_BREAK_SPACE, - CHAR_ZERO_WIDTH_NOBREAK_SPACE -} = __webpack_require__(1045); -/** - * parse - */ - - -const parse = function (input) { - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - if (typeof input !== 'string') { - throw new TypeError('Expected a string'); - } - - let opts = options || {}; - let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; - - if (input.length > max) { - throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); - } - - let ast = { - type: 'root', - input, - nodes: [] - }; - let stack = [ast]; - let block = ast; - let prev = ast; - let brackets = 0; - let length = input.length; - let index = 0; - let depth = 0; - let value; - let memo = {}; - /** - * Helpers - */ - - const advance = () => input[index++]; - - const push = node => { - if (node.type === 'text' && prev.type === 'dot') { - prev.type = 'text'; - } - - if (prev && prev.type === 'text' && node.type === 'text') { - prev.value += node.value; - return; - } - - block.nodes.push(node); - node.parent = block; - node.prev = prev; - prev = node; - return node; - }; - - push({ - type: 'bos' - }); - - while (index < length) { - block = stack[stack.length - 1]; - value = advance(); - /** - * Invalid chars - */ - - if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { - continue; - } - /** - * Escaped chars - */ - - - if (value === CHAR_BACKSLASH) { - push({ - type: 'text', - value: (options.keepEscaping ? value : '') + advance() - }); - continue; - } - /** - * Right square bracket (literal): ']' - */ - - - if (value === CHAR_RIGHT_SQUARE_BRACKET) { - push({ - type: 'text', - value: '\\' + value - }); - continue; - } - /** - * Left square bracket: '[' - */ - - - if (value === CHAR_LEFT_SQUARE_BRACKET) { - brackets++; - let closed = true; - let next; - - while (index < length && (next = advance())) { - value += next; - - if (next === CHAR_LEFT_SQUARE_BRACKET) { - brackets++; - continue; - } - - if (next === CHAR_BACKSLASH) { - value += advance(); - continue; - } - - if (next === CHAR_RIGHT_SQUARE_BRACKET) { - brackets--; - - if (brackets === 0) { - break; - } - } - } - - push({ - type: 'text', - value - }); - continue; - } - /** - * Parentheses - */ - - - if (value === CHAR_LEFT_PARENTHESES) { - block = push({ - type: 'paren', - nodes: [] - }); - stack.push(block); - push({ - type: 'text', - value - }); - continue; - } - - if (value === CHAR_RIGHT_PARENTHESES) { - if (block.type !== 'paren') { - push({ - type: 'text', - value - }); - continue; - } - - block = stack.pop(); - push({ - type: 'text', - value - }); - block = stack[stack.length - 1]; - continue; - } - /** - * Quotes: '|"|` - */ - - - if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { - let open = value; - let next; - - if (options.keepQuotes !== true) { - value = ''; - } - - while (index < length && (next = advance())) { - if (next === CHAR_BACKSLASH) { - value += next + advance(); - continue; - } - - if (next === open) { - if (options.keepQuotes === true) value += next; - break; - } - - value += next; - } - - push({ - type: 'text', - value - }); - continue; - } - /** - * Left curly brace: '{' - */ - - - if (value === CHAR_LEFT_CURLY_BRACE) { - depth++; - let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; - let brace = { - type: 'brace', - open: true, - close: false, - dollar, - depth, - commas: 0, - ranges: 0, - nodes: [] - }; - block = push(brace); - stack.push(block); - push({ - type: 'open', - value - }); - continue; - } - /** - * Right curly brace: '}' - */ - - - if (value === CHAR_RIGHT_CURLY_BRACE) { - if (block.type !== 'brace') { - push({ - type: 'text', - value - }); - continue; - } - - let type = 'close'; - block = stack.pop(); - block.close = true; - push({ - type, - value - }); - depth--; - block = stack[stack.length - 1]; - continue; - } - /** - * Comma: ',' - */ - - - if (value === CHAR_COMMA && depth > 0) { - if (block.ranges > 0) { - block.ranges = 0; - let open = block.nodes.shift(); - block.nodes = [open, { - type: 'text', - value: stringify(block) - }]; - } - - push({ - type: 'comma', - value - }); - block.commas++; - continue; - } - /** - * Dot: '.' - */ - - - if (value === CHAR_DOT && depth > 0 && block.commas === 0) { - let siblings = block.nodes; - - if (depth === 0 || siblings.length === 0) { - push({ - type: 'text', - value - }); - continue; - } - - if (prev.type === 'dot') { - block.range = []; - prev.value += value; - prev.type = 'range'; - - if (block.nodes.length !== 3 && block.nodes.length !== 5) { - block.invalid = true; - block.ranges = 0; - prev.type = 'text'; - continue; - } - - block.ranges++; - block.args = []; - continue; - } - - if (prev.type === 'range') { - siblings.pop(); - let before = siblings[siblings.length - 1]; - before.value += prev.value + value; - prev = before; - block.ranges--; - continue; - } - - push({ - type: 'dot', - value - }); - continue; - } - /** - * Text - */ - - - push({ - type: 'text', - value - }); - } // Mark imbalanced braces and brackets as invalid - - - do { - block = stack.pop(); - - if (block.type !== 'root') { - block.nodes.forEach(node => { - if (!node.nodes) { - if (node.type === 'open') node.isOpen = true; - if (node.type === 'close') node.isClose = true; - if (!node.nodes) node.type = 'text'; - node.invalid = true; - } - }); // get the location of the block on parent.nodes (block's siblings) - - let parent = stack[stack.length - 1]; - let index = parent.nodes.indexOf(block); // replace the (invalid) block with it's nodes - - parent.nodes.splice(index, 1, ...block.nodes); - } - } while (stack.length > 0); - - push({ - type: 'eos' - }); - return ast; -}; - -module.exports = parse; - -/***/ }), -/* 1045 */ -/***/ ((module) => { - -"use strict"; - - -module.exports = { - MAX_LENGTH: 1024 * 64, - // Digits - CHAR_0: '0', - - /* 0 */ - CHAR_9: '9', - - /* 9 */ - // Alphabet chars. - CHAR_UPPERCASE_A: 'A', - - /* A */ - CHAR_LOWERCASE_A: 'a', - - /* a */ - CHAR_UPPERCASE_Z: 'Z', - - /* Z */ - CHAR_LOWERCASE_Z: 'z', - - /* z */ - CHAR_LEFT_PARENTHESES: '(', - - /* ( */ - CHAR_RIGHT_PARENTHESES: ')', - - /* ) */ - CHAR_ASTERISK: '*', - - /* * */ - // Non-alphabetic chars. - CHAR_AMPERSAND: '&', - - /* & */ - CHAR_AT: '@', - - /* @ */ - CHAR_BACKSLASH: '\\', - - /* \ */ - CHAR_BACKTICK: '`', - - /* ` */ - CHAR_CARRIAGE_RETURN: '\r', - - /* \r */ - CHAR_CIRCUMFLEX_ACCENT: '^', - - /* ^ */ - CHAR_COLON: ':', - - /* : */ - CHAR_COMMA: ',', - - /* , */ - CHAR_DOLLAR: '$', - - /* . */ - CHAR_DOT: '.', - - /* . */ - CHAR_DOUBLE_QUOTE: '"', - - /* " */ - CHAR_EQUAL: '=', - - /* = */ - CHAR_EXCLAMATION_MARK: '!', - - /* ! */ - CHAR_FORM_FEED: '\f', - - /* \f */ - CHAR_FORWARD_SLASH: '/', - - /* / */ - CHAR_HASH: '#', - - /* # */ - CHAR_HYPHEN_MINUS: '-', - - /* - */ - CHAR_LEFT_ANGLE_BRACKET: '<', - - /* < */ - CHAR_LEFT_CURLY_BRACE: '{', - - /* { */ - CHAR_LEFT_SQUARE_BRACKET: '[', - - /* [ */ - CHAR_LINE_FEED: '\n', - - /* \n */ - CHAR_NO_BREAK_SPACE: '\u00A0', - - /* \u00A0 */ - CHAR_PERCENT: '%', - - /* % */ - CHAR_PLUS: '+', - - /* + */ - CHAR_QUESTION_MARK: '?', - - /* ? */ - CHAR_RIGHT_ANGLE_BRACKET: '>', - - /* > */ - CHAR_RIGHT_CURLY_BRACE: '}', - - /* } */ - CHAR_RIGHT_SQUARE_BRACKET: ']', - - /* ] */ - CHAR_SEMICOLON: ';', - - /* ; */ - CHAR_SINGLE_QUOTE: '\'', - - /* ' */ - CHAR_SPACE: ' ', - - /* */ - CHAR_TAB: '\t', - - /* \t */ - CHAR_UNDERSCORE: '_', - - /* _ */ - CHAR_VERTICAL_LINE: '|', - - /* | */ - CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' - /* \uFEFF */ - -}; - -/***/ }), -/* 1046 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -module.exports = __webpack_require__(1047); - -/***/ }), -/* 1047 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const path = __webpack_require__(501); - -const scan = __webpack_require__(1048); - -const parse = __webpack_require__(1051); - -const utils = __webpack_require__(1049); - -const constants = __webpack_require__(1050); - -const isObject = val => val && typeof val === 'object' && !Array.isArray(val); -/** - * Creates a matcher function from one or more glob patterns. The - * returned function takes a string to match as its first argument, - * and returns true if the string is a match. The returned matcher - * function also takes a boolean as the second argument that, when true, - * returns an object with additional information. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch(glob[, options]); - * - * const isMatch = picomatch('*.!(*a)'); - * console.log(isMatch('a.a')); //=> false - * console.log(isMatch('a.b')); //=> true - * ``` - * @name picomatch - * @param {String|Array} `globs` One or more glob patterns. - * @param {Object=} `options` - * @return {Function=} Returns a matcher function. - * @api public - */ - - -const picomatch = function (glob, options) { - let returnState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - if (Array.isArray(glob)) { - const fns = glob.map(input => picomatch(input, options, returnState)); - - const arrayMatcher = str => { - for (const isMatch of fns) { - const state = isMatch(str); - if (state) return state; - } - - return false; - }; - - return arrayMatcher; - } - - const isState = isObject(glob) && glob.tokens && glob.input; - - if (glob === '' || typeof glob !== 'string' && !isState) { - throw new TypeError('Expected pattern to be a non-empty string'); - } - - const opts = options || {}; - const posix = utils.isWindows(options); - const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true); - const state = regex.state; - delete regex.state; - - let isIgnored = () => false; - - if (opts.ignore) { - const ignoreOpts = { ...options, - ignore: null, - onMatch: null, - onResult: null - }; - isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); - } - - const matcher = function (input) { - let returnObject = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - const { - isMatch, - match, - output - } = picomatch.test(input, regex, options, { - glob, - posix - }); - const result = { - glob, - state, - regex, - posix, - input, - output, - match, - isMatch - }; - - if (typeof opts.onResult === 'function') { - opts.onResult(result); - } - - if (isMatch === false) { - result.isMatch = false; - return returnObject ? result : false; - } - - if (isIgnored(input)) { - if (typeof opts.onIgnore === 'function') { - opts.onIgnore(result); - } - - result.isMatch = false; - return returnObject ? result : false; - } - - if (typeof opts.onMatch === 'function') { - opts.onMatch(result); - } - - return returnObject ? result : true; - }; - - if (returnState) { - matcher.state = state; - } - - return matcher; -}; -/** - * Test `input` with the given `regex`. This is used by the main - * `picomatch()` function to test the input string. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.test(input, regex[, options]); - * - * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); - * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } - * ``` - * @param {String} `input` String to test. - * @param {RegExp} `regex` - * @return {Object} Returns an object with matching info. - * @api public - */ - - -picomatch.test = function (input, regex, options) { - let { - glob, - posix - } = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - - if (typeof input !== 'string') { - throw new TypeError('Expected input to be a string'); - } - - if (input === '') { - return { - isMatch: false, - output: '' - }; - } - - const opts = options || {}; - const format = opts.format || (posix ? utils.toPosixSlashes : null); - let match = input === glob; - let output = match && format ? format(input) : input; - - if (match === false) { - output = format ? format(input) : input; - match = output === glob; - } - - if (match === false || opts.capture === true) { - if (opts.matchBase === true || opts.basename === true) { - match = picomatch.matchBase(input, regex, options, posix); - } else { - match = regex.exec(output); - } - } - - return { - isMatch: Boolean(match), - match, - output - }; -}; -/** - * Match the basename of a filepath. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.matchBase(input, glob[, options]); - * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true - * ``` - * @param {String} `input` String to test. - * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). - * @return {Boolean} - * @api public - */ - - -picomatch.matchBase = function (input, glob, options) { - let posix = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : utils.isWindows(options); - const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); - return regex.test(path.basename(input)); -}; -/** - * Returns true if **any** of the given glob `patterns` match the specified `string`. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.isMatch(string, patterns[, options]); - * - * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true - * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false - * ``` - * @param {String|Array} str The string to test. - * @param {String|Array} patterns One or more glob patterns to use for matching. - * @param {Object} [options] See available [options](#options). - * @return {Boolean} Returns true if any patterns match `str` - * @api public - */ - - -picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); -/** - * Parse a glob pattern to create the source string for a regular - * expression. - * - * ```js - * const picomatch = require('picomatch'); - * const result = picomatch.parse(pattern[, options]); - * ``` - * @param {String} `pattern` - * @param {Object} `options` - * @return {Object} Returns an object with useful properties and output to be used as a regex source string. - * @api public - */ - - -picomatch.parse = (pattern, options) => { - if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); - return parse(pattern, { ...options, - fastpaths: false - }); -}; -/** - * Scan a glob pattern to separate the pattern into segments. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.scan(input[, options]); - * - * const result = picomatch.scan('!./foo/*.js'); - * console.log(result); - * { prefix: '!./', - * input: '!./foo/*.js', - * start: 3, - * base: 'foo', - * glob: '*.js', - * isBrace: false, - * isBracket: false, - * isGlob: true, - * isExtglob: false, - * isGlobstar: false, - * negated: true } - * ``` - * @param {String} `input` Glob pattern to scan. - * @param {Object} `options` - * @return {Object} Returns an object with - * @api public - */ - - -picomatch.scan = (input, options) => scan(input, options); -/** - * Compile a regular expression from the `state` object returned by the - * [parse()](#parse) method. - * - * @param {Object} `state` - * @param {Object} `options` - * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. - * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. - * @return {RegExp} - * @api public - */ - - -picomatch.compileRe = function (state, options) { - let returnOutput = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - let returnState = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; - - if (returnOutput === true) { - return state.output; - } - - const opts = options || {}; - const prepend = opts.contains ? '' : '^'; - const append = opts.contains ? '' : '$'; - let source = `${prepend}(?:${state.output})${append}`; - - if (state && state.negated === true) { - source = `^(?!${source}).*$`; - } - - const regex = picomatch.toRegex(source, options); - - if (returnState === true) { - regex.state = state; - } - - return regex; -}; -/** - * Create a regular expression from a parsed glob pattern. - * - * ```js - * const picomatch = require('picomatch'); - * const state = picomatch.parse('*.js'); - * // picomatch.compileRe(state[, options]); - * - * console.log(picomatch.compileRe(state)); - * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ - * ``` - * @param {String} `state` The object returned from the `.parse` method. - * @param {Object} `options` - * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. - * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. - * @return {RegExp} Returns a regex created from the given pattern. - * @api public - */ - - -picomatch.makeRe = function (input) { - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - let returnOutput = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - let returnState = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; - - if (!input || typeof input !== 'string') { - throw new TypeError('Expected a non-empty string'); - } - - let parsed = { - negated: false, - fastpaths: true - }; - - if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { - parsed.output = parse.fastpaths(input, options); - } - - if (!parsed.output) { - parsed = parse(input, options); - } - - return picomatch.compileRe(parsed, options, returnOutput, returnState); -}; -/** - * Create a regular expression from the given regex source string. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.toRegex(source[, options]); - * - * const { output } = picomatch.parse('*.js'); - * console.log(picomatch.toRegex(output)); - * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ - * ``` - * @param {String} `source` Regular expression source string. - * @param {Object} `options` - * @return {RegExp} - * @api public - */ - - -picomatch.toRegex = (source, options) => { - try { - const opts = options || {}; - return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); - } catch (err) { - if (options && options.debug === true) throw err; - return /$^/; - } -}; -/** - * Picomatch constants. - * @return {Object} - */ - - -picomatch.constants = constants; -/** - * Expose "picomatch" - */ - -module.exports = picomatch; - -/***/ }), -/* 1048 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const utils = __webpack_require__(1049); - -const { - CHAR_ASTERISK, - - /* * */ - CHAR_AT, - - /* @ */ - CHAR_BACKWARD_SLASH, - - /* \ */ - CHAR_COMMA, - - /* , */ - CHAR_DOT, - - /* . */ - CHAR_EXCLAMATION_MARK, - - /* ! */ - CHAR_FORWARD_SLASH, - - /* / */ - CHAR_LEFT_CURLY_BRACE, - - /* { */ - CHAR_LEFT_PARENTHESES, - - /* ( */ - CHAR_LEFT_SQUARE_BRACKET, - - /* [ */ - CHAR_PLUS, - - /* + */ - CHAR_QUESTION_MARK, - - /* ? */ - CHAR_RIGHT_CURLY_BRACE, - - /* } */ - CHAR_RIGHT_PARENTHESES, - - /* ) */ - CHAR_RIGHT_SQUARE_BRACKET - /* ] */ - -} = __webpack_require__(1050); - -const isPathSeparator = code => { - return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; -}; - -const depth = token => { - if (token.isPrefix !== true) { - token.depth = token.isGlobstar ? Infinity : 1; - } -}; -/** - * Quickly scans a glob pattern and returns an object with a handful of - * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), - * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not - * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). - * - * ```js - * const pm = require('picomatch'); - * console.log(pm.scan('foo/bar/*.js')); - * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } - * ``` - * @param {String} `str` - * @param {Object} `options` - * @return {Object} Returns an object with tokens and regex source string. - * @api public - */ - - -const scan = (input, options) => { - const opts = options || {}; - const length = input.length - 1; - const scanToEnd = opts.parts === true || opts.scanToEnd === true; - const slashes = []; - const tokens = []; - const parts = []; - let str = input; - let index = -1; - let start = 0; - let lastIndex = 0; - let isBrace = false; - let isBracket = false; - let isGlob = false; - let isExtglob = false; - let isGlobstar = false; - let braceEscaped = false; - let backslashes = false; - let negated = false; - let negatedExtglob = false; - let finished = false; - let braces = 0; - let prev; - let code; - let token = { - value: '', - depth: 0, - isGlob: false - }; - - const eos = () => index >= length; - - const peek = () => str.charCodeAt(index + 1); - - const advance = () => { - prev = code; - return str.charCodeAt(++index); - }; - - while (index < length) { - code = advance(); - let next; - - if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - code = advance(); - - if (code === CHAR_LEFT_CURLY_BRACE) { - braceEscaped = true; - } - - continue; - } - - if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { - braces++; - - while (eos() !== true && (code = advance())) { - if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - advance(); - continue; - } - - if (code === CHAR_LEFT_CURLY_BRACE) { - braces++; - continue; - } - - if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { - isBrace = token.isBrace = true; - isGlob = token.isGlob = true; - finished = true; - - if (scanToEnd === true) { - continue; - } - - break; - } - - if (braceEscaped !== true && code === CHAR_COMMA) { - isBrace = token.isBrace = true; - isGlob = token.isGlob = true; - finished = true; - - if (scanToEnd === true) { - continue; - } - - break; - } - - if (code === CHAR_RIGHT_CURLY_BRACE) { - braces--; - - if (braces === 0) { - braceEscaped = false; - isBrace = token.isBrace = true; - finished = true; - break; - } - } - } - - if (scanToEnd === true) { - continue; - } - - break; - } - - if (code === CHAR_FORWARD_SLASH) { - slashes.push(index); - tokens.push(token); - token = { - value: '', - depth: 0, - isGlob: false - }; - if (finished === true) continue; - - if (prev === CHAR_DOT && index === start + 1) { - start += 2; - continue; - } - - lastIndex = index + 1; - continue; - } - - if (opts.noext !== true) { - const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK; - - if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { - isGlob = token.isGlob = true; - isExtglob = token.isExtglob = true; - finished = true; - - if (code === CHAR_EXCLAMATION_MARK && index === start) { - negatedExtglob = true; - } - - if (scanToEnd === true) { - while (eos() !== true && (code = advance())) { - if (code === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - code = advance(); - continue; - } - - if (code === CHAR_RIGHT_PARENTHESES) { - isGlob = token.isGlob = true; - finished = true; - break; - } - } - - continue; - } - - break; - } - } - - if (code === CHAR_ASTERISK) { - if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; - isGlob = token.isGlob = true; - finished = true; - - if (scanToEnd === true) { - continue; - } - - break; - } - - if (code === CHAR_QUESTION_MARK) { - isGlob = token.isGlob = true; - finished = true; - - if (scanToEnd === true) { - continue; - } - - break; - } - - if (code === CHAR_LEFT_SQUARE_BRACKET) { - while (eos() !== true && (next = advance())) { - if (next === CHAR_BACKWARD_SLASH) { - backslashes = token.backslashes = true; - advance(); - continue; - } - - if (next === CHAR_RIGHT_SQUARE_BRACKET) { - isBracket = token.isBracket = true; - isGlob = token.isGlob = true; - finished = true; - break; - } - } - - if (scanToEnd === true) { - continue; - } - - break; - } - - if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { - negated = token.negated = true; - start++; - continue; - } - - if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { - isGlob = token.isGlob = true; - - if (scanToEnd === true) { - while (eos() !== true && (code = advance())) { - if (code === CHAR_LEFT_PARENTHESES) { - backslashes = token.backslashes = true; - code = advance(); - continue; - } - - if (code === CHAR_RIGHT_PARENTHESES) { - finished = true; - break; - } - } - - continue; - } - - break; - } - - if (isGlob === true) { - finished = true; - - if (scanToEnd === true) { - continue; - } - - break; - } - } - - if (opts.noext === true) { - isExtglob = false; - isGlob = false; - } - - let base = str; - let prefix = ''; - let glob = ''; - - if (start > 0) { - prefix = str.slice(0, start); - str = str.slice(start); - lastIndex -= start; - } - - if (base && isGlob === true && lastIndex > 0) { - base = str.slice(0, lastIndex); - glob = str.slice(lastIndex); - } else if (isGlob === true) { - base = ''; - glob = str; - } else { - base = str; - } - - if (base && base !== '' && base !== '/' && base !== str) { - if (isPathSeparator(base.charCodeAt(base.length - 1))) { - base = base.slice(0, -1); - } - } - - if (opts.unescape === true) { - if (glob) glob = utils.removeBackslashes(glob); - - if (base && backslashes === true) { - base = utils.removeBackslashes(base); - } - } - - const state = { - prefix, - input, - start, - base, - glob, - isBrace, - isBracket, - isGlob, - isExtglob, - isGlobstar, - negated, - negatedExtglob - }; - - if (opts.tokens === true) { - state.maxDepth = 0; - - if (!isPathSeparator(code)) { - tokens.push(token); - } - - state.tokens = tokens; - } - - if (opts.parts === true || opts.tokens === true) { - let prevIndex; - - for (let idx = 0; idx < slashes.length; idx++) { - const n = prevIndex ? prevIndex + 1 : start; - const i = slashes[idx]; - const value = input.slice(n, i); - - if (opts.tokens) { - if (idx === 0 && start !== 0) { - tokens[idx].isPrefix = true; - tokens[idx].value = prefix; - } else { - tokens[idx].value = value; - } - - depth(tokens[idx]); - state.maxDepth += tokens[idx].depth; - } - - if (idx !== 0 || value !== '') { - parts.push(value); - } - - prevIndex = i; - } - - if (prevIndex && prevIndex + 1 < input.length) { - const value = input.slice(prevIndex + 1); - parts.push(value); - - if (opts.tokens) { - tokens[tokens.length - 1].value = value; - depth(tokens[tokens.length - 1]); - state.maxDepth += tokens[tokens.length - 1].depth; - } - } - - state.slashes = slashes; - state.parts = parts; - } - - return state; -}; - -module.exports = scan; - -/***/ }), -/* 1049 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -const path = __webpack_require__(501); - -const win32 = process.platform === 'win32'; - -const { - REGEX_BACKSLASH, - REGEX_REMOVE_BACKSLASH, - REGEX_SPECIAL_CHARS, - REGEX_SPECIAL_CHARS_GLOBAL -} = __webpack_require__(1050); - -exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); - -exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); - -exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); - -exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); - -exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); - -exports.removeBackslashes = str => { - return str.replace(REGEX_REMOVE_BACKSLASH, match => { - return match === '\\' ? '' : match; - }); -}; - -exports.supportsLookbehinds = () => { - const segs = process.version.slice(1).split('.').map(Number); - - if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) { - return true; - } - - return false; -}; - -exports.isWindows = options => { - if (options && typeof options.windows === 'boolean') { - return options.windows; - } - - return win32 === true || path.sep === '\\'; -}; - -exports.escapeLast = (input, char, lastIdx) => { - const idx = input.lastIndexOf(char, lastIdx); - if (idx === -1) return input; - if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); - return `${input.slice(0, idx)}\\${input.slice(idx)}`; -}; - -exports.removePrefix = function (input) { - let state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - let output = input; - - if (output.startsWith('./')) { - output = output.slice(2); - state.prefix = './'; - } - - return output; -}; - -exports.wrapOutput = function (input) { - let state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - const prepend = options.contains ? '' : '^'; - const append = options.contains ? '' : '$'; - let output = `${prepend}(?:${input})${append}`; - - if (state.negated === true) { - output = `(?:^(?!${output}).*$)`; - } - - return output; -}; - -/***/ }), -/* 1050 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const path = __webpack_require__(501); - -const WIN_SLASH = '\\\\/'; -const WIN_NO_SLASH = `[^${WIN_SLASH}]`; -/** - * Posix glob regex - */ - -const DOT_LITERAL = '\\.'; -const PLUS_LITERAL = '\\+'; -const QMARK_LITERAL = '\\?'; -const SLASH_LITERAL = '\\/'; -const ONE_CHAR = '(?=.)'; -const QMARK = '[^/]'; -const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; -const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; -const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; -const NO_DOT = `(?!${DOT_LITERAL})`; -const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; -const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; -const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; -const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; -const STAR = `${QMARK}*?`; -const POSIX_CHARS = { - DOT_LITERAL, - PLUS_LITERAL, - QMARK_LITERAL, - SLASH_LITERAL, - ONE_CHAR, - QMARK, - END_ANCHOR, - DOTS_SLASH, - NO_DOT, - NO_DOTS, - NO_DOT_SLASH, - NO_DOTS_SLASH, - QMARK_NO_DOT, - STAR, - START_ANCHOR -}; -/** - * Windows glob regex - */ - -const WINDOWS_CHARS = { ...POSIX_CHARS, - SLASH_LITERAL: `[${WIN_SLASH}]`, - QMARK: WIN_NO_SLASH, - STAR: `${WIN_NO_SLASH}*?`, - DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, - NO_DOT: `(?!${DOT_LITERAL})`, - NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, - NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, - NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, - QMARK_NO_DOT: `[^.${WIN_SLASH}]`, - START_ANCHOR: `(?:^|[${WIN_SLASH}])`, - END_ANCHOR: `(?:[${WIN_SLASH}]|$)` -}; -/** - * POSIX Bracket Regex - */ - -const POSIX_REGEX_SOURCE = { - alnum: 'a-zA-Z0-9', - alpha: 'a-zA-Z', - ascii: '\\x00-\\x7F', - blank: ' \\t', - cntrl: '\\x00-\\x1F\\x7F', - digit: '0-9', - graph: '\\x21-\\x7E', - lower: 'a-z', - print: '\\x20-\\x7E ', - punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', - space: ' \\t\\r\\n\\v\\f', - upper: 'A-Z', - word: 'A-Za-z0-9_', - xdigit: 'A-Fa-f0-9' -}; -module.exports = { - MAX_LENGTH: 1024 * 64, - POSIX_REGEX_SOURCE, - // regular expressions - REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, - REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, - REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, - REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, - REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, - REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, - // Replace globs with equivalent patterns to reduce parsing time. - REPLACEMENTS: { - '***': '*', - '**/**': '**', - '**/**/**': '**' - }, - // Digits - CHAR_0: 48, - - /* 0 */ - CHAR_9: 57, - - /* 9 */ - // Alphabet chars. - CHAR_UPPERCASE_A: 65, - - /* A */ - CHAR_LOWERCASE_A: 97, - - /* a */ - CHAR_UPPERCASE_Z: 90, - - /* Z */ - CHAR_LOWERCASE_Z: 122, - - /* z */ - CHAR_LEFT_PARENTHESES: 40, - - /* ( */ - CHAR_RIGHT_PARENTHESES: 41, - - /* ) */ - CHAR_ASTERISK: 42, - - /* * */ - // Non-alphabetic chars. - CHAR_AMPERSAND: 38, - - /* & */ - CHAR_AT: 64, - - /* @ */ - CHAR_BACKWARD_SLASH: 92, - - /* \ */ - CHAR_CARRIAGE_RETURN: 13, - - /* \r */ - CHAR_CIRCUMFLEX_ACCENT: 94, - - /* ^ */ - CHAR_COLON: 58, - - /* : */ - CHAR_COMMA: 44, - - /* , */ - CHAR_DOT: 46, - - /* . */ - CHAR_DOUBLE_QUOTE: 34, - - /* " */ - CHAR_EQUAL: 61, - - /* = */ - CHAR_EXCLAMATION_MARK: 33, - - /* ! */ - CHAR_FORM_FEED: 12, - - /* \f */ - CHAR_FORWARD_SLASH: 47, - - /* / */ - CHAR_GRAVE_ACCENT: 96, - - /* ` */ - CHAR_HASH: 35, - - /* # */ - CHAR_HYPHEN_MINUS: 45, - - /* - */ - CHAR_LEFT_ANGLE_BRACKET: 60, - - /* < */ - CHAR_LEFT_CURLY_BRACE: 123, - - /* { */ - CHAR_LEFT_SQUARE_BRACKET: 91, - - /* [ */ - CHAR_LINE_FEED: 10, - - /* \n */ - CHAR_NO_BREAK_SPACE: 160, - - /* \u00A0 */ - CHAR_PERCENT: 37, - - /* % */ - CHAR_PLUS: 43, - - /* + */ - CHAR_QUESTION_MARK: 63, - - /* ? */ - CHAR_RIGHT_ANGLE_BRACKET: 62, - - /* > */ - CHAR_RIGHT_CURLY_BRACE: 125, - - /* } */ - CHAR_RIGHT_SQUARE_BRACKET: 93, - - /* ] */ - CHAR_SEMICOLON: 59, - - /* ; */ - CHAR_SINGLE_QUOTE: 39, - - /* ' */ - CHAR_SPACE: 32, - - /* */ - CHAR_TAB: 9, - - /* \t */ - CHAR_UNDERSCORE: 95, - - /* _ */ - CHAR_VERTICAL_LINE: 124, - - /* | */ - CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, - - /* \uFEFF */ - SEP: path.sep, - - /** - * Create EXTGLOB_CHARS - */ - extglobChars(chars) { - return { - '!': { - type: 'negate', - open: '(?:(?!(?:', - close: `))${chars.STAR})` - }, - '?': { - type: 'qmark', - open: '(?:', - close: ')?' - }, - '+': { - type: 'plus', - open: '(?:', - close: ')+' - }, - '*': { - type: 'star', - open: '(?:', - close: ')*' - }, - '@': { - type: 'at', - open: '(?:', - close: ')' - } - }; - }, - - /** - * Create GLOB_CHARS - */ - globChars(win32) { - return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; - } - -}; - -/***/ }), -/* 1051 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const constants = __webpack_require__(1050); - -const utils = __webpack_require__(1049); -/** - * Constants - */ - - -const { - MAX_LENGTH, - POSIX_REGEX_SOURCE, - REGEX_NON_SPECIAL_CHARS, - REGEX_SPECIAL_CHARS_BACKREF, - REPLACEMENTS -} = constants; -/** - * Helpers - */ - -const expandRange = (args, options) => { - if (typeof options.expandRange === 'function') { - return options.expandRange(...args, options); - } - - args.sort(); - const value = `[${args.join('-')}]`; - - try { - /* eslint-disable-next-line no-new */ - new RegExp(value); - } catch (ex) { - return args.map(v => utils.escapeRegex(v)).join('..'); - } - - return value; -}; -/** - * Create the message for a syntax error - */ - - -const syntaxError = (type, char) => { - return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; -}; -/** - * Parse the given input string. - * @param {String} input - * @param {Object} options - * @return {Object} - */ - - -const parse = (input, options) => { - if (typeof input !== 'string') { - throw new TypeError('Expected a string'); - } - - input = REPLACEMENTS[input] || input; - const opts = { ...options - }; - const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; - let len = input.length; - - if (len > max) { - throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); - } - - const bos = { - type: 'bos', - value: '', - output: opts.prepend || '' - }; - const tokens = [bos]; - const capture = opts.capture ? '' : '?:'; - const win32 = utils.isWindows(options); // create constants based on platform, for windows or posix - - const PLATFORM_CHARS = constants.globChars(win32); - const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); - const { - DOT_LITERAL, - PLUS_LITERAL, - SLASH_LITERAL, - ONE_CHAR, - DOTS_SLASH, - NO_DOT, - NO_DOT_SLASH, - NO_DOTS_SLASH, - QMARK, - QMARK_NO_DOT, - STAR, - START_ANCHOR - } = PLATFORM_CHARS; - - const globstar = opts => { - return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; - }; - - const nodot = opts.dot ? '' : NO_DOT; - const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; - let star = opts.bash === true ? globstar(opts) : STAR; - - if (opts.capture) { - star = `(${star})`; - } // minimatch options support - - - if (typeof opts.noext === 'boolean') { - opts.noextglob = opts.noext; - } - - const state = { - input, - index: -1, - start: 0, - dot: opts.dot === true, - consumed: '', - output: '', - prefix: '', - backtrack: false, - negated: false, - brackets: 0, - braces: 0, - parens: 0, - quotes: 0, - globstar: false, - tokens - }; - input = utils.removePrefix(input, state); - len = input.length; - const extglobs = []; - const braces = []; - const stack = []; - let prev = bos; - let value; - /** - * Tokenizing helpers - */ - - const eos = () => state.index === len - 1; - - const peek = state.peek = function () { - let n = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; - return input[state.index + n]; - }; - - const advance = state.advance = () => input[++state.index] || ''; - - const remaining = () => input.slice(state.index + 1); - - const consume = function () { - let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - let num = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - state.consumed += value; - state.index += num; - }; - - const append = token => { - state.output += token.output != null ? token.output : token.value; - consume(token.value); - }; - - const negate = () => { - let count = 1; - - while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { - advance(); - state.start++; - count++; - } - - if (count % 2 === 0) { - return false; - } - - state.negated = true; - state.start++; - return true; - }; - - const increment = type => { - state[type]++; - stack.push(type); - }; - - const decrement = type => { - state[type]--; - stack.pop(); - }; - /** - * Push tokens onto the tokens array. This helper speeds up - * tokenizing by 1) helping us avoid backtracking as much as possible, - * and 2) helping us avoid creating extra tokens when consecutive - * characters are plain text. This improves performance and simplifies - * lookbehinds. - */ - - - const push = tok => { - if (prev.type === 'globstar') { - const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); - const isExtglob = tok.extglob === true || extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'); - - if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { - state.output = state.output.slice(0, -prev.output.length); - prev.type = 'star'; - prev.value = '*'; - prev.output = star; - state.output += prev.output; - } - } - - if (extglobs.length && tok.type !== 'paren') { - extglobs[extglobs.length - 1].inner += tok.value; - } - - if (tok.value || tok.output) append(tok); - - if (prev && prev.type === 'text' && tok.type === 'text') { - prev.value += tok.value; - prev.output = (prev.output || '') + tok.value; - return; - } - - tok.prev = prev; - tokens.push(tok); - prev = tok; - }; - - const extglobOpen = (type, value) => { - const token = { ...EXTGLOB_CHARS[value], - conditions: 1, - inner: '' - }; - token.prev = prev; - token.parens = state.parens; - token.output = state.output; - const output = (opts.capture ? '(' : '') + token.open; - increment('parens'); - push({ - type, - value, - output: state.output ? '' : ONE_CHAR - }); - push({ - type: 'paren', - extglob: true, - value: advance(), - output - }); - extglobs.push(token); - }; - - const extglobClose = token => { - let output = token.close + (opts.capture ? ')' : ''); - let rest; - - if (token.type === 'negate') { - let extglobStar = star; - - if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { - extglobStar = globstar(opts); - } - - if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { - output = token.close = `)$))${extglobStar}`; - } - - if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { - // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. - // In this case, we need to parse the string and use it in the output of the original pattern. - // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. - // - // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. - const expression = parse(rest, { ...options, - fastpaths: false - }).output; - output = token.close = `)${expression})${extglobStar})`; - } - - if (token.prev.type === 'bos') { - state.negatedExtglob = true; - } - } - - push({ - type: 'paren', - extglob: true, - value, - output - }); - decrement('parens'); - }; - /** - * Fast paths - */ - - - if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { - let backslashes = false; - let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { - if (first === '\\') { - backslashes = true; - return m; - } - - if (first === '?') { - if (esc) { - return esc + first + (rest ? QMARK.repeat(rest.length) : ''); - } - - if (index === 0) { - return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); - } - - return QMARK.repeat(chars.length); - } - - if (first === '.') { - return DOT_LITERAL.repeat(chars.length); - } - - if (first === '*') { - if (esc) { - return esc + first + (rest ? star : ''); - } - - return star; - } - - return esc ? m : `\\${m}`; - }); - - if (backslashes === true) { - if (opts.unescape === true) { - output = output.replace(/\\/g, ''); - } else { - output = output.replace(/\\+/g, m => { - return m.length % 2 === 0 ? '\\\\' : m ? '\\' : ''; - }); - } - } - - if (output === input && opts.contains === true) { - state.output = input; - return state; - } - - state.output = utils.wrapOutput(output, state, options); - return state; - } - /** - * Tokenize input until we reach end-of-string - */ - - - while (!eos()) { - value = advance(); - - if (value === '\u0000') { - continue; - } - /** - * Escaped characters - */ - - - if (value === '\\') { - const next = peek(); - - if (next === '/' && opts.bash !== true) { - continue; - } - - if (next === '.' || next === ';') { - continue; - } - - if (!next) { - value += '\\'; - push({ - type: 'text', - value - }); - continue; - } // collapse slashes to reduce potential for exploits - - - const match = /^\\+/.exec(remaining()); - let slashes = 0; - - if (match && match[0].length > 2) { - slashes = match[0].length; - state.index += slashes; - - if (slashes % 2 !== 0) { - value += '\\'; - } - } - - if (opts.unescape === true) { - value = advance(); - } else { - value += advance(); - } - - if (state.brackets === 0) { - push({ - type: 'text', - value - }); - continue; - } - } - /** - * If we're inside a regex character class, continue - * until we reach the closing bracket. - */ - - - if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { - if (opts.posix !== false && value === ':') { - const inner = prev.value.slice(1); - - if (inner.includes('[')) { - prev.posix = true; - - if (inner.includes(':')) { - const idx = prev.value.lastIndexOf('['); - const pre = prev.value.slice(0, idx); - const rest = prev.value.slice(idx + 2); - const posix = POSIX_REGEX_SOURCE[rest]; - - if (posix) { - prev.value = pre + posix; - state.backtrack = true; - advance(); - - if (!bos.output && tokens.indexOf(prev) === 1) { - bos.output = ONE_CHAR; - } - - continue; - } - } - } - } - - if (value === '[' && peek() !== ':' || value === '-' && peek() === ']') { - value = `\\${value}`; - } - - if (value === ']' && (prev.value === '[' || prev.value === '[^')) { - value = `\\${value}`; - } - - if (opts.posix === true && value === '!' && prev.value === '[') { - value = '^'; - } - - prev.value += value; - append({ - value - }); - continue; - } - /** - * If we're inside a quoted string, continue - * until we reach the closing double quote. - */ - - - if (state.quotes === 1 && value !== '"') { - value = utils.escapeRegex(value); - prev.value += value; - append({ - value - }); - continue; - } - /** - * Double quotes - */ - - - if (value === '"') { - state.quotes = state.quotes === 1 ? 0 : 1; - - if (opts.keepQuotes === true) { - push({ - type: 'text', - value - }); - } - - continue; - } - /** - * Parentheses - */ - - - if (value === '(') { - increment('parens'); - push({ - type: 'paren', - value - }); - continue; - } - - if (value === ')') { - if (state.parens === 0 && opts.strictBrackets === true) { - throw new SyntaxError(syntaxError('opening', '(')); - } - - const extglob = extglobs[extglobs.length - 1]; - - if (extglob && state.parens === extglob.parens + 1) { - extglobClose(extglobs.pop()); - continue; - } - - push({ - type: 'paren', - value, - output: state.parens ? ')' : '\\)' - }); - decrement('parens'); - continue; - } - /** - * Square brackets - */ - - - if (value === '[') { - if (opts.nobracket === true || !remaining().includes(']')) { - if (opts.nobracket !== true && opts.strictBrackets === true) { - throw new SyntaxError(syntaxError('closing', ']')); - } - - value = `\\${value}`; - } else { - increment('brackets'); - } - - push({ - type: 'bracket', - value - }); - continue; - } - - if (value === ']') { - if (opts.nobracket === true || prev && prev.type === 'bracket' && prev.value.length === 1) { - push({ - type: 'text', - value, - output: `\\${value}` - }); - continue; - } - - if (state.brackets === 0) { - if (opts.strictBrackets === true) { - throw new SyntaxError(syntaxError('opening', '[')); - } - - push({ - type: 'text', - value, - output: `\\${value}` - }); - continue; - } - - decrement('brackets'); - const prevValue = prev.value.slice(1); - - if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { - value = `/${value}`; - } - - prev.value += value; - append({ - value - }); // when literal brackets are explicitly disabled - // assume we should match with a regex character class - - if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { - continue; - } - - const escaped = utils.escapeRegex(prev.value); - state.output = state.output.slice(0, -prev.value.length); // when literal brackets are explicitly enabled - // assume we should escape the brackets to match literal characters - - if (opts.literalBrackets === true) { - state.output += escaped; - prev.value = escaped; - continue; - } // when the user specifies nothing, try to match both - - - prev.value = `(${capture}${escaped}|${prev.value})`; - state.output += prev.value; - continue; - } - /** - * Braces - */ - - - if (value === '{' && opts.nobrace !== true) { - increment('braces'); - const open = { - type: 'brace', - value, - output: '(', - outputIndex: state.output.length, - tokensIndex: state.tokens.length - }; - braces.push(open); - push(open); - continue; - } - - if (value === '}') { - const brace = braces[braces.length - 1]; - - if (opts.nobrace === true || !brace) { - push({ - type: 'text', - value, - output: value - }); - continue; - } - - let output = ')'; - - if (brace.dots === true) { - const arr = tokens.slice(); - const range = []; - - for (let i = arr.length - 1; i >= 0; i--) { - tokens.pop(); - - if (arr[i].type === 'brace') { - break; - } - - if (arr[i].type !== 'dots') { - range.unshift(arr[i].value); - } - } - - output = expandRange(range, opts); - state.backtrack = true; - } - - if (brace.comma !== true && brace.dots !== true) { - const out = state.output.slice(0, brace.outputIndex); - const toks = state.tokens.slice(brace.tokensIndex); - brace.value = brace.output = '\\{'; - value = output = '\\}'; - state.output = out; - - for (const t of toks) { - state.output += t.output || t.value; - } - } - - push({ - type: 'brace', - value, - output - }); - decrement('braces'); - braces.pop(); - continue; - } - /** - * Pipes - */ - - - if (value === '|') { - if (extglobs.length > 0) { - extglobs[extglobs.length - 1].conditions++; - } - - push({ - type: 'text', - value - }); - continue; - } - /** - * Commas - */ - - - if (value === ',') { - let output = value; - const brace = braces[braces.length - 1]; - - if (brace && stack[stack.length - 1] === 'braces') { - brace.comma = true; - output = '|'; - } - - push({ - type: 'comma', - value, - output - }); - continue; - } - /** - * Slashes - */ - - - if (value === '/') { - // if the beginning of the glob is "./", advance the start - // to the current index, and don't add the "./" characters - // to the state. This greatly simplifies lookbehinds when - // checking for BOS characters like "!" and "." (not "./") - if (prev.type === 'dot' && state.index === state.start + 1) { - state.start = state.index + 1; - state.consumed = ''; - state.output = ''; - tokens.pop(); - prev = bos; // reset "prev" to the first token - - continue; - } - - push({ - type: 'slash', - value, - output: SLASH_LITERAL - }); - continue; - } - /** - * Dots - */ - - - if (value === '.') { - if (state.braces > 0 && prev.type === 'dot') { - if (prev.value === '.') prev.output = DOT_LITERAL; - const brace = braces[braces.length - 1]; - prev.type = 'dots'; - prev.output += value; - prev.value += value; - brace.dots = true; - continue; - } - - if (state.braces + state.parens === 0 && prev.type !== 'bos' && prev.type !== 'slash') { - push({ - type: 'text', - value, - output: DOT_LITERAL - }); - continue; - } - - push({ - type: 'dot', - value, - output: DOT_LITERAL - }); - continue; - } - /** - * Question marks - */ - - - if (value === '?') { - const isGroup = prev && prev.value === '('; - - if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { - extglobOpen('qmark', value); - continue; - } - - if (prev && prev.type === 'paren') { - const next = peek(); - let output = value; - - if (next === '<' && !utils.supportsLookbehinds()) { - throw new Error('Node.js v10 or higher is required for regex lookbehinds'); - } - - if (prev.value === '(' && !/[!=<:]/.test(next) || next === '<' && !/<([!=]|\w+>)/.test(remaining())) { - output = `\\${value}`; - } - - push({ - type: 'text', - value, - output - }); - continue; - } - - if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { - push({ - type: 'qmark', - value, - output: QMARK_NO_DOT - }); - continue; - } - - push({ - type: 'qmark', - value, - output: QMARK - }); - continue; - } - /** - * Exclamation - */ - - - if (value === '!') { - if (opts.noextglob !== true && peek() === '(') { - if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { - extglobOpen('negate', value); - continue; - } - } - - if (opts.nonegate !== true && state.index === 0) { - negate(); - continue; - } - } - /** - * Plus - */ - - - if (value === '+') { - if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { - extglobOpen('plus', value); - continue; - } - - if (prev && prev.value === '(' || opts.regex === false) { - push({ - type: 'plus', - value, - output: PLUS_LITERAL - }); - continue; - } - - if (prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace') || state.parens > 0) { - push({ - type: 'plus', - value - }); - continue; - } - - push({ - type: 'plus', - value: PLUS_LITERAL - }); - continue; - } - /** - * Plain text - */ - - - if (value === '@') { - if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { - push({ - type: 'at', - extglob: true, - value, - output: '' - }); - continue; - } - - push({ - type: 'text', - value - }); - continue; - } - /** - * Plain text - */ - - - if (value !== '*') { - if (value === '$' || value === '^') { - value = `\\${value}`; - } - - const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); - - if (match) { - value += match[0]; - state.index += match[0].length; - } - - push({ - type: 'text', - value - }); - continue; - } - /** - * Stars - */ - - - if (prev && (prev.type === 'globstar' || prev.star === true)) { - prev.type = 'star'; - prev.star = true; - prev.value += value; - prev.output = star; - state.backtrack = true; - state.globstar = true; - consume(value); - continue; - } - - let rest = remaining(); - - if (opts.noextglob !== true && /^\([^?]/.test(rest)) { - extglobOpen('star', value); - continue; - } - - if (prev.type === 'star') { - if (opts.noglobstar === true) { - consume(value); - continue; - } - - const prior = prev.prev; - const before = prior.prev; - const isStart = prior.type === 'slash' || prior.type === 'bos'; - const afterStar = before && (before.type === 'star' || before.type === 'globstar'); - - if (opts.bash === true && (!isStart || rest[0] && rest[0] !== '/')) { - push({ - type: 'star', - value, - output: '' - }); - continue; - } - - const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); - const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); - - if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { - push({ - type: 'star', - value, - output: '' - }); - continue; - } // strip consecutive `/**/` - - - while (rest.slice(0, 3) === '/**') { - const after = input[state.index + 4]; - - if (after && after !== '/') { - break; - } - - rest = rest.slice(3); - consume('/**', 3); - } - - if (prior.type === 'bos' && eos()) { - prev.type = 'globstar'; - prev.value += value; - prev.output = globstar(opts); - state.output = prev.output; - state.globstar = true; - consume(value); - continue; - } - - if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { - state.output = state.output.slice(0, -(prior.output + prev.output).length); - prior.output = `(?:${prior.output}`; - prev.type = 'globstar'; - prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); - prev.value += value; - state.globstar = true; - state.output += prior.output + prev.output; - consume(value); - continue; - } - - if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { - const end = rest[1] !== void 0 ? '|$' : ''; - state.output = state.output.slice(0, -(prior.output + prev.output).length); - prior.output = `(?:${prior.output}`; - prev.type = 'globstar'; - prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; - prev.value += value; - state.output += prior.output + prev.output; - state.globstar = true; - consume(value + advance()); - push({ - type: 'slash', - value: '/', - output: '' - }); - continue; - } - - if (prior.type === 'bos' && rest[0] === '/') { - prev.type = 'globstar'; - prev.value += value; - prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; - state.output = prev.output; - state.globstar = true; - consume(value + advance()); - push({ - type: 'slash', - value: '/', - output: '' - }); - continue; - } // remove single star from output - - - state.output = state.output.slice(0, -prev.output.length); // reset previous token to globstar - - prev.type = 'globstar'; - prev.output = globstar(opts); - prev.value += value; // reset output with globstar - - state.output += prev.output; - state.globstar = true; - consume(value); - continue; - } - - const token = { - type: 'star', - value, - output: star - }; - - if (opts.bash === true) { - token.output = '.*?'; - - if (prev.type === 'bos' || prev.type === 'slash') { - token.output = nodot + token.output; - } - - push(token); - continue; - } - - if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { - token.output = value; - push(token); - continue; - } - - if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { - if (prev.type === 'dot') { - state.output += NO_DOT_SLASH; - prev.output += NO_DOT_SLASH; - } else if (opts.dot === true) { - state.output += NO_DOTS_SLASH; - prev.output += NO_DOTS_SLASH; - } else { - state.output += nodot; - prev.output += nodot; - } - - if (peek() !== '*') { - state.output += ONE_CHAR; - prev.output += ONE_CHAR; - } - } - - push(token); - } - - while (state.brackets > 0) { - if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); - state.output = utils.escapeLast(state.output, '['); - decrement('brackets'); - } - - while (state.parens > 0) { - if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); - state.output = utils.escapeLast(state.output, '('); - decrement('parens'); - } - - while (state.braces > 0) { - if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); - state.output = utils.escapeLast(state.output, '{'); - decrement('braces'); - } - - if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { - push({ - type: 'maybe_slash', - value: '', - output: `${SLASH_LITERAL}?` - }); - } // rebuild the output if we had to backtrack at any point - - - if (state.backtrack === true) { - state.output = ''; - - for (const token of state.tokens) { - state.output += token.output != null ? token.output : token.value; - - if (token.suffix) { - state.output += token.suffix; - } - } - } - - return state; -}; -/** - * Fast paths for creating regular expressions for common glob patterns. - * This can significantly speed up processing and has very little downside - * impact when none of the fast paths match. - */ - - -parse.fastpaths = (input, options) => { - const opts = { ...options - }; - const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; - const len = input.length; - - if (len > max) { - throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); - } - - input = REPLACEMENTS[input] || input; - const win32 = utils.isWindows(options); // create constants based on platform, for windows or posix - - const { - DOT_LITERAL, - SLASH_LITERAL, - ONE_CHAR, - DOTS_SLASH, - NO_DOT, - NO_DOTS, - NO_DOTS_SLASH, - STAR, - START_ANCHOR - } = constants.globChars(win32); - const nodot = opts.dot ? NO_DOTS : NO_DOT; - const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; - const capture = opts.capture ? '' : '?:'; - const state = { - negated: false, - prefix: '' - }; - let star = opts.bash === true ? '.*?' : STAR; - - if (opts.capture) { - star = `(${star})`; - } - - const globstar = opts => { - if (opts.noglobstar === true) return star; - return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; - }; - - const create = str => { - switch (str) { - case '*': - return `${nodot}${ONE_CHAR}${star}`; - - case '.*': - return `${DOT_LITERAL}${ONE_CHAR}${star}`; - - case '*.*': - return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; - - case '*/*': - return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; - - case '**': - return nodot + globstar(opts); - - case '**/*': - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; - - case '**/*.*': - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; - - case '**/.*': - return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; - - default: - { - const match = /^(.*?)\.(\w+)$/.exec(str); - if (!match) return; - const source = create(match[1]); - if (!source) return; - return source + DOT_LITERAL + match[2]; - } - } - }; - - const output = utils.removePrefix(input, state); - let source = create(output); - - if (source && opts.strictSlashes !== true) { - source += `${SLASH_LITERAL}?`; - } - - return source; -}; - -module.exports = parse; - -/***/ }), -/* 1052 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.merge = void 0; - -const merge2 = __webpack_require__(1024); - -function merge(streams) { - const mergedStream = merge2(streams); - streams.forEach(stream => { - stream.once('error', error => mergedStream.emit('error', error)); - }); - mergedStream.once('close', () => propagateCloseEventToSources(streams)); - mergedStream.once('end', () => propagateCloseEventToSources(streams)); - return mergedStream; -} - -exports.merge = merge; - -function propagateCloseEventToSources(streams) { - streams.forEach(stream => stream.emit('close')); -} - -/***/ }), -/* 1053 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.isEmpty = exports.isString = void 0; - -function isString(input) { - return typeof input === 'string'; -} - -exports.isString = isString; - -function isEmpty(input) { - return input === ''; -} - -exports.isEmpty = isEmpty; - -/***/ }), -/* 1054 */ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.removeDuplicateSlashes = exports.transform = void 0; -/** - * Matches a sequence of two or more consecutive slashes, excluding the first two slashes at the beginning of the string. - * The latter is due to the presence of the device path at the beginning of the UNC path. - * @todo rewrite to negative lookbehind with the next major release. - */ - -const DOUBLE_SLASH_RE = /(?!^)\/{2,}/g; - -function transform(patterns) { - return patterns.map(pattern => removeDuplicateSlashes(pattern)); -} - -exports.transform = transform; -/** - * This package only works with forward slashes as a path separator. - * Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes. - */ - -function removeDuplicateSlashes(pattern) { - return pattern.replace(DOUBLE_SLASH_RE, '/'); -} - -exports.removeDuplicateSlashes = removeDuplicateSlashes; - -/***/ }), -/* 1055 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const async_1 = __webpack_require__(1056); - -const provider_1 = __webpack_require__(1086); - -class ProviderAsync extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new async_1.default(this._settings); - } - - async read(task) { - const root = this._getRootDirectory(task); - - const options = this._getReaderOptions(task); - - const entries = await this.api(root, task, options); - return entries.map(entry => options.transform(entry)); - } - - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - - return this._reader.static(task.patterns, options); - } - -} - -exports["default"] = ProviderAsync; - -/***/ }), -/* 1056 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const fsWalk = __webpack_require__(1057); - -const reader_1 = __webpack_require__(1084); - -const stream_1 = __webpack_require__(1085); - -class ReaderAsync extends reader_1.default { - constructor() { - super(...arguments); - this._walkAsync = fsWalk.walk; - this._readerStream = new stream_1.default(this._settings); - } - - dynamic(root, options) { - return new Promise((resolve, reject) => { - this._walkAsync(root, options, (error, entries) => { - if (error === null) { - resolve(entries); - } else { - reject(error); - } - }); - }); - } - - async static(patterns, options) { - const entries = []; - - const stream = this._readerStream.static(patterns, options); // After #235, replace it with an asynchronous iterator. - - - return new Promise((resolve, reject) => { - stream.once('error', reject); - stream.on('data', entry => entries.push(entry)); - stream.once('end', () => resolve(entries)); - }); - } - -} - -exports["default"] = ReaderAsync; - -/***/ }), -/* 1057 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0; - -const async_1 = __webpack_require__(1058); - -const stream_1 = __webpack_require__(1080); - -const sync_1 = __webpack_require__(1081); - -const settings_1 = __webpack_require__(1083); - -exports.Settings = settings_1.default; - -function walk(directory, optionsOrSettingsOrCallback, callback) { - if (typeof optionsOrSettingsOrCallback === 'function') { - new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback); - return; - } - - new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback); -} - -exports.walk = walk; - -function walkSync(directory, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - const provider = new sync_1.default(directory, settings); - return provider.read(); -} - -exports.walkSync = walkSync; - -function walkStream(directory, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - const provider = new stream_1.default(directory, settings); - return provider.read(); -} - -exports.walkStream = walkStream; - -function getSettings() { - let settingsOrOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - if (settingsOrOptions instanceof settings_1.default) { - return settingsOrOptions; - } - - return new settings_1.default(settingsOrOptions); -} - -/***/ }), -/* 1058 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const async_1 = __webpack_require__(1059); - +const async_1 = __webpack_require__(1034); class AsyncProvider { constructor(_root, _settings) { this._root = _root; @@ -151802,37 +131653,29 @@ class AsyncProvider { this._reader = new async_1.default(this._root, this._settings); this._storage = []; } - read(callback) { this._reader.onError(error => { callFailureCallback(callback, error); }); - this._reader.onEntry(entry => { this._storage.push(entry); }); - this._reader.onEnd(() => { callSuccessCallback(callback, this._storage); }); - this._reader.read(); } - } - exports["default"] = AsyncProvider; - function callFailureCallback(callback, error) { callback(error); } - function callSuccessCallback(callback, entries) { callback(null, entries); } /***/ }), -/* 1059 */ +/* 1034 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -151841,17 +131684,11 @@ function callSuccessCallback(callback, entries) { Object.defineProperty(exports, "__esModule", ({ value: true })); - -const events_1 = __webpack_require__(1005); - -const fsScandir = __webpack_require__(1060); - -const fastq = __webpack_require__(1076); - -const common = __webpack_require__(1078); - -const reader_1 = __webpack_require__(1079); - +const events_1 = __webpack_require__(1016); +const fsScandir = __webpack_require__(1035); +const fastq = __webpack_require__(1051); +const common = __webpack_require__(1053); +const reader_1 = __webpack_require__(1054); class AsyncReader extends reader_1.default { constructor(_root, _settings) { super(_root, _settings); @@ -151861,14 +131698,12 @@ class AsyncReader extends reader_1.default { this._queue = fastq(this._worker.bind(this), this._settings.concurrency); this._isFatalError = false; this._isDestroyed = false; - this._queue.drain = () => { if (!this._isFatalError) { this._emitter.emit('end'); } }; } - read() { this._isFatalError = false; this._isDestroyed = false; @@ -151877,102 +131712,79 @@ class AsyncReader extends reader_1.default { }); return this._emitter; } - get isDestroyed() { return this._isDestroyed; } - destroy() { if (this._isDestroyed) { throw new Error('The reader is already destroyed'); } - this._isDestroyed = true; - this._queue.killAndDrain(); } - onEntry(callback) { this._emitter.on('entry', callback); } - onError(callback) { this._emitter.once('error', callback); } - onEnd(callback) { this._emitter.once('end', callback); } - _pushToQueue(directory, base) { const queueItem = { directory, base }; - this._queue.push(queueItem, error => { if (error !== null) { this._handleError(error); } }); } - _worker(item, done) { this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => { if (error !== null) { done(error, undefined); return; } - for (const entry of entries) { this._handleEntry(entry, item.base); } - done(null, undefined); }); } - _handleError(error) { if (this._isDestroyed || !common.isFatalError(this._settings, error)) { return; } - this._isFatalError = true; this._isDestroyed = true; - this._emitter.emit('error', error); } - _handleEntry(entry, base) { if (this._isDestroyed || this._isFatalError) { return; } - const fullpath = entry.path; - if (base !== undefined) { entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); } - if (common.isAppliedFilter(this._settings.entryFilter, entry)) { this._emitEntry(entry); } - if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); } } - _emitEntry(entry) { this._emitter.emit('entry', entry); } - } - exports["default"] = AsyncReader; /***/ }), -/* 1060 */ +/* 1035 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -151982,45 +131794,33 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Settings = exports.scandirSync = exports.scandir = void 0; - -const async = __webpack_require__(1061); - -const sync = __webpack_require__(1073); - -const settings_1 = __webpack_require__(1074); - +const async = __webpack_require__(1036); +const sync = __webpack_require__(1048); +const settings_1 = __webpack_require__(1049); exports.Settings = settings_1.default; - function scandir(path, optionsOrSettingsOrCallback, callback) { if (typeof optionsOrSettingsOrCallback === 'function') { async.read(path, getSettings(), optionsOrSettingsOrCallback); return; } - async.read(path, getSettings(optionsOrSettingsOrCallback), callback); } - exports.scandir = scandir; - function scandirSync(path, optionsOrSettings) { const settings = getSettings(optionsOrSettings); return sync.read(path, settings); } - exports.scandirSync = scandirSync; - function getSettings() { let settingsOrOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - if (settingsOrOptions instanceof settings_1.default) { return settingsOrOptions; } - return new settings_1.default(settingsOrOptions); } /***/ }), -/* 1061 */ +/* 1036 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -152030,28 +131830,19 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; - -const fsStat = __webpack_require__(1062); - -const rpl = __webpack_require__(1067); - -const constants_1 = __webpack_require__(1069); - -const utils = __webpack_require__(1070); - -const common = __webpack_require__(1072); - +const fsStat = __webpack_require__(1037); +const rpl = __webpack_require__(1042); +const constants_1 = __webpack_require__(1044); +const utils = __webpack_require__(1045); +const common = __webpack_require__(1047); function read(directory, settings, callback) { if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { readdirWithFileTypes(directory, settings, callback); return; } - readdir(directory, settings, callback); } - exports.read = read; - function readdirWithFileTypes(directory, settings, callback) { settings.fs.readdir(directory, { withFileTypes: true @@ -152060,63 +131851,52 @@ function readdirWithFileTypes(directory, settings, callback) { callFailureCallback(callback, readdirError); return; } - const entries = dirents.map(dirent => ({ dirent, name: dirent.name, path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) })); - if (!settings.followSymbolicLinks) { callSuccessCallback(callback, entries); return; } - const tasks = entries.map(entry => makeRplTaskEntry(entry, settings)); rpl(tasks, (rplError, rplEntries) => { if (rplError !== null) { callFailureCallback(callback, rplError); return; } - callSuccessCallback(callback, rplEntries); }); }); } - exports.readdirWithFileTypes = readdirWithFileTypes; - function makeRplTaskEntry(entry, settings) { return done => { if (!entry.dirent.isSymbolicLink()) { done(null, entry); return; } - settings.fs.stat(entry.path, (statError, stats) => { if (statError !== null) { if (settings.throwErrorOnBrokenSymbolicLink) { done(statError); return; } - done(null, entry); return; } - entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); done(null, entry); }); }; } - function readdir(directory, settings, callback) { settings.fs.readdir(directory, (readdirError, names) => { if (readdirError !== null) { callFailureCallback(callback, readdirError); return; } - const tasks = names.map(name => { const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); return done => { @@ -152125,17 +131905,14 @@ function readdir(directory, settings, callback) { done(error); return; } - const entry = { name, path, dirent: utils.fs.createDirentFromStats(name, stats) }; - if (settings.stats) { entry.stats = stats; } - done(null, entry); }); }; @@ -152145,24 +131922,20 @@ function readdir(directory, settings, callback) { callFailureCallback(callback, rplError); return; } - callSuccessCallback(callback, entries); }); }); } - exports.readdir = readdir; - function callFailureCallback(callback, error) { callback(error); } - function callSuccessCallback(callback, result) { callback(null, result); } /***/ }), -/* 1062 */ +/* 1037 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -152172,45 +131945,33 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.statSync = exports.stat = exports.Settings = void 0; - -const async = __webpack_require__(1063); - -const sync = __webpack_require__(1064); - -const settings_1 = __webpack_require__(1065); - +const async = __webpack_require__(1038); +const sync = __webpack_require__(1039); +const settings_1 = __webpack_require__(1040); exports.Settings = settings_1.default; - function stat(path, optionsOrSettingsOrCallback, callback) { if (typeof optionsOrSettingsOrCallback === 'function') { async.read(path, getSettings(), optionsOrSettingsOrCallback); return; } - async.read(path, getSettings(optionsOrSettingsOrCallback), callback); } - exports.stat = stat; - function statSync(path, optionsOrSettings) { const settings = getSettings(optionsOrSettings); return sync.read(path, settings); } - exports.statSync = statSync; - function getSettings() { let settingsOrOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - if (settingsOrOptions instanceof settings_1.default) { return settingsOrOptions; } - return new settings_1.default(settingsOrOptions); } /***/ }), -/* 1063 */ +/* 1038 */ /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -152220,51 +131981,42 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.read = void 0; - function read(path, settings, callback) { settings.fs.lstat(path, (lstatError, lstat) => { if (lstatError !== null) { callFailureCallback(callback, lstatError); return; } - if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { callSuccessCallback(callback, lstat); return; } - settings.fs.stat(path, (statError, stat) => { if (statError !== null) { if (settings.throwErrorOnBrokenSymbolicLink) { callFailureCallback(callback, statError); return; } - callSuccessCallback(callback, lstat); return; } - if (settings.markSymbolicLink) { stat.isSymbolicLink = () => true; } - callSuccessCallback(callback, stat); }); }); } - exports.read = read; - function callFailureCallback(callback, error) { callback(error); } - function callSuccessCallback(callback, result) { callback(null, result); } /***/ }), -/* 1064 */ +/* 1039 */ /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -152274,35 +132026,28 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.read = void 0; - function read(path, settings) { const lstat = settings.fs.lstatSync(path); - if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { return lstat; } - try { const stat = settings.fs.statSync(path); - if (settings.markSymbolicLink) { stat.isSymbolicLink = () => true; } - return stat; } catch (error) { if (!settings.throwErrorOnBrokenSymbolicLink) { return lstat; } - throw error; } } - exports.read = read; /***/ }), -/* 1065 */ +/* 1040 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -152311,30 +132056,24 @@ exports.read = read; Object.defineProperty(exports, "__esModule", ({ value: true })); - -const fs = __webpack_require__(1066); - +const fs = __webpack_require__(1041); class Settings { constructor() { let _options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - this._options = _options; this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); this.fs = fs.createFileSystemAdapter(this._options.fs); this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); } - _getValue(option, value) { return option !== null && option !== void 0 ? option : value; } - } - exports["default"] = Settings; /***/ }), -/* 1066 */ +/* 1041 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -152344,39 +132083,31 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; - -const fs = __webpack_require__(971); - +const fs = __webpack_require__(982); exports.FILE_SYSTEM_ADAPTER = { lstat: fs.lstat, stat: fs.stat, lstatSync: fs.lstatSync, statSync: fs.statSync }; - function createFileSystemAdapter(fsMethods) { if (fsMethods === undefined) { return exports.FILE_SYSTEM_ADAPTER; } - return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); } - exports.createFileSystemAdapter = createFileSystemAdapter; /***/ }), -/* 1067 */ +/* 1042 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /*! run-parallel. MIT License. Feross Aboukhadijeh */ module.exports = runParallel; - -const queueMicrotask = __webpack_require__(1068); - +const queueMicrotask = __webpack_require__(1043); function runParallel(tasks, cb) { let results, pending, keys; let isSync = true; - if (Array.isArray(tasks)) { results = []; pending = tasks.length; @@ -152385,24 +132116,19 @@ function runParallel(tasks, cb) { results = {}; pending = keys.length; } - function done(err) { function end() { if (cb) cb(err, results); cb = null; } - if (isSync) queueMicrotask(end);else end(); } - function each(i, err, result) { results[i] = result; - if (--pending === 0 || err) { done(err); } } - if (!pending) { // empty done(null); @@ -152421,23 +132147,23 @@ function runParallel(tasks, cb) { }); }); } - isSync = false; } /***/ }), -/* 1068 */ +/* 1043 */ /***/ ((module) => { /*! queue-microtask. MIT License. Feross Aboukhadijeh */ let promise; -module.exports = typeof queueMicrotask === 'function' ? queueMicrotask.bind(typeof window !== 'undefined' ? window : global) // reuse resolved promise, and allocate it lazily +module.exports = typeof queueMicrotask === 'function' ? queueMicrotask.bind(typeof window !== 'undefined' ? window : global) +// reuse resolved promise, and allocate it lazily : cb => (promise || (promise = Promise.resolve())).then(cb).catch(err => setTimeout(() => { throw err; }, 0)); /***/ }), -/* 1069 */ +/* 1044 */ /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -152448,11 +132174,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; const NODE_PROCESS_VERSION_PARTS = process.versions.node.split('.'); - if (NODE_PROCESS_VERSION_PARTS[0] === undefined || NODE_PROCESS_VERSION_PARTS[1] === undefined) { throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`); } - const MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10); const MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10); const SUPPORTED_MAJOR_VERSION = 10; @@ -152462,11 +132186,10 @@ const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION /** * IS `true` for Node.js 10.10 and greater. */ - exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR; /***/ }), -/* 1070 */ +/* 1045 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -152476,13 +132199,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.fs = void 0; - -const fs = __webpack_require__(1071); - +const fs = __webpack_require__(1046); exports.fs = fs; /***/ }), -/* 1071 */ +/* 1046 */ /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -152492,7 +132213,6 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createDirentFromStats = void 0; - class DirentFromStats { constructor(name, stats) { this.name = name; @@ -152504,17 +132224,14 @@ class DirentFromStats { this.isSocket = stats.isSocket.bind(stats); this.isSymbolicLink = stats.isSymbolicLink.bind(stats); } - } - function createDirentFromStats(name, stats) { return new DirentFromStats(name, stats); } - exports.createDirentFromStats = createDirentFromStats; /***/ }), -/* 1072 */ +/* 1047 */ /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -152524,7 +132241,6 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.joinPathSegments = void 0; - function joinPathSegments(a, b, separator) { /** * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). @@ -152532,14 +132248,12 @@ function joinPathSegments(a, b, separator) { if (a.endsWith(separator)) { return a + b; } - return a + separator + b; } - exports.joinPathSegments = joinPathSegments; /***/ }), -/* 1073 */ +/* 1048 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -152549,25 +132263,17 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; - -const fsStat = __webpack_require__(1062); - -const constants_1 = __webpack_require__(1069); - -const utils = __webpack_require__(1070); - -const common = __webpack_require__(1072); - +const fsStat = __webpack_require__(1037); +const constants_1 = __webpack_require__(1044); +const utils = __webpack_require__(1045); +const common = __webpack_require__(1047); function read(directory, settings) { if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { return readdirWithFileTypes(directory, settings); } - return readdir(directory, settings); } - exports.read = read; - function readdirWithFileTypes(directory, settings) { const dirents = settings.fs.readdirSync(directory, { withFileTypes: true @@ -152578,7 +132284,6 @@ function readdirWithFileTypes(directory, settings) { name: dirent.name, path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) }; - if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) { try { const stats = settings.fs.statSync(entry.path); @@ -152589,13 +132294,10 @@ function readdirWithFileTypes(directory, settings) { } } } - return entry; }); } - exports.readdirWithFileTypes = readdirWithFileTypes; - function readdir(directory, settings) { const names = settings.fs.readdirSync(directory); return names.map(name => { @@ -152606,19 +132308,16 @@ function readdir(directory, settings) { path: entryPath, dirent: utils.fs.createDirentFromStats(name, stats) }; - if (settings.stats) { entry.stats = stats; } - return entry; }); } - exports.readdir = readdir; /***/ }), -/* 1074 */ +/* 1049 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -152627,17 +132326,12 @@ exports.readdir = readdir; Object.defineProperty(exports, "__esModule", ({ value: true })); - -const path = __webpack_require__(501); - -const fsStat = __webpack_require__(1062); - -const fs = __webpack_require__(1075); - +const path = __webpack_require__(523); +const fsStat = __webpack_require__(1037); +const fs = __webpack_require__(1050); class Settings { constructor() { let _options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - this._options = _options; this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); this.fs = fs.createFileSystemAdapter(this._options.fs); @@ -152650,17 +132344,14 @@ class Settings { throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink }); } - _getValue(option, value) { return option !== null && option !== void 0 ? option : value; } - } - exports["default"] = Settings; /***/ }), -/* 1075 */ +/* 1050 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -152670,9 +132361,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; - -const fs = __webpack_require__(971); - +const fs = __webpack_require__(982); exports.FILE_SYSTEM_ADAPTER = { lstat: fs.lstat, stat: fs.stat, @@ -152681,38 +132370,32 @@ exports.FILE_SYSTEM_ADAPTER = { readdir: fs.readdir, readdirSync: fs.readdirSync }; - function createFileSystemAdapter(fsMethods) { if (fsMethods === undefined) { return exports.FILE_SYSTEM_ADAPTER; } - return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); } - exports.createFileSystemAdapter = createFileSystemAdapter; /***/ }), -/* 1076 */ +/* 1051 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; + /* eslint-disable no-var */ - -var reusify = __webpack_require__(1077); - +var reusify = __webpack_require__(1052); function fastqueue(context, worker, concurrency) { if (typeof context === 'function') { concurrency = worker; worker = context; context = null; } - if (concurrency < 1) { throw new Error('fastqueue concurrency must be greater than 1'); } - var cache = reusify(Task); var queueHead = null; var queueTail = null; @@ -152737,53 +132420,41 @@ function fastqueue(context, worker, concurrency) { error: error }; return self; - function running() { return _running; } - function pause() { self.paused = true; } - function length() { var current = queueHead; var counter = 0; - while (current) { current = current.next; counter++; } - return counter; } - function getQueue() { var current = queueHead; var tasks = []; - while (current) { tasks.push(current.value); current = current.next; } - return tasks; } - function resume() { if (!self.paused) return; self.paused = false; - for (var i = 0; i < self.concurrency; i++) { _running++; release(); } } - function idle() { return _running === 0 && self.length() === 0; } - function push(value, done) { var current = cache.get(); current.context = context; @@ -152791,7 +132462,6 @@ function fastqueue(context, worker, concurrency) { current.value = value; current.callback = done || noop; current.errorHandler = errorHandler; - if (_running === self.concurrency || self.paused) { if (queueTail) { queueTail.next = current; @@ -152806,14 +132476,12 @@ function fastqueue(context, worker, concurrency) { worker.call(context, current.value, current.worked); } } - function unshift(value, done) { var current = cache.get(); current.context = context; current.release = release; current.value = value; current.callback = done || noop; - if (_running === self.concurrency || self.paused) { if (queueHead) { current.next = queueHead; @@ -152828,24 +132496,19 @@ function fastqueue(context, worker, concurrency) { worker.call(context, current.value, current.worked); } } - function release(holder) { if (holder) { cache.release(holder); } - var next = queueHead; - if (next) { if (!self.paused) { if (queueTail === queueHead) { queueTail = null; } - queueHead = next.next; next.next = null; worker.call(context, next.value, next.worked); - if (queueTail === null) { self.empty(); } @@ -152856,27 +132519,22 @@ function fastqueue(context, worker, concurrency) { self.drain(); } } - function kill() { queueHead = null; queueTail = null; self.drain = noop; } - function killAndDrain() { queueHead = null; queueTail = null; self.drain(); self.drain = noop; } - function error(handler) { errorHandler = handler; } } - function noop() {} - function Task() { this.value = null; this.callback = noop; @@ -152885,36 +132543,30 @@ function Task() { this.context = null; this.errorHandler = null; var self = this; - this.worked = function worked(err, result) { var callback = self.callback; var errorHandler = self.errorHandler; var val = self.value; self.value = null; self.callback = noop; - if (self.errorHandler) { errorHandler(err, val); } - callback.call(self.context, err, result); self.release(self); }; } - function queueAsPromised(context, worker, concurrency) { if (typeof context === 'function') { concurrency = worker; worker = context; context = null; } - function asyncWrapper(arg, cb) { worker.call(this, arg).then(function (res) { cb(null, res); }, cb); } - var queue = fastqueue(context, asyncWrapper, concurrency); var pushCb = queue.push; var unshiftCb = queue.unshift; @@ -152922,7 +132574,6 @@ function queueAsPromised(context, worker, concurrency) { queue.unshift = unshift; queue.drained = drained; return queue; - function push(value) { var p = new Promise(function (resolve, reject) { pushCb(value, function (err, result) { @@ -152930,17 +132581,16 @@ function queueAsPromised(context, worker, concurrency) { reject(err); return; } - resolve(result); }); - }); // Let's fork the promise chain to + }); + + // Let's fork the promise chain to // make the error bubble up to the user but // not lead to a unhandledRejection - p.catch(noop); return p; } - function unshift(value) { var p = new Promise(function (resolve, reject) { unshiftCb(value, function (err, result) { @@ -152948,18 +132598,22 @@ function queueAsPromised(context, worker, concurrency) { reject(err); return; } - resolve(result); }); - }); // Let's fork the promise chain to + }); + + // Let's fork the promise chain to // make the error bubble up to the user but // not lead to a unhandledRejection - p.catch(noop); return p; } - function drained() { + if (queue.idle()) { + return new Promise(function (resolve) { + resolve(); + }); + } var previousDrain = queue.drain; var p = new Promise(function (resolve) { queue.drain = function () { @@ -152970,12 +132624,11 @@ function queueAsPromised(context, worker, concurrency) { return p; } } - module.exports = fastqueue; module.exports.promise = queueAsPromised; /***/ }), -/* 1077 */ +/* 1052 */ /***/ ((module) => { "use strict"; @@ -152984,36 +132637,30 @@ module.exports.promise = queueAsPromised; function reusify(Constructor) { var head = new Constructor(); var tail = head; - function get() { var current = head; - if (current.next) { head = current.next; } else { head = new Constructor(); tail = head; } - current.next = null; return current; } - function release(obj) { tail.next = obj; tail = obj; } - return { get: get, release: release }; } - module.exports = reusify; /***/ }), -/* 1078 */ +/* 1053 */ /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -153023,29 +132670,21 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0; - function isFatalError(settings, error) { if (settings.errorFilter === null) { return true; } - return !settings.errorFilter(error); } - exports.isFatalError = isFatalError; - function isAppliedFilter(filter, value) { return filter === null || filter(value); } - exports.isAppliedFilter = isAppliedFilter; - function replacePathSegmentSeparator(filepath, separator) { return filepath.split(/[/\\]/).join(separator); } - exports.replacePathSegmentSeparator = replacePathSegmentSeparator; - function joinPathSegments(a, b, separator) { if (a === '') { return b; @@ -153053,19 +132692,15 @@ function joinPathSegments(a, b, separator) { /** * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). */ - - if (a.endsWith(separator)) { return a + b; } - return a + separator + b; } - exports.joinPathSegments = joinPathSegments; /***/ }), -/* 1079 */ +/* 1054 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -153074,22 +132709,18 @@ exports.joinPathSegments = joinPathSegments; Object.defineProperty(exports, "__esModule", ({ value: true })); - -const common = __webpack_require__(1078); - +const common = __webpack_require__(1053); class Reader { constructor(_root, _settings) { this._root = _root; this._settings = _settings; this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator); } - } - exports["default"] = Reader; /***/ }), -/* 1080 */ +/* 1055 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -153098,11 +132729,8 @@ exports["default"] = Reader; Object.defineProperty(exports, "__esModule", ({ value: true })); - -const stream_1 = __webpack_require__(1025); - -const async_1 = __webpack_require__(1059); - +const stream_1 = __webpack_require__(1056); +const async_1 = __webpack_require__(1034); class StreamProvider { constructor(_root, _settings) { this._root = _root; @@ -153118,31 +132746,31 @@ class StreamProvider { } }); } - read() { this._reader.onError(error => { this._stream.emit('error', error); }); - this._reader.onEntry(entry => { this._stream.push(entry); }); - this._reader.onEnd(() => { this._stream.push(null); }); - this._reader.read(); - return this._stream; } - } - exports["default"] = StreamProvider; /***/ }), -/* 1081 */ +/* 1056 */ +/***/ ((module) => { + +"use strict"; +module.exports = require("stream"); + +/***/ }), +/* 1057 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -153151,26 +132779,21 @@ exports["default"] = StreamProvider; Object.defineProperty(exports, "__esModule", ({ value: true })); - -const sync_1 = __webpack_require__(1082); - +const sync_1 = __webpack_require__(1058); class SyncProvider { constructor(_root, _settings) { this._root = _root; this._settings = _settings; this._reader = new sync_1.default(this._root, this._settings); } - read() { return this._reader.read(); } - } - exports["default"] = SyncProvider; /***/ }), -/* 1082 */ +/* 1058 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -153179,13 +132802,9 @@ exports["default"] = SyncProvider; Object.defineProperty(exports, "__esModule", ({ value: true })); - -const fsScandir = __webpack_require__(1060); - -const common = __webpack_require__(1078); - -const reader_1 = __webpack_require__(1079); - +const fsScandir = __webpack_require__(1035); +const common = __webpack_require__(1053); +const reader_1 = __webpack_require__(1054); class SyncReader extends reader_1.default { constructor() { super(...arguments); @@ -153193,32 +132812,25 @@ class SyncReader extends reader_1.default { this._storage = []; this._queue = new Set(); } - read() { this._pushToQueue(this._root, this._settings.basePath); - this._handleQueue(); - return this._storage; } - _pushToQueue(directory, base) { this._queue.add({ directory, base }); } - _handleQueue() { for (const item of this._queue.values()) { this._handleDirectory(item.directory, item.base); } } - _handleDirectory(directory, base) { try { const entries = this._scandir(directory, this._settings.fsScandirSettings); - for (const entry of entries) { this._handleEntry(entry, base); } @@ -153226,41 +132838,32 @@ class SyncReader extends reader_1.default { this._handleError(error); } } - _handleError(error) { if (!common.isFatalError(this._settings, error)) { return; } - throw error; } - _handleEntry(entry, base) { const fullpath = entry.path; - if (base !== undefined) { entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); } - if (common.isAppliedFilter(this._settings.entryFilter, entry)) { this._pushToStorage(entry); } - if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); } } - _pushToStorage(entry) { this._storage.push(entry); } - } - exports["default"] = SyncReader; /***/ }), -/* 1083 */ +/* 1059 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; @@ -153269,15 +132872,11 @@ exports["default"] = SyncReader; Object.defineProperty(exports, "__esModule", ({ value: true })); - -const path = __webpack_require__(501); - -const fsScandir = __webpack_require__(1060); - +const path = __webpack_require__(523); +const fsScandir = __webpack_require__(1035); class Settings { constructor() { let _options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - this._options = _options; this.basePath = this._getValue(this._options.basePath, undefined); this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY); @@ -153293,1184 +132892,27 @@ class Settings { throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink }); } - _getValue(option, value) { return option !== null && option !== void 0 ? option : value; } - } - exports["default"] = Settings; /***/ }), -/* 1084 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const path = __webpack_require__(501); - -const fsStat = __webpack_require__(1062); - -const utils = __webpack_require__(1028); - -class Reader { - constructor(_settings) { - this._settings = _settings; - this._fsStatSettings = new fsStat.Settings({ - followSymbolicLink: this._settings.followSymbolicLinks, - fs: this._settings.fs, - throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks - }); - } - - _getFullEntryPath(filepath) { - return path.resolve(this._settings.cwd, filepath); - } - - _makeEntry(stats, pattern) { - const entry = { - name: pattern, - path: pattern, - dirent: utils.fs.createDirentFromStats(pattern, stats) - }; - - if (this._settings.stats) { - entry.stats = stats; - } - - return entry; - } - - _isFatalError(error) { - return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors; - } - -} - -exports["default"] = Reader; - -/***/ }), -/* 1085 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const stream_1 = __webpack_require__(1025); - -const fsStat = __webpack_require__(1062); - -const fsWalk = __webpack_require__(1057); - -const reader_1 = __webpack_require__(1084); - -class ReaderStream extends reader_1.default { - constructor() { - super(...arguments); - this._walkStream = fsWalk.walkStream; - this._stat = fsStat.stat; - } - - dynamic(root, options) { - return this._walkStream(root, options); - } - - static(patterns, options) { - const filepaths = patterns.map(this._getFullEntryPath, this); - const stream = new stream_1.PassThrough({ - objectMode: true - }); - - stream._write = (index, _enc, done) => { - return this._getEntry(filepaths[index], patterns[index], options).then(entry => { - if (entry !== null && options.entryFilter(entry)) { - stream.push(entry); - } - - if (index === filepaths.length - 1) { - stream.end(); - } - - done(); - }).catch(done); - }; - - for (let i = 0; i < filepaths.length; i++) { - stream.write(i); - } - - return stream; - } - - _getEntry(filepath, pattern, options) { - return this._getStat(filepath).then(stats => this._makeEntry(stats, pattern)).catch(error => { - if (options.errorFilter(error)) { - return null; - } - - throw error; - }); - } - - _getStat(filepath) { - return new Promise((resolve, reject) => { - this._stat(filepath, this._fsStatSettings, (error, stats) => { - return error === null ? resolve(stats) : reject(error); - }); - }); - } - -} - -exports["default"] = ReaderStream; - -/***/ }), -/* 1086 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const path = __webpack_require__(501); - -const deep_1 = __webpack_require__(1087); - -const entry_1 = __webpack_require__(1090); - -const error_1 = __webpack_require__(1091); - -const entry_2 = __webpack_require__(1092); - -class Provider { - constructor(_settings) { - this._settings = _settings; - this.errorFilter = new error_1.default(this._settings); - this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions()); - this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions()); - this.entryTransformer = new entry_2.default(this._settings); - } - - _getRootDirectory(task) { - return path.resolve(this._settings.cwd, task.base); - } - - _getReaderOptions(task) { - const basePath = task.base === '.' ? '' : task.base; - return { - basePath, - pathSegmentSeparator: '/', - concurrency: this._settings.concurrency, - deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative), - entryFilter: this.entryFilter.getFilter(task.positive, task.negative), - errorFilter: this.errorFilter.getFilter(), - followSymbolicLinks: this._settings.followSymbolicLinks, - fs: this._settings.fs, - stats: this._settings.stats, - throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink, - transform: this.entryTransformer.getTransformer() - }; - } - - _getMicromatchOptions() { - return { - dot: this._settings.dot, - matchBase: this._settings.baseNameMatch, - nobrace: !this._settings.braceExpansion, - nocase: !this._settings.caseSensitiveMatch, - noext: !this._settings.extglob, - noglobstar: !this._settings.globstar, - posix: true, - strictSlashes: false - }; - } - -} - -exports["default"] = Provider; - -/***/ }), -/* 1087 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const utils = __webpack_require__(1028); - -const partial_1 = __webpack_require__(1088); - -class DeepFilter { - constructor(_settings, _micromatchOptions) { - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - } - - getFilter(basePath, positive, negative) { - const matcher = this._getMatcher(positive); - - const negativeRe = this._getNegativePatternsRe(negative); - - return entry => this._filter(basePath, entry, matcher, negativeRe); - } - - _getMatcher(patterns) { - return new partial_1.default(patterns, this._settings, this._micromatchOptions); - } - - _getNegativePatternsRe(patterns) { - const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern); - return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); - } - - _filter(basePath, entry, matcher, negativeRe) { - if (this._isSkippedByDeep(basePath, entry.path)) { - return false; - } - - if (this._isSkippedSymbolicLink(entry)) { - return false; - } - - const filepath = utils.path.removeLeadingDotSegment(entry.path); - - if (this._isSkippedByPositivePatterns(filepath, matcher)) { - return false; - } - - return this._isSkippedByNegativePatterns(filepath, negativeRe); - } - - _isSkippedByDeep(basePath, entryPath) { - /** - * Avoid unnecessary depth calculations when it doesn't matter. - */ - if (this._settings.deep === Infinity) { - return false; - } - - return this._getEntryLevel(basePath, entryPath) >= this._settings.deep; - } - - _getEntryLevel(basePath, entryPath) { - const entryPathDepth = entryPath.split('/').length; - - if (basePath === '') { - return entryPathDepth; - } - - const basePathDepth = basePath.split('/').length; - return entryPathDepth - basePathDepth; - } - - _isSkippedSymbolicLink(entry) { - return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink(); - } - - _isSkippedByPositivePatterns(entryPath, matcher) { - return !this._settings.baseNameMatch && !matcher.match(entryPath); - } - - _isSkippedByNegativePatterns(entryPath, patternsRe) { - return !utils.pattern.matchAny(entryPath, patternsRe); - } - -} - -exports["default"] = DeepFilter; - -/***/ }), -/* 1088 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const matcher_1 = __webpack_require__(1089); - -class PartialMatcher extends matcher_1.default { - match(filepath) { - const parts = filepath.split('/'); - const levels = parts.length; - - const patterns = this._storage.filter(info => !info.complete || info.segments.length > levels); - - for (const pattern of patterns) { - const section = pattern.sections[0]; - /** - * In this case, the pattern has a globstar and we must read all directories unconditionally, - * but only if the level has reached the end of the first group. - * - * fixtures/{a,b}/** - * ^ true/false ^ always true - */ - - if (!pattern.complete && levels > section.length) { - return true; - } - - const match = parts.every((part, index) => { - const segment = pattern.segments[index]; - - if (segment.dynamic && segment.patternRe.test(part)) { - return true; - } - - if (!segment.dynamic && segment.pattern === part) { - return true; - } - - return false; - }); - - if (match) { - return true; - } - } - - return false; - } - -} - -exports["default"] = PartialMatcher; - -/***/ }), -/* 1089 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const utils = __webpack_require__(1028); - -class Matcher { - constructor(_patterns, _settings, _micromatchOptions) { - this._patterns = _patterns; - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - this._storage = []; - - this._fillStorage(); - } - - _fillStorage() { - /** - * The original pattern may include `{,*,**,a/*}`, which will lead to problems with matching (unresolved level). - * So, before expand patterns with brace expansion into separated patterns. - */ - const patterns = utils.pattern.expandPatternsWithBraceExpansion(this._patterns); - - for (const pattern of patterns) { - const segments = this._getPatternSegments(pattern); - - const sections = this._splitSegmentsIntoSections(segments); - - this._storage.push({ - complete: sections.length <= 1, - pattern, - segments, - sections - }); - } - } - - _getPatternSegments(pattern) { - const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions); - return parts.map(part => { - const dynamic = utils.pattern.isDynamicPattern(part, this._settings); - - if (!dynamic) { - return { - dynamic: false, - pattern: part - }; - } - - return { - dynamic: true, - pattern: part, - patternRe: utils.pattern.makeRe(part, this._micromatchOptions) - }; - }); - } - - _splitSegmentsIntoSections(segments) { - return utils.array.splitWhen(segments, segment => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern)); - } - -} - -exports["default"] = Matcher; - -/***/ }), -/* 1090 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const utils = __webpack_require__(1028); - -class EntryFilter { - constructor(_settings, _micromatchOptions) { - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - this.index = new Map(); - } - - getFilter(positive, negative) { - const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions); - const negativeRe = utils.pattern.convertPatternsToRe(negative, this._micromatchOptions); - return entry => this._filter(entry, positiveRe, negativeRe); - } - - _filter(entry, positiveRe, negativeRe) { - if (this._settings.unique && this._isDuplicateEntry(entry)) { - return false; - } - - if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) { - return false; - } - - if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) { - return false; - } - - const filepath = this._settings.baseNameMatch ? entry.name : entry.path; - const isDirectory = entry.dirent.isDirectory(); - const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(entry.path, negativeRe, isDirectory); - - if (this._settings.unique && isMatched) { - this._createIndexRecord(entry); - } - - return isMatched; - } - - _isDuplicateEntry(entry) { - return this.index.has(entry.path); - } - - _createIndexRecord(entry) { - this.index.set(entry.path, undefined); - } - - _onlyFileFilter(entry) { - return this._settings.onlyFiles && !entry.dirent.isFile(); - } - - _onlyDirectoryFilter(entry) { - return this._settings.onlyDirectories && !entry.dirent.isDirectory(); - } - - _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) { - if (!this._settings.absolute) { - return false; - } - - const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath); - return utils.pattern.matchAny(fullpath, patternsRe); - } - - _isMatchToPatterns(entryPath, patternsRe, isDirectory) { - const filepath = utils.path.removeLeadingDotSegment(entryPath); // Trying to match files and directories by patterns. - - const isMatched = utils.pattern.matchAny(filepath, patternsRe); // A pattern with a trailling slash can be used for directory matching. - // To apply such pattern, we need to add a tralling slash to the path. - - if (!isMatched && isDirectory) { - return utils.pattern.matchAny(filepath + '/', patternsRe); - } - - return isMatched; - } - -} - -exports["default"] = EntryFilter; - -/***/ }), -/* 1091 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const utils = __webpack_require__(1028); - -class ErrorFilter { - constructor(_settings) { - this._settings = _settings; - } - - getFilter() { - return error => this._isNonFatalError(error); - } - - _isNonFatalError(error) { - return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors; - } - -} - -exports["default"] = ErrorFilter; - -/***/ }), -/* 1092 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const utils = __webpack_require__(1028); - -class EntryTransformer { - constructor(_settings) { - this._settings = _settings; - } - - getTransformer() { - return entry => this._transform(entry); - } - - _transform(entry) { - let filepath = entry.path; - - if (this._settings.absolute) { - filepath = utils.path.makeAbsolute(this._settings.cwd, filepath); - filepath = utils.path.unixify(filepath); - } - - if (this._settings.markDirectories && entry.dirent.isDirectory()) { - filepath += '/'; - } - - if (!this._settings.objectMode) { - return filepath; - } - - return Object.assign(Object.assign({}, entry), { - path: filepath - }); - } - -} - -exports["default"] = EntryTransformer; - -/***/ }), -/* 1093 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const stream_1 = __webpack_require__(1025); - -const stream_2 = __webpack_require__(1085); - -const provider_1 = __webpack_require__(1086); - -class ProviderStream extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new stream_2.default(this._settings); - } - - read(task) { - const root = this._getRootDirectory(task); - - const options = this._getReaderOptions(task); - - const source = this.api(root, task, options); - const destination = new stream_1.Readable({ - objectMode: true, - read: () => {} - }); - source.once('error', error => destination.emit('error', error)).on('data', entry => destination.emit('data', options.transform(entry))).once('end', () => destination.emit('end')); - destination.once('close', () => source.destroy()); - return destination; - } - - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - - return this._reader.static(task.patterns, options); - } - -} - -exports["default"] = ProviderStream; - -/***/ }), -/* 1094 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const sync_1 = __webpack_require__(1095); - -const provider_1 = __webpack_require__(1086); - -class ProviderSync extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new sync_1.default(this._settings); - } - - read(task) { - const root = this._getRootDirectory(task); - - const options = this._getReaderOptions(task); - - const entries = this.api(root, task, options); - return entries.map(options.transform); - } - - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - - return this._reader.static(task.patterns, options); - } - -} - -exports["default"] = ProviderSync; - -/***/ }), -/* 1095 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); - -const fsStat = __webpack_require__(1062); - -const fsWalk = __webpack_require__(1057); - -const reader_1 = __webpack_require__(1084); - -class ReaderSync extends reader_1.default { - constructor() { - super(...arguments); - this._walkSync = fsWalk.walkSync; - this._statSync = fsStat.statSync; - } - - dynamic(root, options) { - return this._walkSync(root, options); - } - - static(patterns, options) { - const entries = []; - - for (const pattern of patterns) { - const filepath = this._getFullEntryPath(pattern); - - const entry = this._getEntry(filepath, pattern, options); - - if (entry === null || !options.entryFilter(entry)) { - continue; - } - - entries.push(entry); - } - - return entries; - } - - _getEntry(filepath, pattern, options) { - try { - const stats = this._getStat(filepath); - - return this._makeEntry(stats, pattern); - } catch (error) { - if (options.errorFilter(error)) { - return null; - } - - throw error; - } - } - - _getStat(filepath) { - return this._statSync(filepath, this._fsStatSettings); - } - -} - -exports["default"] = ReaderSync; - -/***/ }), -/* 1096 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; - -const fs = __webpack_require__(971); - -const os = __webpack_require__(982); -/** - * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero. - * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107 - */ - - -const CPU_COUNT = Math.max(os.cpus().length, 1); -exports.DEFAULT_FILE_SYSTEM_ADAPTER = { - lstat: fs.lstat, - lstatSync: fs.lstatSync, - stat: fs.stat, - statSync: fs.statSync, - readdir: fs.readdir, - readdirSync: fs.readdirSync -}; - -class Settings { - constructor() { - let _options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - this._options = _options; - this.absolute = this._getValue(this._options.absolute, false); - this.baseNameMatch = this._getValue(this._options.baseNameMatch, false); - this.braceExpansion = this._getValue(this._options.braceExpansion, true); - this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true); - this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT); - this.cwd = this._getValue(this._options.cwd, process.cwd()); - this.deep = this._getValue(this._options.deep, Infinity); - this.dot = this._getValue(this._options.dot, false); - this.extglob = this._getValue(this._options.extglob, true); - this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true); - this.fs = this._getFileSystemMethods(this._options.fs); - this.globstar = this._getValue(this._options.globstar, true); - this.ignore = this._getValue(this._options.ignore, []); - this.markDirectories = this._getValue(this._options.markDirectories, false); - this.objectMode = this._getValue(this._options.objectMode, false); - this.onlyDirectories = this._getValue(this._options.onlyDirectories, false); - this.onlyFiles = this._getValue(this._options.onlyFiles, true); - this.stats = this._getValue(this._options.stats, false); - this.suppressErrors = this._getValue(this._options.suppressErrors, false); - this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false); - this.unique = this._getValue(this._options.unique, true); - - if (this.onlyDirectories) { - this.onlyFiles = false; - } - - if (this.stats) { - this.objectMode = true; - } - } - - _getValue(option, value) { - return option === undefined ? value : option; - } - - _getFileSystemMethods() { - let methods = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods); - } - -} - -exports["default"] = Settings; - -/***/ }), -/* 1097 */ +/* 1060 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; -const path = __webpack_require__(501); - -const pathType = __webpack_require__(1098); - -const getExtensions = extensions => extensions.length > 1 ? `{${extensions.join(',')}}` : extensions[0]; - -const getPath = (filepath, cwd) => { - const pth = filepath[0] === '!' ? filepath.slice(1) : filepath; - return path.isAbsolute(pth) ? pth : path.join(cwd, pth); -}; - -const addExtensions = (file, extensions) => { - if (path.extname(file)) { - return `**/${file}`; - } - - return `**/${file}.${getExtensions(extensions)}`; -}; - -const getGlob = (directory, options) => { - if (options.files && !Array.isArray(options.files)) { - throw new TypeError(`Expected \`files\` to be of type \`Array\` but received type \`${typeof options.files}\``); - } - - if (options.extensions && !Array.isArray(options.extensions)) { - throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof options.extensions}\``); - } - - if (options.files && options.extensions) { - return options.files.map(x => path.posix.join(directory, addExtensions(x, options.extensions))); - } - - if (options.files) { - return options.files.map(x => path.posix.join(directory, `**/${x}`)); - } - - if (options.extensions) { - return [path.posix.join(directory, `**/*.${getExtensions(options.extensions)}`)]; - } - - return [path.posix.join(directory, '**')]; -}; - -module.exports = async (input, options) => { - options = { - cwd: process.cwd(), - ...options - }; - - if (typeof options.cwd !== 'string') { - throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof options.cwd}\``); - } - - const globs = await Promise.all([].concat(input).map(async x => { - const isDirectory = await pathType.isDirectory(getPath(x, options.cwd)); - return isDirectory ? getGlob(x, options) : x; - })); - return [].concat.apply([], globs); // eslint-disable-line prefer-spread -}; - -module.exports.sync = (input, options) => { - options = { - cwd: process.cwd(), - ...options - }; - - if (typeof options.cwd !== 'string') { - throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof options.cwd}\``); - } - - const globs = [].concat(input).map(x => pathType.isDirectorySync(getPath(x, options.cwd)) ? getGlob(x, options) : x); - return [].concat.apply([], globs); // eslint-disable-line prefer-spread +const path = __webpack_require__(523); +module.exports = (childPath, parentPath) => { + const relation = path.relative(parentPath, childPath); + return Boolean(relation && relation !== '..' && !relation.startsWith(`..${path.sep}`) && relation !== path.resolve(childPath)); }; /***/ }), -/* 1098 */ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - - -const { - promisify -} = __webpack_require__(516); - -const fs = __webpack_require__(971); - -async function isType(fsStatType, statsMethodName, filePath) { - if (typeof filePath !== 'string') { - throw new TypeError(`Expected a string, got ${typeof filePath}`); - } - - try { - const stats = await promisify(fs[fsStatType])(filePath); - return stats[statsMethodName](); - } catch (error) { - if (error.code === 'ENOENT') { - return false; - } - - throw error; - } -} - -function isTypeSync(fsStatType, statsMethodName, filePath) { - if (typeof filePath !== 'string') { - throw new TypeError(`Expected a string, got ${typeof filePath}`); - } - - try { - return fs[fsStatType](filePath)[statsMethodName](); - } catch (error) { - if (error.code === 'ENOENT') { - return false; - } - - throw error; - } -} - -exports.isFile = isType.bind(null, 'stat', 'isFile'); -exports.isDirectory = isType.bind(null, 'stat', 'isDirectory'); -exports.isSymlink = isType.bind(null, 'lstat', 'isSymbolicLink'); -exports.isFileSync = isTypeSync.bind(null, 'statSync', 'isFile'); -exports.isDirectorySync = isTypeSync.bind(null, 'statSync', 'isDirectory'); -exports.isSymlinkSync = isTypeSync.bind(null, 'lstatSync', 'isSymbolicLink'); - -/***/ }), -/* 1099 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const { - promisify -} = __webpack_require__(516); - -const fs = __webpack_require__(971); - -const path = __webpack_require__(501); - -const fastGlob = __webpack_require__(1026); - -const gitIgnore = __webpack_require__(827); - -const slash = __webpack_require__(1100); - -const DEFAULT_IGNORE = ['**/node_modules/**', '**/flow-typed/**', '**/coverage/**', '**/.git']; -const readFileP = promisify(fs.readFile); - -const mapGitIgnorePatternTo = base => ignore => { - if (ignore.startsWith('!')) { - return '!' + path.posix.join(base, ignore.slice(1)); - } - - return path.posix.join(base, ignore); -}; - -const parseGitIgnore = (content, options) => { - const base = slash(path.relative(options.cwd, path.dirname(options.fileName))); - return content.split(/\r?\n/).filter(Boolean).filter(line => !line.startsWith('#')).map(mapGitIgnorePatternTo(base)); -}; - -const reduceIgnore = files => { - const ignores = gitIgnore(); - - for (const file of files) { - ignores.add(parseGitIgnore(file.content, { - cwd: file.cwd, - fileName: file.filePath - })); - } - - return ignores; -}; - -const ensureAbsolutePathForCwd = (cwd, p) => { - cwd = slash(cwd); - - if (path.isAbsolute(p)) { - if (slash(p).startsWith(cwd)) { - return p; - } - - throw new Error(`Path ${p} is not in cwd ${cwd}`); - } - - return path.join(cwd, p); -}; - -const getIsIgnoredPredecate = (ignores, cwd) => { - return p => ignores.ignores(slash(path.relative(cwd, ensureAbsolutePathForCwd(cwd, p.path || p)))); -}; - -const getFile = async (file, cwd) => { - const filePath = path.join(cwd, file); - const content = await readFileP(filePath, 'utf8'); - return { - cwd, - filePath, - content - }; -}; - -const getFileSync = (file, cwd) => { - const filePath = path.join(cwd, file); - const content = fs.readFileSync(filePath, 'utf8'); - return { - cwd, - filePath, - content - }; -}; - -const normalizeOptions = function () { - let { - ignore = [], - cwd = slash(process.cwd()) - } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - return { - ignore, - cwd - }; -}; - -module.exports = async options => { - options = normalizeOptions(options); - const paths = await fastGlob('**/.gitignore', { - ignore: DEFAULT_IGNORE.concat(options.ignore), - cwd: options.cwd - }); - const files = await Promise.all(paths.map(file => getFile(file, options.cwd))); - const ignores = reduceIgnore(files); - return getIsIgnoredPredecate(ignores, options.cwd); -}; - -module.exports.sync = options => { - options = normalizeOptions(options); - const paths = fastGlob.sync('**/.gitignore', { - ignore: DEFAULT_IGNORE.concat(options.ignore), - cwd: options.cwd - }); - const files = paths.map(file => getFileSync(file, options.cwd)); - const ignores = reduceIgnore(files); - return getIsIgnoredPredecate(ignores, options.cwd); -}; - -/***/ }), -/* 1100 */ -/***/ ((module) => { - -"use strict"; - - -module.exports = path => { - const isExtendedLengthPath = /^\\\\\?\\/.test(path); - const hasNonAscii = /[^\u0000-\u0080]+/.test(path); // eslint-disable-line no-control-regex - - if (isExtendedLengthPath || hasNonAscii) { - return path; - } - - return path.replace(/\\/g, '/'); -}; - -/***/ }), -/* 1101 */ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const { - Transform -} = __webpack_require__(1025); - -class ObjectTransform extends Transform { - constructor() { - super({ - objectMode: true - }); - } - -} - -class FilterStream extends ObjectTransform { - constructor(filter) { - super(); - this._filter = filter; - } - - _transform(data, encoding, callback) { - if (this._filter(data)) { - this.push(data); - } - - callback(); - } - -} - -class UniqueStream extends ObjectTransform { - constructor() { - super(); - this._pushed = new Set(); - } - - _transform(data, encoding, callback) { - if (!this._pushed.has(data)) { - this.push(data); - - this._pushed.add(data); - } - - callback(); - } - -} - -module.exports = { - FilterStream, - UniqueStream -}; - -/***/ }), -/* 1102 */ +/* 1061 */ /***/ ((module) => { function webpackEmptyAsyncContext(req) { @@ -154484,7 +132926,7 @@ function webpackEmptyAsyncContext(req) { } webpackEmptyAsyncContext.keys = () => ([]); webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext; -webpackEmptyAsyncContext.id = 1102; +webpackEmptyAsyncContext.id = 1061; module.exports = webpackEmptyAsyncContext; /***/ }) @@ -154541,9 +132983,9 @@ module.exports = webpackEmptyAsyncContext; /******/ // startup /******/ // Load entry module and return exports /******/ __webpack_require__(0); -/******/ __webpack_require__(499); -/******/ __webpack_require__(500); -/******/ var __webpack_exports__ = __webpack_require__(969); +/******/ __webpack_require__(521); +/******/ __webpack_require__(522); +/******/ var __webpack_exports__ = __webpack_require__(980); /******/ /******/ return __webpack_exports__; /******/ })()